/* ==========================================================================
   NdisCare Pro — Custom Styles  (Bootstrap 5.3 base)
   Only things Bootstrap cannot do are defined here.
   ========================================================================== */

/* ── Root tokens ──────────────────────────────────────────────────────── */
:root {
  --nc-sidebar-width:  260px;
  --nc-sidebar-collapsed-width: 78px;
  --nc-topbar-h:       56px;
  --nc-primary:        #7c3aed;
  --nc-ndis:           #0073bc;
  --nc-icon-weight:    200;
  --nc-font-size-body: .9375rem;
  --nc-font-size-sm:   .8125rem;
  --nc-font-size-xs:   .75rem;
  --nc-card-table-pad-x: 1rem;
}

/* ── Body ─────────────────────────────────────────────────────────────── */
/* On desktop the body uses a subtle tint so cards visibly "lift" off the
   surface. On mobile (where the sidebar lives offscreen) we match body to
   card bg so there's no perceived strip between the topbar and the content
   when cards are inset by content padding. */
body {
  background: var(--bs-tertiary-bg);
  font-size: var(--nc-font-size-body);
  line-height: 1.5;
}
@media (max-width: 991.98px) {
  body { background: var(--bs-body-bg); }
  [data-bs-theme="dark"] body { background: var(--bs-body-bg); }
}

small,
.small,
.form-text {
  font-size: var(--nc-font-size-sm);
  line-height: 1.45;
}

.form-label {
  font-size: var(--nc-font-size-sm);
  font-weight: 600;
}

.badge {
  font-size: var(--nc-font-size-xs);
  font-weight: 600;
  letter-spacing: .01em;
}

/* Shared embedded workspace shell */
.nc-embed-page #nc-sidebar,
.nc-embed-page #nc-topbar,
.nc-embed-page #pwa-mobile-nav {
  display: none !important;
}

.nc-embed-page #nc-main {
  display: block !important;
  margin-left: 0 !important;
  background: var(--bs-body-bg) !important;
}

.nc-embed-page #nc-content {
  padding: 1rem !important;
  max-width: none !important;
  background: var(--bs-body-bg) !important;
}

@media (max-width: 991.98px) {
  .nc-embed-page #nc-content {
    padding: .75rem !important;
  }
}

#sa-agreement-details .row {
  --bs-gutter-y: .75rem;
}

#sa-agreement-details .form-label {
  margin-bottom: .35rem;
}

.table {
  font-size: var(--nc-font-size-sm);
}

.table > :not(caption) > * > * {
  padding-top: .55rem;
  padding-bottom: .55rem;
}

.table thead th {
  font-size: var(--nc-font-size-xs);
  font-weight: 600;
  color: var(--bs-secondary-color);
}

/* Tall modal — fills the viewport so search/results panels can show many rows.
   Targets both regular and modal-dialog-scrollable variants. */
.nc-modal-tall .modal-dialog {
  height: calc(100vh - 1rem);
  max-height: calc(100vh - 1rem);
  margin-top: .5rem;
  margin-bottom: .5rem;
}
.nc-modal-tall .modal-content {
  height: 100%;
  max-height: 100%;
}
@media (min-width: 576px) {
  .nc-modal-tall .modal-dialog {
    height: calc(100vh - 3.5rem);
    max-height: calc(100vh - 3.5rem);
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
  }
}

.table tbody .text-muted,
.table tbody small,
.table tbody .small {
  font-size: var(--nc-font-size-xs);
}

.card > .table-responsive {
  padding-inline: var(--nc-card-table-pad-x);
}

.card > .table-responsive > .table {
  margin-bottom: 0;
}

/* ── Sidebar (push — flex sibling of #nc-main) ──────────────────── */
#nc-sidebar {
  width: var(--nc-sidebar-width);
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--bs-body-bg);
  border-right: 1px solid var(--bs-border-color);
  overflow: hidden;
  transition: margin-left .25s ease, margin-right .25s ease, width .25s ease, box-shadow .25s ease, border-right-color .15s;
  z-index: 1030;
}
/* Desktop collapsed (icon-only) sidebar state — only applies above the mobile
   breakpoint; on mobile this class is ignored so the sidebar stays fully
   off-screen instead of appearing as a 78px strip. */
@media (min-width: 992px) {
  #nc-sidebar.nc-sidebar-hidden {
    width: var(--nc-sidebar-collapsed-width);
    margin-left: 0;
  }
  #nc-sidebar.nc-sb-resize-hover,
  #nc-sidebar.nc-sb-resize-drag  { border-right-color: var(--nc-primary); }
  #nc-sidebar.nc-sb-resize-hover { cursor: col-resize; }
}
/* Suppress transition during page-load state restoration */
#nc-sidebar.nc-no-transition {
  transition: none !important;
}

/* Auto-hide sidebar on mobile */
@media (max-width: 991.98px) {
  #nc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    /* Use transform to fully translate offscreen — and reset margin/border
       so neither can bleed past the viewport edge as a visible strip. */
    margin-left: 0;
    border-right: 0;
    transform: translateX(-100%);
    transition: transform .25s ease, box-shadow .25s ease;
  }
  #nc-sidebar.nc-sidebar-visible {
    transform: translateX(0);
    border-right: 1px solid var(--bs-border-color);
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  #nc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1035;
  }
  #nc-backdrop.show { display: block; }
}

/* ── Sidebar header ── */
.sb-header {
  display: flex; align-items: center;
  padding: 12px; min-height: 64px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--bs-border-color);
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 1; min-width: 0;
  padding: 6px 8px;
  border-radius: var(--bs-border-radius);
}
.sb-brand-copy { min-width: 0; }
.sb-logo-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--nc-primary); font-size: 1.85rem; flex-shrink: 0;
}
.sb-app-name { font-weight: 700; font-size: .9rem; color: var(--bs-emphasis-color); line-height: 1.15; }
.sb-tagline  { display: none; }
.sb-close {
  background: transparent; border: 1px solid transparent; color: #64748b;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer; flex-shrink: 0;
  transition: background .12s, color .12s, transform .12s;
}
.sb-close:hover { background: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); transform: translateY(-1px); }

/* ── Nav body ── */
.sb-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 10px 0 16px;
  scrollbar-width: thin; scrollbar-color: var(--bs-border-color) transparent;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--bs-border-color); border-radius: 2px; }

/* Section label */
.sb-section {
  padding: 14px 16px 6px;
  font-size: .64rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--bs-secondary-color);
}

/* Top-level nav items */
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 0 12px 2px;
  color: var(--bs-secondary-color); font-size: .84rem; font-weight: 500;
  text-decoration: none; border-radius: var(--bs-border-radius);
  transition: background .12s, color .12s;
  position: relative;
}
button.sb-item {
  background: none; border: none;
  width: calc(100% - 20px); text-align: left; cursor: pointer;
}
.sb-item:hover  { background: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); }
.sb-item.active { background: rgba(var(--bs-primary-rgb), .08); color: var(--nc-primary); font-weight: 600; }
.sb-icon {
  width: 20px; height: 20px;
  text-align: center; flex-shrink: 0; font-size: .88rem; opacity: .92;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0;
  background: transparent;
  color: currentColor;
}
.sb-icon .material-symbols-outlined,
.sb-sub-item .material-symbols-outlined,
.pwa-tb-btn .material-symbols-outlined,
.sb-logo-icon .material-symbols-outlined,
.sb-close .material-symbols-outlined { font-size: 20px; line-height: 1; }
.sb-logo-icon .nc-app-icon { font-size: 2.25rem; }
.sb-sub-item .material-symbols-outlined { font-size: 14px; margin-right: 4px; }
.sb-item:hover .sb-icon, .sb-item.active .sb-icon { opacity: 1; background: transparent; color: inherit; }
.sb-chevron { margin-left: auto; font-size: 18px !important; transition: transform .2s; flex-shrink: 0; opacity: .45; }
.sb-toggle.collapsed .sb-chevron { transform: rotate(-90deg); }
button.sb-section { background: none; border: none; width: 100%; cursor: pointer; text-align: left; display: flex; align-items: center; justify-content: space-between; }
.sb-section-chevron { font-size: 12px !important; opacity: .45; flex-shrink: 0; transition: transform .2s; }
button.sb-section.collapsed .sb-section-chevron { transform: rotate(-90deg); }
.sb-badge { margin-left: auto; background: rgba(var(--bs-primary-rgb), .12) !important; color: var(--nc-primary); font-size: .64rem; font-weight: 800; padding: 3px 7px; border-radius: 999px; }

/* Sidebar nav items should always inherit the sidebar row colour instead of
   leaking global semantic text/icon utilities into the menu. */
#nc-sidebar .sb-item .material-symbols-outlined,
#nc-sidebar .sb-item i,
#nc-sidebar .sb-item svg,
#nc-sidebar .sb-sub-item .material-symbols-outlined,
#nc-sidebar .sb-sub-item i,
#nc-sidebar .sb-sub-item svg,
#nc-sidebar .sb-item .text-primary,
#nc-sidebar .sb-item .text-info,
#nc-sidebar .sb-item .text-secondary,
#nc-sidebar .sb-item .text-body-secondary,
#nc-sidebar .sb-item .text-muted,
#nc-sidebar .sb-sub-item .text-primary,
#nc-sidebar .sb-sub-item .text-info,
#nc-sidebar .sb-sub-item .text-secondary,
#nc-sidebar .sb-sub-item .text-body-secondary,
#nc-sidebar .sb-sub-item .text-muted {
  color: currentColor !important;
}

/* Desktop collapsed sidebar rail */
@media (min-width: 992px) {
  #nc-sidebar.nc-sidebar-hidden .sb-header {
    padding-inline: 10px;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-brand {
    justify-content: center;
    padding-inline: 0;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-brand-copy,
  #nc-sidebar.nc-sidebar-hidden .sb-section,
  #nc-sidebar.nc-sidebar-hidden .sb-label,
  #nc-sidebar.nc-sidebar-hidden .sb-chevron,
  #nc-sidebar.nc-sidebar-hidden .sb-badge,
  #nc-sidebar.nc-sidebar-hidden .sb-version-row,
  #nc-sidebar.nc-sidebar-hidden .sb-user-copy {
    display: none !important;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-close {
    display: none !important;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-item,
  #nc-sidebar.nc-sidebar-hidden button.sb-item,
  #nc-sidebar.nc-sidebar-hidden .sb-user-row {
    width: 58px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
    overflow: hidden;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-sub-item {
    display: none !important;
  }
  #nc-sidebar.nc-sidebar-hidden .collapse {
    display: none !important;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-footer {
    padding-inline: 10px;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-user-row {
    gap: 0;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  #nc-sidebar.nc-sidebar-hidden .sb-user-link {
    flex: 0 0 auto;
  }
  #nc-sidebar.nc-sidebar-hidden .nc-theme-toggle,
  #nc-sidebar.nc-sidebar-hidden .sb-logout-btn {
    display: none;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open {
    width: var(--nc-sidebar-width);
    margin-right: calc(-1 * (var(--nc-sidebar-width) - var(--nc-sidebar-collapsed-width)));
    overflow: visible;
    box-shadow: 14px 0 30px rgba(15,23,42,.14);
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-header {
    padding-inline: 14px;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-brand {
    justify-content: flex-start;
    padding-inline: 10px;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-brand-copy,
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-user-copy {
    display: block !important;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-section {
    display: block !important;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open button.sb-section {
    display: flex !important;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-label,
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-chevron,
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-badge {
    display: initial !important;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-version-row {
    display: flex !important;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-item,
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open button.sb-item {
    width: calc(100% - 20px);
    margin-left: 10px;
    margin-right: 10px;
    padding-left: 14px;
    padding-right: 12px;
    justify-content: flex-start;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-sub-item {
    display: flex !important;
    width: auto;
    margin-left: 10px;
    margin-right: 10px;
    padding-left: 44px;
    padding-right: 12px;
    justify-content: flex-start;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .collapse.show,
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .collapsing {
    display: block !important;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-footer {
    padding-inline: 14px;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-user-row {
    width: auto;
    margin-left: 0;
    margin-right: 0;
    gap: 8px;
    padding: 10px 12px;
    justify-content: flex-start;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-user-link {
    flex: 1 1 auto;
  }
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .nc-theme-toggle,
  #nc-sidebar.nc-sidebar-hidden.nc-sidebar-hover-open .sb-logout-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   Batch A — global UI improvements
   Toasts, modals, button loading, empty states, skeletons, restrained colour,
   datatable polish. Page-agnostic — works wherever it lands.
   ────────────────────────────────────────────────────────────────────────── */

/* Toast container — bottom-right stack */
#nc-toast-stack {
  position: fixed; bottom: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1080; max-width: 380px; pointer-events: none;
}
.nc-toast {
  pointer-events: auto;
  background: #fff; color: #1f2937;
  border-radius: 10px; padding: 12px 14px 12px 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.08);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .85rem; line-height: 1.35;
  border-left: 3px solid #6b7280;
  animation: nc-toast-in .25s cubic-bezier(.34,1.56,.64,1) both;
  min-width: 240px;
}
.nc-toast.nc-fade-out { animation: nc-toast-out .2s ease both; }
.nc-toast .nc-toast-icon { font-size: 18px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.nc-toast .nc-toast-msg  { flex: 1; min-width: 0; word-wrap: break-word; }
.nc-toast .nc-toast-close { background: none; border: none; padding: 0; line-height: 1; opacity: .5; font-size: 16px; cursor: pointer; color: inherit; }
.nc-toast .nc-toast-close:hover { opacity: 1; }
.nc-toast.success { border-left-color: #16a34a; }  .nc-toast.success .nc-toast-icon { color: #16a34a; }
.nc-toast.danger,
.nc-toast.error   { border-left-color: #dc2626; }  .nc-toast.danger .nc-toast-icon, .nc-toast.error .nc-toast-icon { color: #dc2626; }
.nc-toast.warning { border-left-color: #d97706; }  .nc-toast.warning .nc-toast-icon { color: #d97706; }
.nc-toast.info    { border-left-color: #2563eb; }  .nc-toast.info .nc-toast-icon { color: #2563eb; }
@keyframes nc-toast-in { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes nc-toast-out { to { transform: translateX(40px); opacity: 0; } }

/* Pretty modal-based confirm/alert (used by ncConfirm/ncAlert in app.js) */
.modal {
  z-index: 1085;
}
.modal-backdrop {
  z-index: 1080;
}
.modal-content,
.modal-dialog {
  opacity: 1;
  filter: none;
}
#nc-dialog-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: none; align-items: center; justify-content: center;
  z-index: 1070; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: nc-fade-in .15s ease both;
}
#nc-dialog-backdrop.show { display: flex; }
.nc-dialog {
  background: #fff; border-radius: 14px; max-width: 420px; width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(15,23,42,.25);
  overflow: hidden;
  animation: nc-dialog-in .2s cubic-bezier(.34,1.56,.64,1) both;
}
.nc-dialog .nc-dlg-body { padding: 22px 22px 14px; }
.nc-dialog .nc-dlg-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  background: #fef3c7; color: #b45309; font-size: 22px;
}
.nc-dialog.danger  .nc-dlg-icon { background: #fee2e2; color: #b91c1c; }
.nc-dialog.success .nc-dlg-icon { background: #dcfce7; color: #15803d; }
.nc-dialog.info    .nc-dlg-icon { background: #dbeafe; color: #1d4ed8; }
.nc-dialog .nc-dlg-title { font-weight: 700; color: #111827; margin: 0 0 6px; font-size: 1.02rem; }
.nc-dialog .nc-dlg-msg   { color: #4b5563; font-size: .88rem; margin: 0; line-height: 1.45; }
.nc-dialog .nc-dlg-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px 16px; background: #f9fafb;
}
.nc-dialog .nc-dlg-actions .btn { min-width: 90px; }
@keyframes nc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nc-dialog-in { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Button loading state */
.btn.is-loading {
  position: relative; pointer-events: none; color: transparent !important;
}
.btn.is-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 1em; height: 1em; margin: -.5em 0 0 -.5em;
  border: 2px solid currentColor; border-radius: 50%;
  border-right-color: transparent; opacity: .7;
  animation: nc-spin .7s linear infinite;
  color: var(--bs-btn-color, #fff);
}

/* Shift audit timeline */
.shift-audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.shift-audit-entry {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}
.shift-audit-marker {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1d4ed8;
}
.shift-audit-marker.tone-success { background: #dcfce7; color: #15803d; }
.shift-audit-marker.tone-danger { background: #fee2e2; color: #b91c1c; }
.shift-audit-marker.tone-warning { background: #fef3c7; color: #b45309; }
.shift-audit-marker.tone-info { background: #dbeafe; color: #1d4ed8; }
.shift-audit-marker .material-symbols-outlined { font-size: 18px; }
.shift-audit-card {
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #e5e7eb);
  border-radius: 14px;
  padding: 14px 16px;
}
.shift-audit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.shift-audit-title {
  font-weight: 700;
  color: var(--bs-emphasis-color, #111827);
}
.shift-audit-message {
  margin-top: 4px;
  color: var(--bs-secondary-color, #4b5563);
  font-size: .88rem;
  line-height: 1.45;
}
.shift-audit-stamp {
  color: var(--bs-secondary-color, #6b7280);
  font-size: .78rem;
  white-space: nowrap;
}
.shift-audit-subhead {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.shift-audit-actor,
.shift-audit-source {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 600;
}
.shift-audit-actor {
  background: rgba(37,99,235,.12);
  color: #1d4ed8;
}
.shift-audit-source {
  background: rgba(100,116,139,.12);
  color: var(--bs-secondary-color, #475569);
  text-transform: capitalize;
}
.shift-audit-changes,
.shift-audit-meta {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shift-audit-change-row,
.shift-audit-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .82rem;
}
.shift-audit-change-label,
.shift-audit-meta-row span:first-child {
  color: var(--bs-secondary-color, #6b7280);
}
.shift-audit-change-values {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: right;
}
.shift-audit-change-values .material-symbols-outlined {
  font-size: 16px;
  color: var(--bs-secondary-color, #94a3b8);
}
.shift-audit-change-from {
  color: var(--bs-secondary-color, #6b7280);
  text-decoration: line-through;
}
.shift-audit-change-to,
.shift-audit-meta-row strong {
  color: var(--bs-emphasis-color, #111827);
  font-weight: 600;
}
@media (max-width: 767.98px) {
  .shift-audit-head,
  .shift-audit-change-row,
  .shift-audit-meta-row {
    flex-direction: column;
  }
  .shift-audit-stamp,
  .shift-audit-change-values {
    white-space: normal;
    text-align: left;
  }
}
.btn-primary.is-loading::after, .btn-success.is-loading::after,
.btn-danger.is-loading::after, .btn-info.is-loading::after { color: #fff; }
.btn-outline-primary.is-loading::after, .btn-outline-secondary.is-loading::after,
.btn-outline-danger.is-loading::after { color: var(--nc-primary, #2563eb); }

/* Skeleton loaders */
.nc-skeleton {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: nc-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: block; min-height: 12px;
}
.nc-skeleton.text { height: 12px; margin: 6px 0; }
.nc-skeleton.text.lg { height: 18px; }
.nc-skeleton.circle { border-radius: 50%; }
.nc-skeleton.row { height: 38px; margin-bottom: 6px; }
@keyframes nc-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Restrained semantic colours — use variables so we can dial intensity in one place */
:root {
  --nc-tone-success: #15803d;
  --nc-tone-success-bg: #f0fdf4;
  --nc-tone-danger:  #b91c1c;
  --nc-tone-danger-bg: #fef2f2;
  --nc-tone-warning: #b45309;
  --nc-tone-warning-bg: #fffbeb;
  --nc-tone-info:    #1d4ed8;
  --nc-tone-info-bg: #eff6ff;
}
/* Soften over-saturated text-* utilities used everywhere */
.text-success { color: var(--nc-tone-success) !important; }
.text-danger  { color: var(--nc-tone-danger)  !important; }
.dropdown-menu .nc-danger-action {
  opacity: 1 !important;
  color: var(--nc-tone-danger) !important;
}
.dropdown-menu .nc-danger-action:hover,
.dropdown-menu .nc-danger-action:focus {
  background: color-mix(in srgb, var(--nc-tone-danger) 10%, white);
  color: var(--nc-tone-danger) !important;
}
.dropdown-menu .nc-danger-action .material-symbols-outlined {
  opacity: 1 !important;
}
.text-warning { color: var(--nc-tone-warning) !important; }
.text-info    { color: var(--nc-tone-info)    !important; }

/* ── "Selected" tile/option state (#1, #2) ─────────────────────────────────
   Replaces ad-hoc bg-primary + bg-opacity-10 patterns that go neon when the
   user's brand colour isn't blue. Neutral fill + branded border + branded
   text — readable at any brand colour.                                     */
.nc-selected,
label.nc-selected {
  background: #f3f4f6 !important;
  border-color: var(--nc-primary) !important;
  color: var(--nc-primary) !important;
  box-shadow: inset 0 0 0 1px var(--nc-primary);
}
/* Soft tinted backgrounds for status contexts — never the brand colour.
   Use these instead of bg-primary/success/danger for large fills.         */
.nc-soft         { background: #f3f4f6; color: #374151; }
.nc-soft-success { background: var(--nc-tone-success-bg); color: var(--nc-tone-success); }
.nc-soft-danger  { background: var(--nc-tone-danger-bg);  color: var(--nc-tone-danger); }
.nc-soft-warning { background: var(--nc-tone-warning-bg); color: var(--nc-tone-warning); }
.nc-soft-info    { background: var(--nc-tone-info-bg);    color: var(--nc-tone-info); }

/* ── Tone down bg-primary used as a STATUS fill ────────────────────────────
   bg-primary is fine on buttons (deliberate brand action). It's a problem
   when paired with bg-opacity-10/25/50 as a "tinted highlight" because the
   brand colour competes with semantic info next to it. We replace those
   tinted-fill patterns with the neutral selected style.                    */
.bg-primary.bg-opacity-10,
.bg-primary.bg-opacity-25 {
  background-color: #f3f4f6 !important;
  color: var(--nc-primary) !important;
}

/* Shared custom pill system — keep custom pills close to Bootstrap badges */
:root {
  --nc-pill-pad-y: var(--bs-badge-padding-y, .35em);
  --nc-pill-pad-x: var(--bs-badge-padding-x, .65em);
  --nc-pill-font-size: var(--bs-badge-font-size, .75em);
  --nc-pill-font-weight: var(--bs-badge-font-weight, 700);
  --nc-pill-line-height: 1.2;
  --nc-pill-radius: var(--bs-border-radius, .375rem);
}

/* Custom pills only. Bootstrap .badge should render with Bootstrap defaults. */
.nc-pill,
.sched-holiday-pill,
.ops-directory-pill {
  display: inline-block;
  padding: var(--nc-pill-pad-y) var(--nc-pill-pad-x);
  border-radius: var(--nc-pill-radius);
  font-size: var(--nc-pill-font-size);
  font-weight: var(--nc-pill-font-weight);
  line-height: var(--nc-pill-line-height);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Status pill — use this where colour actually conveys meaning */
.nc-pill {
  background: #f3f4f6;
  color: #4b5563;
}
.nc-pill.success { background: var(--nc-tone-success-bg); color: var(--nc-tone-success); }
.nc-pill.danger  { background: var(--nc-tone-danger-bg);  color: var(--nc-tone-danger); }
.nc-pill.warning { background: var(--nc-tone-warning-bg); color: var(--nc-tone-warning); }
.nc-pill.info    { background: var(--nc-tone-info-bg);    color: var(--nc-tone-info); }

.ops-directory-pill {
  background: #f5f8fc;
  border-color: rgba(18, 38, 63, 0.08);
  color: #49576a;
  font-size: .76rem;
}

.ops-directory-pill strong {
  color: #12263f;
  font-weight: 700;
}

/* ── Mobile sidebar density (#6) ─────────────────────────────────────────
   On phones the 260px panel is a lot of vertical real estate. Tighten
   spacing and fonts so more menu items fit without scrolling.            */
@media (max-width: 991.98px) {
  #nc-sidebar { width: 280px; }
  .sb-header { min-height: 56px; padding: 10px 10px 8px 12px; }
  .sb-brand { padding: 8px 10px; border-radius: 12px; }
  .sb-app-name { font-size: .82rem; }
  .sb-tagline { font-size: .58rem; }
  .sb-section { padding: 12px 18px 4px; font-size: .56rem; }
  .sb-item { padding: 8px 10px 8px 12px; font-size: .82rem; gap: 8px; }
  button.sb-item { width: calc(100% - 14px); }
  .sb-item .material-symbols-outlined { font-size: 18px; }
  .sb-sub-item { padding: 6px 10px 6px 38px; font-size: .78rem; }
  .sb-sub-item .material-symbols-outlined { font-size: 13px; }
  .sb-footer { padding: 8px 10px; }
  .sb-avatar { width: 28px; height: 28px; font-size: .72rem; }
  .sb-uname { font-size: .78rem; }
  .sb-urole { font-size: .64rem; }
  .sb-version-row { font-size: .62rem; margin-bottom: 6px; }
}

/* Material Symbols defaults (app-wide) — original block continues below */
/* ── Material Symbols defaults (app-wide) ───────────────────────────────── */
/* Inherit colour, sit aligned with adjacent text, sensible default size.   */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 1.1em;
  display: inline-block;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: -0.18em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' var(--nc-icon-weight), 'GRAD' 0, 'opsz' 24;
}
/* Preserve FA size-modifier semantics on Material spans */
.material-symbols-outlined.fa-2x { font-size: 2em; }
.material-symbols-outlined.fa-3x { font-size: 3em; }
.material-symbols-outlined.fa-xs { font-size: .75em; }
.material-symbols-outlined.fa-sm { font-size: .875em; }
.material-symbols-outlined.fa-lg { font-size: 1.33em; }
/* Spinner support — Material has 'progress_activity' + we add the spin */
.material-symbols-outlined.fa-spin,
.material-symbols-outlined.spin { animation: nc-spin 1.2s linear infinite; display: inline-block; }
@keyframes nc-spin { to { transform: rotate(360deg); } }

/* ── Font Awesome compatibility layer ────────────────────────────────────
   Legacy FA markup remains in older templates. Where a Material Symbols
   equivalent exists, map the old class to thin outlined Material so the
   site reads as one icon system while older pages are still being cleaned. */
.fa,
.fas,
.far,
.fab,
.fal,
.fa-solid,
.fa-regular,
.fa-brands {
  vertical-align: -0.1em;
}

.fa::before,
.fas::before,
.far::before,
.fab::before,
.fal::before,
.fa-solid::before,
.fa-regular::before,
.fa-brands::before {
  font-family: var(--nc-fa-font) !important;
  content: var(--nc-fa-material);
  font-weight: normal !important;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' var(--nc-icon-weight), 'GRAD' 0, 'opsz' 24;
}

.fa-tachometer-alt,
.fa-gauge-high,
.fa-gauge { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'dashboard'; }
.fa-users,
.fa-user-group { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'group'; }
.fa-user { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'person'; }
.fa-user-tag,
.fa-passport { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'badge'; }
.fa-user-lock { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'lock_person'; }
.fa-user-shield { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'shield_person'; }
.fa-users-cog { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'manage_accounts'; }
.fa-calendar-alt,
.fa-calendar-day { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'calendar_month'; }
.fa-calendar-check { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'event_available'; }
.fa-file-medical,
.fa-notes-medical { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'note_stack'; }
.fa-file-alt,
.fa-file-lines,
.fa-file-word { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'description'; }
.fa-file-pdf { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'picture_as_pdf'; }
.fa-file-excel,
.fa-table { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'table_chart'; }
.fa-file-image { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'image'; }
.fa-file-plus { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'note_add'; }
.fa-file-search { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'find_in_page'; }
.fa-file-signature,
.fa-signature,
.fa-pen-nib { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'draw'; }
.fa-file-invoice-dollar { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'receipt_long'; }
.fa-file-zipper { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'folder_zip'; }
.fa-folder-open { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'folder_open'; }
.fa-envelope { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'mail'; }
.fa-envelope-open,
.fa-comment-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'drafts'; }
.fa-comments { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'forum'; }
.fa-paper-plane { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'send'; }
.fa-paperclip { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'attach_file'; }
.fa-location-dot { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'place'; }
.fa-search,
.fa-magnifying-glass { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'search'; }
.fa-eye { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'visibility'; }
.fa-eye-slash { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'visibility_off'; }
.fa-check,
.fa-check-circle,
.fa-circle-check { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'check_circle'; }
.fa-times,
.fa-times-circle { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'cancel'; }
.fa-circle { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'radio_button_unchecked'; }
.fa-circle-exclamation,
.fa-exclamation-circle { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'error'; }
.fa-exclamation-triangle,
.fa-triangle-exclamation { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'warning'; }
.fa-flag { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'flag'; }
.fa-copy,
.fa-clone { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'content_copy'; }
.fa-trash,
.fa-trash-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'delete'; }
.fa-reply { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'reply'; }
.fa-save { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'save'; }
.fa-arrow-left { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'arrow_back'; }
.fa-right-to-bracket,
.fa-arrow-right-to-bracket,
.fa-sign-in-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'login'; }
.fa-arrow-right-from-bracket,
.fa-arrow-right-from-bracket,
.fa-sign-out-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'logout'; }
.fa-up-right-from-square,
.fa-arrow-up-right-from-square { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'open_in_new'; }
.fa-exchange-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'swap_horiz'; }
.fa-wallet { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'account_balance_wallet'; }
.fa-piggy-bank { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'savings'; }
.fa-university { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'account_balance'; }
.fa-bullseye { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'track_changes'; }
.fa-sitemap,
.fa-code-branch { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'account_tree'; }
.fa-list-check { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'checklist'; }
.fa-hard-hat,
.fa-tools { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'build'; }
.fa-lightbulb { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'lightbulb'; }
.fa-first-aid { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'medical_services'; }
.fa-shield-check { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'verified_user'; }
.fa-shield-halved,
.fa-shield-heart { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'shield'; }
.fa-stethoscope { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'stethoscope'; }
.fa-allergies { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'allergy'; }
.fa-pills { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'medication'; }
.fa-globe { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'public'; }
.fa-brain { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'psychology'; }
.fa-arrows-rotate { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'sync'; }
.fa-plug { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'power'; }
.fa-wifi-slash { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'wifi_off'; }
.fa-clock { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'schedule'; }
.fa-car { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'directions_car'; }
.fa-bed { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'bed'; }
.fa-handshake { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'handshake'; }
.fa-ban { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'block'; }
.fa-certificate { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'workspace_premium'; }
.fa-archive { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'archive'; }
.fa-arrow-right { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'arrow_forward'; }
.fa-award,
.fa-medal { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'military_tech'; }
.fa-bell { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'notifications'; }
.fa-birthday-cake,
.fa-cake-candles { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'cake'; }
.fa-bold { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_bold'; }
.fa-book,
.fa-newspaper { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'library_books'; }
.fa-box-open { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'inventory_2'; }
.fa-building,
.fa-home-user { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'apartment'; }
.fa-bullhorn { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'campaign'; }
.fa-calendar { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'event'; }
.fa-chart-line { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'show_chart'; }
.fa-check-square { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'check_box'; }
.fa-circle-play { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'play_circle'; }
.fa-circle-xmark { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'cancel'; }
.fa-cloud-upload-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'cloud_upload'; }
.fa-columns { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'view_column'; }
.fa-desktop { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'desktop_windows'; }
.fa-download { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'download'; }
.fa-edit,
.fa-pen,
.fa-pen-fancy,
.fa-pencil,
.fa-feather { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'edit'; }
.fa-eraser { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'ink_eraser'; }
.fa-file { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'description'; }
.fa-file-circle-plus { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'note_add'; }
.fa-file-exclamation { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'error'; }
.fa-file-export { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'file_export'; }
.fa-file-invoice { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'receipt_long'; }
.fa-file-powerpoint { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'slideshow'; }
.fa-filter { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'filter_list'; }
.fa-fingerprint { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'fingerprint'; }
.fa-folder { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'folder'; }
.fa-folder-tree { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'account_tree'; }
.fa-font { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_size'; }
.fa-forward { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'forward'; }
.fa-graduation-cap { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'school'; }
.fa-hand-pointer { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'touch_app'; }
.fa-hand-sparkles { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'back_hand'; }
.fa-hourglass-half { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'hourglass_top'; }
.fa-id-badge,
.fa-id-card { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'badge'; }
.fa-inbox { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'inbox'; }
.fa-indent { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_indent_increase'; }
.fa-info-circle { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'info'; }
.fa-italic { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_italic'; }
.fa-keyboard { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'keyboard'; }
.fa-landmark { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'account_balance'; }
.fa-laptop { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'laptop'; }
.fa-lock { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'lock'; }
.fa-map-marker-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'place'; }
.fa-minus { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'remove'; }
.fa-minus-circle { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'remove_circle'; }
.fa-mobile-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'smartphone'; }
.fa-money-check-dollar { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'payments'; }
.fa-moon { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'dark_mode'; }
.fa-outdent { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_indent_decrease'; }
.fa-paint-brush { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'brush'; }
.fa-palette { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'palette'; }
.fa-plus { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'add'; }
.fa-qrcode { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'qr_code_2'; }
.fa-quote-right { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_quote'; }
.fa-reply-all { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'reply_all'; }
.fa-rotate,
.fa-rotate-right { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'refresh'; }
.fa-route { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'route'; }
.fa-ruler-combined { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'straighten'; }
.fa-shield { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'shield'; }
.fa-spinner { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'progress_activity'; }
.fa-star { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'star'; }
.fa-sticky-note { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'sticky_note_2'; }
.fa-stopwatch { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'timer'; }
.fa-strikethrough { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_strikethrough'; }
.fa-sun { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'light_mode'; }
.fa-tablet-alt { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'tablet'; }
.fa-tasks { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'checklist'; }
.fa-th-large { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'grid_view'; }
.fa-truck { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'local_shipping'; }
.fa-trash-can { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'delete'; }
.fa-underline { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_underlined'; }
.fa-user-clock { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'schedule'; }
.fa-user-slash { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'person_off'; }
.fa-user-tie { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'person'; }
.fa-wave-square { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'monitor_heart'; }
.fa-wheelchair { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'accessible'; }
.fa-align-left { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_align_left'; }
.fa-align-center { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_align_center'; }
.fa-align-right { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_align_right'; }
.fa-align-justify { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'format_align_justify'; }
.fa-arrow-up-right-dots { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'trending_up'; }
.fa-facebook,
.fa-instagram,
.fa-linkedin,
.fa-x-twitter { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'public'; }
.fa-youtube { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'smart_display'; }
.fa-microsoft { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'apps'; }
.fa-material { --nc-fa-font: 'Material Symbols Outlined'; --nc-fa-material: 'category'; }

/* FA modifier classes — preserved so legacy markup keeps sizing/animation
   working after the Font Awesome stylesheet is removed. */
.fa-fw  { width: 1.25em; text-align: center; display: inline-block; }
.fa-xs  { font-size: .75em; }
.fa-sm  { font-size: .875em; }
.fa-lg  { font-size: 1.333em; vertical-align: -0.0667em; }
.fa-2x  { font-size: 2em; }
.fa-3x  { font-size: 3em; }
.fa-spin { animation: nc-spin 1.2s linear infinite; display: inline-block; }

/* Sub-nav links */
.sb-sub-item {
  display: flex; align-items: center;
  gap: 4px;
  padding: 6px 12px 6px 42px; margin: 0 12px 2px;
  color: var(--bs-secondary-color); font-size: .8rem; font-weight: 500;
  text-decoration: none; border-radius: var(--bs-border-radius);
  transition: background .12s, color .12s;
}
button.sb-sub-item {
  background: none;
  border: none;
  width: calc(100% - 20px);
  text-align: left;
  cursor: pointer;
}
.sb-sub-item:hover { background: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); }
.sb-sub-item.active { background: rgba(var(--bs-primary-rgb), .08); color: var(--nc-primary); font-weight: 600; }
.sb-sub-toggle {
  align-items: center;
  color: #475569;
  font-weight: 600;
}
.sb-sub-chevron {
  margin-left: auto;
  font-size: 16px !important;
  transition: transform .2s;
  opacity: .55;
}
.sb-sub-toggle.collapsed .sb-sub-chevron {
  transform: rotate(-90deg);
}
.sb-sub-nested {
  padding-left: 56px;
}

/* Disabled / future items */
.sb-future { opacity: .4; pointer-events: none; cursor: default; }
.sb-recent-releases { background: var(--bs-success-bg-subtle) !important; color: var(--bs-success-text-emphasis) !important; opacity: 1 !important; pointer-events: auto !important; }
.sb-recent-releases:hover { background: var(--bs-success-border-subtle) !important; }
.sb-badge-premium { font-size: .58rem; font-weight: 700; padding: 2px 6px; border-radius: var(--bs-border-radius, .375rem); background: var(--bs-secondary-bg); color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .04em; margin-left: auto; }
.sb-badge-new     { font-size: .58rem; font-weight: 700; padding: 2px 6px; border-radius: var(--bs-border-radius, .375rem); background: var(--nc-primary); color: #fff; text-transform: uppercase; letter-spacing: .04em; margin-left: auto; }

/* ── Sidebar footer ── */
.sb-footer { padding: 10px 12px 12px; flex-shrink: 0; border-top: 1px solid var(--bs-border-color); }
.sb-version-row { font-size: .67rem; color: var(--bs-secondary-color); display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.sb-user-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-radius: 0; background: transparent; border: 0; }
.sb-user-link { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; color: var(--bs-body-color); }
.sb-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--nc-primary); display: flex; align-items: center; justify-content: center; font-size: .74rem; color: #fff; font-weight: 700; flex-shrink: 0; }
.sb-uname { font-size: .8rem; color: var(--bs-emphasis-color); font-weight: 600; }
.sb-urole { font-size: .68rem; color: var(--bs-secondary-color); }
.sb-logout-btn { background: none; border: none; color: var(--bs-secondary-color); padding: 6px; border-radius: var(--bs-border-radius-sm); cursor: pointer; transition: color .12s, background .12s; }
.sb-logout-btn:hover { color: var(--bs-danger); background: var(--bs-danger-bg-subtle); }

/* ── Layout ───────────────────────────────────────────────────────────── */
#nc-wrapper { display: flex; min-height: 100vh; align-items: stretch; }
#nc-main    { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* Fluid content area — fills the available space next to the sidebar.
   Bootstrap-aligned 1.5rem padding so cards aren't pinned to the viewport
   edge. No max-width cap: pages constrain their own content via internal
   row/col grids, so the cap was just creating asymmetric gutters when the
   main sidebar collapsed on wide screens. */
#nc-content {
  padding: 1.5rem;
  flex: 1;
  width: 100%;
}

@media (max-width: 991.98px) { #nc-content { padding: 14px 12px; } }
@media (max-width: 575.98px) { #nc-content { padding: 12px 10px; } }

/* Reusable left-sidebar column for pages that have too many sections to fit
   in a horizontal nav (settings, participant view, staff view). 240px lands
   between Bootstrap's col-xl-1 (~150px) and col-xl-2 (~290px) — wide enough
   for an icon + label, narrow enough not to dwarf content. Below xl the
   column collapses (handled by the offcanvas-xl pattern in the markup).
   The offcanvas-body is sticky at xl+ so the sidebar stays anchored while
   long tab content scrolls; if the sidebar itself exceeds the viewport,
   it scrolls internally. */
@media (min-width: 1200px) {
  .fixed-sidenav-col {
    flex: 0 0 240px;
    max-width: 240px;
    align-self: flex-start;
    position: sticky;
    top: calc(var(--nc-topbar-h, 56px) + 1rem);
  }
  .fixed-sidenav-col > .offcanvas-body {
    max-height: calc(100vh - var(--nc-topbar-h, 56px) - 2rem);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}
@supports (height: 100dvh) {
  @media (min-width: 1200px) {
    .fixed-sidenav-col > .offcanvas-body {
      max-height: calc(100dvh - var(--nc-topbar-h, 56px) - 2rem);
    }
  }
}
/* Active tab in a vertical sidebar built from data-bs-toggle="tab" links —
   restores full link colour + bold weight without the filled active background
   that nav-pills normally apply. Pair with link-body-emphasis +
   link-opacity-50 link-opacity-100-hover on the trigger element. */
.fixed-sidenav-col [data-bs-toggle="tab"].active,
.fixed-sidenav-col [data-bs-toggle="pill"].active {
  --bs-link-opacity: 1;
  font-weight: 600;
}
/* Kill the hover/focus underline that link-* utilities reapply — opacity
   change is the only hover affordance we want in the sidebar. */
.fixed-sidenav-col a,
.fixed-sidenav-col a:hover,
.fixed-sidenav-col a:focus,
.fixed-sidenav-col button,
.fixed-sidenav-col button:hover,
.fixed-sidenav-col button:focus {
  text-decoration: none;
}
.fixed-sidenav-col [data-bs-toggle="tab"],
.fixed-sidenav-col [data-bs-toggle="pill"],
.fixed-sidenav-col .workspace-sidebar-action-link {
  font-size: var(--nc-font-size-sm);
  line-height: 1.3;
  padding-top: .125rem !important;
  padding-bottom: .125rem !important;
}
.fixed-sidenav-col .workspace-sidebar-action-link {
  width: 100%;
  justify-content: flex-start;
}
.fixed-sidenav-col .workspace-sidebar-nav {
  gap: .5rem;
}
.fixed-sidenav-col .workspace-sidebar-actions {
  gap: .25rem;
}
.fixed-sidenav-col .workspace-sidebar-divider {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
}
.fixed-sidenav-col .workspace-sidebar-avatar {
  width: 48px;
  height: 48px;
}
.fixed-sidenav-col .participant-avatar.workspace-sidebar-avatar {
  font-size: .95rem;
}
.fixed-sidenav-col .workspace-sidebar-name {
  font-size: var(--nc-font-size-body);
  line-height: 1.15;
}
.fixed-sidenav-col .workspace-sidebar-meta {
  font-size: var(--nc-font-size-xs);
  line-height: 1.15;
}
.profile-avatar-stack,
.profile-avatar-photo-form {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar-action {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.photo-camera-stage {
  width: 100%;
  min-height: 320px;
  border-radius: 1rem;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.photo-camera-stage video,
.photo-camera-stage canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Top bar ──────────────────────────────────────────────────────────── */
#nc-topbar {
  height: var(--nc-topbar-h); background: #fff;
  border-bottom: 1px solid var(--bs-border-color);
  display: flex; align-items: center; padding: 0 16px; gap: 10px;
  position: sticky; top: 0; z-index: 1020;
}
#nc-topbar .topbar-copy       { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#nc-topbar .topbar-title      { font-weight: 600; font-size: .95rem; color: var(--bs-emphasis-color); line-height: 1.2; }
#nc-topbar .topbar-subtitle   {
  font-size: .72rem;
  color: var(--bs-secondary-color);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 767.98px) { #nc-topbar .topbar-subtitle { display: none; } }
#nc-topbar .topbar-breadcrumb { font-size: .75rem; color: var(--bs-secondary-color); }
#nc-topbar .topbar-actions    { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nc-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 640px;
  margin-left: auto;
  margin-right: 12px;
}
.nc-header-search .form-select,
.nc-header-search .form-control,
.nc-header-search .btn {
  min-height: 34px;
}
.nc-header-search .form-select {
  width: 144px;
  min-width: 130px;
  flex: 0 0 auto;
}
.nc-header-search .form-control {
  min-width: 240px;
  flex: 1 1 auto;
}
.nc-header-search .btn {
  padding-inline: .7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  line-height: 1;
}
#nc-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#nc-sidebar-toggle .material-symbols-outlined,
.nc-header-search .btn .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  vertical-align: 0;
}
#nc-topbar.topbar-compact {
  height: 52px;
  padding: 0 14px;
  gap: 10px;
}
#nc-topbar.topbar-compact .topbar-actions {
  width: 100%;
}
@media (max-width: 991.98px) {
  #nc-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    height: auto;
    min-height: var(--nc-topbar-h);
    padding-top: 12px;
    padding-bottom: 12px;
  }
  #nc-topbar .topbar-copy {
    flex: 1 1 calc(100% - 52px);
  }
  .nc-header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
  }
}
@media (max-width: 575.98px) {
  .nc-header-search .form-select {
    width: 120px;
    min-width: 110px;
  }
  .nc-header-search .form-control {
    min-width: 0;
  }
}

/* ── Card  (thin wrapper — Bootstrap .card does the rest) ─────────────── */
.nc-card {
  background: var(--bs-body-bg);
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  color: var(--bs-body-color);
}

.btn > .material-symbols-outlined:first-child,
.btn > i:first-child,
.btn > .fas:first-child,
.btn > .far:first-child,
.btn > .fab:first-child {
  margin-right: 0;
}

.btn > .material-symbols-outlined:first-child:last-child,
.btn > i:first-child:last-child,
.btn > .fas:first-child:last-child,
.btn > .far:first-child:last-child,
.btn > .fab:first-child:last-child {
  margin-right: 0;
}

/* ── Safeguards workspace ────────────────────────────────────────────── */
.safeguards-nav-card {
  position: sticky;
  top: 76px;
}

.safeguards-nav-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.safeguards-nav-btn {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: .8rem;
  background: #fff;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem .95rem;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, transform .15s ease;
}

.safeguards-nav-btn:hover {
  border-color: rgba(37, 99, 235, .28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}

.safeguards-nav-btn.active {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .08);
}

.safeguards-nav-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #2563eb;
  flex-shrink: 0;
}

.safeguards-nav-copy {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.safeguards-nav-label {
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.2;
}

.safeguards-nav-meta {
  color: #64748b;
  font-size: .74rem;
  line-height: 1.2;
}

.safeguards-panel {
  display: none;
}

.safeguards-panel.active {
  display: block;
}

.participant-services-table td,
.participant-services-table th {
  vertical-align: top;
}

.participant-services-table tbody tr + tr td {
  border-top-width: 1px;
}

.participant-service-rule-table-wrap {
  overflow: visible;
}

.svc-item-search-wrap {
  position: relative;
}

.svc-item-search-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 1065;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: .7rem;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
  padding: .3rem;
}

.svc-item-search-results-portal {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  z-index: 2000;
}

.svc-item-search-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .55rem .65rem;
  border-radius: .55rem;
  color: #0f172a;
}

.svc-item-search-option:hover,
.svc-item-search-option:focus {
  background: #f8fafc;
}

.svc-item-search-option-title {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.25;
}

.svc-item-search-option-meta,
.svc-item-search-empty {
  font-size: .74rem;
  color: #64748b;
  line-height: 1.3;
}

.svc-item-search-empty {
  padding: .55rem .65rem;
}

/* ── Participant avatar ───────────────────────────────────────────────── */
.participant-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--nc-primary, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: #fff; font-weight: 700; flex-shrink: 0;
}

/* ── Linkable stat tile / clickable badge ─────────────────────────────────
   Wrap any .nc-card stat tile (or a badge) in <a class="stat-tile-link">
   to turn it into a drilldown link to the filtered list page. Subtle lift
   on hover hints it's clickable without changing the resting appearance. */
.stat-tile-link { display:block; text-decoration:none; color:inherit; }
.stat-tile-link .nc-card,
.stat-tile-link .stat-tile { transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.stat-tile-link:hover .nc-card,
.stat-tile-link:hover .stat-tile { border-color: var(--bs-primary); box-shadow: 0 2px 6px rgba(0,0,0,.06); transform: translateY(-1px); }
.stat-tile-link:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; border-radius: .35rem; }
/* Inline badge-as-link: keeps badge colours, adds hover underline + cursor */
a.badge-link, .badge-link a { text-decoration: none; color: inherit; }
a.badge-link:hover, .badge-link a:hover { filter: brightness(0.92); }
.participant-avatar.lg { width: 72px; height: 72px; font-size: 1.4rem; }

.participant-timeline-card {
  padding: 1rem;
  border: 1px solid var(--bs-border-color, #dbe3ef);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.participant-timeline-card:hover {
  border-color: rgba(var(--bs-primary-rgb), .35);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.participant-timeline-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.participant-timeline-title {
  line-height: 1.3;
}

.participant-timeline-date {
  font-size: .72rem;
}

.participant-timeline-meta {
  margin-top: .35rem;
  font-size: .74rem;
  color: #64748b;
  line-height: 1.35;
}

.nc-profile-header-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nc-profile-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 360px;
  min-width: 0;
}

.nc-profile-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.nc-profile-avatar-image,
.nc-profile-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nc-profile-avatar-circle {
  background: var(--nc-primary, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
}

@media (max-width: 767.98px) {
  .nc-profile-header-main {
    align-items: stretch;
  }
  .nc-profile-identity {
    align-items: flex-start;
  }
}

/* ── Form section heading ─────────────────────────────────────────────── */
.form-section-heading {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0; color: var(--bs-secondary-color, #6c757d);
  padding-bottom: .5rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

/* ── Signature pad ────────────────────────────────────────────────────── */
.sig-container {
  border: 2px dashed #cbd5e1; border-radius: 8px;
  background: #fafafa; position: relative; height: 180px; cursor: crosshair;
}
.sig-container canvas { width: 100%; height: 100%; border-radius: 6px; }
.sig-placeholder {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: .8rem; flex-direction: column; gap: 6px;
}

/* ── NDIS item lookup dropdown ───────────────────────────────────────── */
.ndis-lookup-dropdown {
  position: absolute; top: 100%; left: 0; z-index: 1055;
  min-width: 320px; max-width: 480px; max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 6px;
  padding: 4px 0; margin-top: 2px;
}
.ndis-lookup-dropdown li {
  padding: 6px 12px; font-size: .8rem; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ndis-lookup-dropdown li:hover { background: #f1f5f9; }

/* ── Care notes ───────────────────────────────────────────────────────── */
.note-card-incident { border-left: 4px solid #ef4444 !important; }
.note-content-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Login page ───────────────────────────────────────────────────────── */
.login-page  { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.login-card  {
  width: 420px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  margin: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 25px 50px rgba(0,0,0,.35);
  padding: 40px;
}
.login-logo  {
  width: auto; height: auto;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--nc-primary);
  font-size: 3.55rem;
  line-height: 1;
  margin: 0 auto 12px;
}
.login-logo .nc-app-icon { font-size: 3.55rem; }
.nc-auth-app-icon {
  width: auto; height: auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--nc-primary);
  line-height: 1;
}
.nc-auth-app-icon .nc-app-icon { font-size: 3.2rem; }
.nc-onboarding-app-icon {
  width: auto; height: auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--nc-primary);
  line-height: 1;
}
.nc-onboarding-app-icon .nc-app-icon { font-size: 3.45rem; }

/* ── Collapsible nav groups: see .sb-item / .sb-sub-item above ────── */

/* ── Sidebar colour overrides (set via settings) ─────────────────────── */

/* ── Invoice line items: ensure qty/price inputs are usable on iOS ────── */
#lines-table th.col-qty,
#lines-table td.col-qty  { width: 90px; min-width: 80px; }
/* Prevent iOS from shrinking number inputs below 16px (stops auto-zoom)  */
#lines-table input[type="number"] {
  font-size: 1rem !important;
  min-width: 70px;
}
@media (max-width: 767.98px) {
  #lines-table input[type="number"],
  #lines-table input[type="text"],
  #lines-table input[type="date"],
  #lines-table select {
    font-size: 1rem !important;
    min-width: 60px;
  }
}

@media (max-width: 991.98px) {
  #nc-content { padding: 18px; }
  #nc-topbar {
    height: auto;
    min-height: var(--nc-topbar-h);
    padding: 10px 16px;
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 10px;
  }
  #nc-topbar.topbar-compact {
    height: auto;
    min-height: 48px;
    padding: 8px 12px;
  }
  #nc-topbar .topbar-copy {
    min-width: 0;
    flex: 1 1 auto;
  }
  #nc-topbar .topbar-breadcrumb {
    display: none;
  }
  .nc-header-search {
    order: 3;
    flex: 1 0 100%;
    flex-basis: 100%;
    max-width: none;
    margin: 0;
  }
  .nc-header-search .form-control { min-width: 0; }
  .nc-header-search .form-select { width: 128px; min-width: 110px; }
  #nc-topbar .topbar-actions {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
  #nc-topbar .topbar-actions form { min-width: 0; }
  #nc-topbar .topbar-actions .form-select {
    max-width: 240px;
  }
}

@media (max-width: 575.98px) {
  #nc-content { padding: 14px; }
  #nc-topbar { height: 56px; }
  #nc-topbar,
  #nc-topbar.topbar-compact {
    height: auto;
    padding: 8px 12px;
    gap: 8px;
  }
  #nc-topbar .topbar-title { font-size: .9rem; }
  #nc-topbar .topbar-copy { flex: 1 0 100%; }
  .nc-header-search { flex: 1 1 auto; min-width: 0; }
  .nc-header-search .form-select { display: none; }
  .nc-header-search .form-control { min-width: 0; }
  #nc-topbar .topbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  #nc-topbar .topbar-actions form {
    flex: 1 1 auto;
  }
  #nc-topbar .topbar-actions .form-select {
    width: 100%;
    max-width: none;
  }
  .nav-tabs,
  .nav-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar,
  .nav-pills::-webkit-scrollbar {
    display: none;
  }
  .nav-tabs .nav-item,
  .nav-pills .nav-item {
    flex: 0 0 auto;
  }
}

/* ── Utilities not yet in Bootstrap 5.3 ──────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-ndis { color: var(--nc-ndis) !important; }
.bg-ndis   { background-color: var(--nc-ndis) !important; }

/* Min-width 0 — lets flex children shrink past their intrinsic content size */
.min-w-0 { min-width: 0 !important; }

/* ── App-wide design primitives ────────────────────────────────────────
   Shared building blocks so every page renders the same shape regardless
   of who wrote the markup. Compose these via class names, not inline styles. */

/* KPI / stat tile — small surface for a label + value (dashboards, summary rows) */
.stat-tile {
  background: var(--bs-tertiary-bg);
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: .5rem .75rem;
  height: 100%;
}
.stat-tile-label {
  font-size: var(--nc-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bs-secondary-color);
  margin-bottom: .15rem;
  line-height: 1.2;
}
.stat-tile-value {
  font-weight: 600;
  color: var(--bs-emphasis-color);
  line-height: 1.25;
}

/* Card section header — transparent surface, two-row aligned actions on right.
   Inherits default .card-header padding from Bootstrap; only changes layout + bg. */
.card-header-flush {
  background-color: transparent;
  border-bottom-color: var(--bs-border-color-translucent);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.card-header-flush > :first-child { min-width: 0; }

/* Empty-state container — replaces the inline icon+headline+hint pattern */
.empty-state {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--bs-secondary-color);
}
.empty-state-icon {
  font-size: 2rem !important;
  display: block;
  margin: 0 auto .35rem;
  color: var(--bs-secondary-color);
  opacity: .7;
}
.empty-state-icon.text-success,
.empty-state-icon.text-danger,
.empty-state-icon.text-warning,
.empty-state-icon.text-primary { opacity: 1; }
.empty-state-title {
  font-weight: 600;
  color: var(--bs-emphasis-color);
}
.empty-state-hint {
  font-size: var(--nc-font-size-sm);
  margin-top: .15rem;
}

/* Avatar circles — initials or photo, consistent sizes */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--nc-primary);
  color: #fff;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
}
.avatar-xs { width: 1.5rem;  height: 1.5rem;  font-size: .65rem; }
.avatar-sm { width: 2.25rem; height: 2.25rem; font-size: .8rem; }
.avatar-md { width: 2.75rem; height: 2.75rem; font-size: .9rem; }
.avatar-lg { width: 3.5rem;  height: 3.5rem;  font-size: 1rem; }

/* Material Symbols size helpers — fs-* targets text only, this targets icons */
.icon-md { font-size: 1.25rem !important; }
.icon-lg { font-size: 1.5rem  !important; }
.icon-xl { font-size: 2rem    !important; }
.icon-2x { font-size: 2.5rem  !important; }

/* App-wide card treatment — borderless, with a subtle shadow for elevation.
   Cards rely on shadow + body tint for visual separation, no border line. */
.card {
  border: 0;
  box-shadow: var(--bs-box-shadow-sm);
}
[data-bs-theme="dark"] .card { box-shadow: 0 .125rem .35rem rgba(0,0,0,.45); }

/* Sticky in-body action rows — for modals that put their action buttons
   inside `.modal-body` rather than a proper `.modal-footer`. */
.modal-body .nc-modal-sticky-footer {
  position: sticky;
  bottom: calc(-1 * var(--bs-modal-padding, 1rem));
  margin-inline: calc(-1 * var(--bs-modal-padding, 1rem));
  margin-bottom: calc(-1 * var(--bs-modal-padding, 1rem));
  padding-inline: var(--bs-modal-padding, 1rem);
  padding-block: .65rem;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  z-index: 5;
}

/* Page header — title + optional subtitle/breadcrumb/actions row.
   Render via the page_header() PHP helper. Sits at the top of #nc-content. */
.page-header {
  display: block;
  margin-bottom: 1rem;
}
.page-header-breadcrumb {
  margin-bottom: .35rem;
}
.page-header-breadcrumb .breadcrumb {
  font-size: var(--nc-font-size-xs);
  margin-bottom: 0;
}
.page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.page-header-title {
  font-weight: 600;
  margin-bottom: .15rem;
  color: var(--bs-emphasis-color);
}
.page-header-subtitle {
  font-size: var(--nc-font-size-sm);
  color: var(--bs-secondary-color);
  margin-bottom: 0;
  max-width: 70ch;
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  flex-shrink: 0;
}

/* ── Dark mode transition ─────────────────────────────────────────────── */
/* Smooth colour crossfade when toggling theme — but NOT on initial page load
   (the early <script> sets the attribute before CSS parses, so there's no
   transition object yet anyway). */
body, #nc-sidebar, #nc-topbar, .nc-card, .sb-header, .sb-footer, .sb-item,
.sb-sub-item, .sb-section, .sb-app-name, .sb-tagline {
  transition: background-color .25s ease, border-color .25s ease, color .2s ease;
}
.nc-theme-toggle { transition: color .12s, background .12s, transform .18s ease; }

/* ── Dark mode ────────────────────────────────────────────────────────── */
/* Bootstrap 5.3 handles its own components via data-bs-theme="dark".
   This block covers our custom elements only.                           */

/* Body bg is set on the base rule and picks up the dark token automatically;
   no override needed here. */

[data-bs-theme="dark"] #nc-topbar {
  background: var(--bs-tertiary-bg);
  border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] #nc-topbar .topbar-title      { color: #f1f5f9; }
[data-bs-theme="dark"] #nc-topbar .topbar-breadcrumb { color: var(--bs-secondary-color); }

[data-bs-theme="dark"] #nc-sidebar {
  background: var(--bs-body-bg) !important;
  border-right-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .sb-brand {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
[data-bs-theme="dark"] .sb-app-name { color: var(--bs-emphasis-color); }
[data-bs-theme="dark"] .sb-tagline  { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .sb-close    { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .sb-close { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
[data-bs-theme="dark"] .sb-close:hover { background: rgba(255,255,255,.07); color: #f1f5f9; }
[data-bs-theme="dark"] .sb-section  { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .sb-item     { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .sb-icon { background: transparent; color: currentColor; }
[data-bs-theme="dark"] .sb-item:hover { background: rgba(255,255,255,.05); color: var(--bs-emphasis-color); }
[data-bs-theme="dark"] .sb-item:hover .sb-icon { opacity: 1; }
[data-bs-theme="dark"] .sb-item.active { background: rgba(var(--bs-primary-rgb), .18); color: #9ec5fe; font-weight:600; }
[data-bs-theme="dark"] .sb-sub-item  { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .sb-sub-item:hover { background: rgba(255,255,255,.05); color: var(--bs-emphasis-color); }
[data-bs-theme="dark"] .sb-sub-item.active { background: rgba(59,130,246,.2); color: #93c5fd; font-weight:600; }
[data-bs-theme="dark"] .sb-version-row { color: #868e96; }
[data-bs-theme="dark"] .sb-user-row { background: transparent; border-color: transparent; }
[data-bs-theme="dark"] .sb-uname    { color: var(--bs-emphasis-color); }
[data-bs-theme="dark"] .sb-urole    { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .sb-logout-btn { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .sb-logout-btn:hover { color: #f87171; background: rgba(239,68,68,.12); }
[data-bs-theme="dark"] .sb-nav { scrollbar-color: var(--bs-border-color) transparent; }

[data-bs-theme="dark"] .nc-card {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
[data-bs-theme="dark"] .login-card {
  background: var(--bs-tertiary-bg);
  box-shadow: 0 25px 50px rgba(0,0,0,.7);
}
[data-bs-theme="dark"] #nc-backdrop {
  background: rgba(2,6,23,.65);
}

/* Dark mode toggle button */
.nc-theme-toggle {
  background: none; border: none;
  color: #9ca3af; padding: 4px 7px;
  border-radius: 6px; cursor: pointer; font-size: .82rem;
  transition: color .12s, background .12s; flex-shrink: 0;
}
.nc-theme-toggle:hover { color: #111827; background: #f3f4f6; }
[data-bs-theme="dark"] .nc-theme-toggle { color: #64748b; }
[data-bs-theme="dark"] .nc-theme-toggle:hover { color: #f1f5f9; background: rgba(255,255,255,.07); }

/* ── Dark mode — Bootstrap utility overrides ─────────────────────────────
   Bootstrap 5.3 sets data-bs-theme="dark" on <html> which handles its own
   components (.table, .form-control, .card, .modal, .dropdown etc.)
   automatically. The rules below cover our custom elements and Bootstrap
   utility classes used with hardcoded light values.                      */

/* bg-white / bg-light frequently used in content pages */
[data-bs-theme="dark"] .bg-white  { background-color: var(--bs-tertiary-bg) !important; }
[data-bs-theme="dark"] .bg-light  { background-color: var(--bs-secondary-bg) !important; }
[data-bs-theme="dark"] .bg-body-tertiary,
[data-bs-theme="dark"] .bg-secondary-subtle,
[data-bs-theme="dark"] .bg-light-subtle { background-color: var(--bs-secondary-bg) !important; }

[data-bs-theme="dark"] {
  --bs-body-bg: #212529;
  --bs-body-color: #dee2e6;
  --bs-emphasis-color: #f8f9fa;
  --bs-secondary-color: #adb5bd;
  --bs-tertiary-bg: #2b3035;
  --bs-secondary-bg: #343a40;
  --bs-border-color: #495057;
  --bs-border-color-translucent: rgba(255,255,255,.125);
  --bs-link-color: #6ea8fe;
  --bs-link-color-rgb: 110,168,254;
  --bs-link-hover-color: #9ec5fe;
  --bs-link-hover-color-rgb: 158,197,254;
  --bs-nav-link-color: #ced4da;
  --bs-nav-link-hover-color: #f8f9fa;
}
[data-bs-theme="dark"] #nc-content a:not(.btn):not(.btn-link):not(.nav-link):not(.dropdown-item):not(.list-group-item-action):not(.page-link):not(.badge) {
  color: inherit !important;
}
[data-bs-theme="dark"] #nc-content a:not(.btn):not(.btn-link):not(.nav-link):not(.dropdown-item):not(.list-group-item-action):not(.page-link):not(.badge):hover,
[data-bs-theme="dark"] #nc-content a:not(.btn):not(.btn-link):not(.nav-link):not(.dropdown-item):not(.list-group-item-action):not(.page-link):not(.badge):focus {
  color: var(--bs-emphasis-color) !important;
}
[data-bs-theme="dark"] #nc-sidebar a,
[data-bs-theme="dark"] #nc-sidebar a:hover,
[data-bs-theme="dark"] #nc-sidebar a:focus {
  color: inherit !important;
}
[data-bs-theme="dark"] .nav-link,
[data-bs-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .list-group-item-action,
[data-bs-theme="dark"] .fixed-sidenav-col [data-bs-toggle="tab"],
[data-bs-theme="dark"] .fixed-sidenav-col [data-bs-toggle="pill"],
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link {
  color: var(--bs-nav-link-color) !important;
}
[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link:focus,
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .list-group-item-action:hover,
[data-bs-theme="dark"] .list-group-item-action:focus,
[data-bs-theme="dark"] .fixed-sidenav-col [data-bs-toggle="tab"]:hover,
[data-bs-theme="dark"] .fixed-sidenav-col [data-bs-toggle="pill"]:hover,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link:hover,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link:focus {
  color: var(--bs-nav-link-hover-color) !important;
}
[data-bs-theme="dark"] .nav-link .material-symbols-outlined,
[data-bs-theme="dark"] .nav-link i,
[data-bs-theme="dark"] .nav-link svg,
[data-bs-theme="dark"] .dropdown-item .material-symbols-outlined,
[data-bs-theme="dark"] .dropdown-item i,
[data-bs-theme="dark"] .dropdown-item svg,
[data-bs-theme="dark"] .list-group-item-action .material-symbols-outlined,
[data-bs-theme="dark"] .list-group-item-action i,
[data-bs-theme="dark"] .list-group-item-action svg,
[data-bs-theme="dark"] .fixed-sidenav-col [data-bs-toggle="tab"] .material-symbols-outlined,
[data-bs-theme="dark"] .fixed-sidenav-col [data-bs-toggle="pill"] .material-symbols-outlined,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link .material-symbols-outlined,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link i,
[data-bs-theme="dark"] .sb-item .material-symbols-outlined,
[data-bs-theme="dark"] .sb-sub-item .material-symbols-outlined,
[data-bs-theme="dark"] .mail-side-nav .list-group-item .material-symbols-outlined {
  color: currentColor !important;
}
[data-bs-theme="dark"] .nav-link .text-primary,
[data-bs-theme="dark"] .nav-link .text-info,
[data-bs-theme="dark"] .nav-link .text-secondary,
[data-bs-theme="dark"] .nav-link .text-body-secondary,
[data-bs-theme="dark"] .nav-link .text-muted,
[data-bs-theme="dark"] .dropdown-item .text-primary,
[data-bs-theme="dark"] .dropdown-item .text-info,
[data-bs-theme="dark"] .dropdown-item .text-secondary,
[data-bs-theme="dark"] .dropdown-item .text-body-secondary,
[data-bs-theme="dark"] .dropdown-item .text-muted,
[data-bs-theme="dark"] .list-group-item-action .text-primary,
[data-bs-theme="dark"] .list-group-item-action .text-info,
[data-bs-theme="dark"] .list-group-item-action .text-secondary,
[data-bs-theme="dark"] .list-group-item-action .text-body-secondary,
[data-bs-theme="dark"] .list-group-item-action .text-muted,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link .text-primary,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link .text-info,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link .text-secondary,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link .text-body-secondary,
[data-bs-theme="dark"] .fixed-sidenav-col .workspace-sidebar-action-link .text-muted,
[data-bs-theme="dark"] .sb-item .text-primary,
[data-bs-theme="dark"] .sb-item .text-info,
[data-bs-theme="dark"] .sb-item .text-secondary,
[data-bs-theme="dark"] .sb-item .text-body-secondary,
[data-bs-theme="dark"] .sb-item .text-muted,
[data-bs-theme="dark"] .sb-sub-item .text-primary,
[data-bs-theme="dark"] .sb-sub-item .text-info,
[data-bs-theme="dark"] .sb-sub-item .text-secondary,
[data-bs-theme="dark"] .sb-sub-item .text-body-secondary,
[data-bs-theme="dark"] .sb-sub-item .text-muted,
[data-bs-theme="dark"] .mail-side-nav .list-group-item .text-primary,
[data-bs-theme="dark"] .mail-side-nav .list-group-item .text-info,
[data-bs-theme="dark"] .mail-side-nav .list-group-item .text-secondary,
[data-bs-theme="dark"] .mail-side-nav .list-group-item .text-body-secondary,
[data-bs-theme="dark"] .mail-side-nav .list-group-item .text-muted {
  color: currentColor !important;
}
[data-bs-theme="dark"] .material-symbols-outlined.text-primary,
[data-bs-theme="dark"] .text-primary .material-symbols-outlined,
[data-bs-theme="dark"] .text-primary > .material-symbols-outlined {
  color: #9ec5fe !important;
}
[data-bs-theme="dark"] .nav-tabs .nav-link.active,
[data-bs-theme="dark"] .nav-tabs .nav-item.show .nav-link {
  color: #f8fafc !important;
}
[data-bs-theme="dark"] .btn-secondary {
  --bs-btn-bg: #495057;
  --bs-btn-border-color: #495057;
  --bs-btn-hover-bg: #5c636a;
  --bs-btn-hover-border-color: #6c757d;
  --bs-btn-active-bg: #5c636a;
  --bs-btn-active-border-color: #6c757d;
  --bs-btn-disabled-bg: #495057;
  --bs-btn-disabled-border-color: #495057;
}
[data-bs-theme="dark"] .btn-light {
  --bs-btn-color: #f8f9fa;
  --bs-btn-bg: #343a40;
  --bs-btn-border-color: #495057;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #495057;
  --bs-btn-hover-border-color: #6c757d;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #495057;
  --bs-btn-active-border-color: #6c757d;
}
[data-bs-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #ced4da;
  --bs-btn-border-color: #6c757d;
  --bs-btn-hover-color: #f8f9fa;
  --bs-btn-hover-bg: #495057;
  --bs-btn-hover-border-color: #6c757d;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #495057;
  --bs-btn-active-border-color: #6c757d;
}
[data-bs-theme="dark"] .btn-outline-light {
  --bs-btn-color: #f8f9fa;
  --bs-btn-border-color: #6c757d;
  --bs-btn-hover-color: #212529;
  --bs-btn-hover-bg: #f8f9fa;
  --bs-btn-hover-border-color: #f8f9fa;
  --bs-btn-active-color: #212529;
  --bs-btn-active-bg: #e9ecef;
  --bs-btn-active-border-color: #e9ecef;
}
[data-bs-theme="dark"] .btn-link,
[data-bs-theme="dark"] .btn-link.text-muted {
  color: var(--bs-link-color) !important;
}
[data-bs-theme="dark"] .btn-link:hover,
[data-bs-theme="dark"] .btn-link:focus,
[data-bs-theme="dark"] .btn-link.text-muted:hover,
[data-bs-theme="dark"] .btn-link.text-muted:focus {
  color: var(--bs-link-hover-color) !important;
}

/* Text / badges / alerts that still assume a light page */
[data-bs-theme="dark"] .text-dark { color: #f1f5f9 !important; }
[data-bs-theme="dark"] .badge.bg-primary,
[data-bs-theme="dark"] .badge.text-bg-primary {
  background-color: #2563eb !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .badge.bg-secondary,
[data-bs-theme="dark"] .badge.text-bg-secondary {
  background-color: #475569 !important;
  color: #f8fafc !important;
}
[data-bs-theme="dark"] .badge.bg-success,
[data-bs-theme="dark"] .badge.text-bg-success {
  background-color: #16a34a !important;
  color: #f0fdf4 !important;
}
[data-bs-theme="dark"] .badge.bg-danger,
[data-bs-theme="dark"] .badge.text-bg-danger {
  background-color: #dc2626 !important;
  color: #fff1f2 !important;
}
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.text-bg-warning {
  background-color: #f59e0b !important;
  color: #111827 !important;
}
[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .badge.text-bg-info {
  background-color: #0ea5e9 !important;
  color: #082f49 !important;
}
[data-bs-theme="dark"] .badge.bg-dark,
[data-bs-theme="dark"] .badge.text-bg-dark {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
[data-bs-theme="dark"] .text-bg-light,
[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-white,
[data-bs-theme="dark"] .badge.text-bg-light {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
[data-bs-theme="dark"] .badge.bg-light.text-secondary,
[data-bs-theme="dark"] .badge.bg-white.text-secondary,
[data-bs-theme="dark"] .badge.text-bg-light.text-secondary,
[data-bs-theme="dark"] .badge.bg-light.text-body-secondary,
[data-bs-theme="dark"] .badge.bg-white.text-body-secondary,
[data-bs-theme="dark"] .badge.text-bg-light.text-body-secondary,
[data-bs-theme="dark"] .badge.bg-secondary-subtle.text-secondary,
[data-bs-theme="dark"] .badge.bg-secondary-subtle.text-body-secondary {
  color: #cbd5e1 !important;
  border-color: #475569 !important;
}
[data-bs-theme="dark"] .badge.bg-light.text-primary,
[data-bs-theme="dark"] .badge.bg-white.text-primary,
[data-bs-theme="dark"] .badge.text-bg-light.text-primary {
  color: #93c5fd !important;
}
[data-bs-theme="dark"] .badge.bg-white.text-success,
[data-bs-theme="dark"] .badge.bg-light.text-success,
[data-bs-theme="dark"] .badge.text-bg-light.text-success {
  color: #86efac !important;
}
[data-bs-theme="dark"] .badge.bg-white.text-danger,
[data-bs-theme="dark"] .badge.bg-light.text-danger,
[data-bs-theme="dark"] .badge.text-bg-light.text-danger {
  color: #fca5a5 !important;
}
[data-bs-theme="dark"] .badge.bg-white.text-warning,
[data-bs-theme="dark"] .badge.bg-light.text-warning,
[data-bs-theme="dark"] .badge.text-bg-light.text-warning {
  color: #fcd34d !important;
}
[data-bs-theme="dark"] .badge.bg-white.text-info,
[data-bs-theme="dark"] .badge.bg-light.text-info,
[data-bs-theme="dark"] .badge.text-bg-light.text-info {
  color: #7dd3fc !important;
}
[data-bs-theme="dark"] .bg-white.text-dark,
[data-bs-theme="dark"] .bg-light.text-dark {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
[data-bs-theme="dark"] .bg-white.text-secondary,
[data-bs-theme="dark"] .bg-light.text-secondary,
[data-bs-theme="dark"] .bg-white.text-body-secondary,
[data-bs-theme="dark"] .bg-light.text-body-secondary {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
[data-bs-theme="dark"] .bg-white.text-primary,
[data-bs-theme="dark"] .bg-light.text-primary {
  background-color: #1e293b !important;
  color: #bfdbfe !important;
  border-color: #60a5fa !important;
}
[data-bs-theme="dark"] .bg-white.text-success,
[data-bs-theme="dark"] .bg-light.text-success {
  background-color: #1e293b !important;
  color: #bbf7d0 !important;
  border-color: #4ade80 !important;
}
[data-bs-theme="dark"] .bg-white.text-warning,
[data-bs-theme="dark"] .bg-light.text-warning,
[data-bs-theme="dark"] .bg-white.text-warning-emphasis,
[data-bs-theme="dark"] .bg-light.text-warning-emphasis {
  background-color: #1e293b !important;
  color: #fde68a !important;
  border-color: #fbbf24 !important;
}
[data-bs-theme="dark"] .bg-white.text-danger,
[data-bs-theme="dark"] .bg-light.text-danger,
[data-bs-theme="dark"] .bg-white.text-danger-emphasis,
[data-bs-theme="dark"] .bg-light.text-danger-emphasis {
  background-color: #1e293b !important;
  color: #fecaca !important;
  border-color: #f87171 !important;
}
[data-bs-theme="dark"] .bg-white.text-info,
[data-bs-theme="dark"] .bg-light.text-info,
[data-bs-theme="dark"] .bg-white.text-info-emphasis,
[data-bs-theme="dark"] .bg-light.text-info-emphasis {
  background-color: #1e293b !important;
  color: #bae6fd !important;
  border-color: #38bdf8 !important;
}
[data-bs-theme="dark"] .badge.bg-primary-subtle,
[data-bs-theme="dark"] .badge.text-bg-primary-subtle {
  background: rgba(37,99,235,.24) !important;
  color: #bfdbfe !important;
  border-color: rgba(96,165,250,.45) !important;
}
[data-bs-theme="dark"] .badge.bg-secondary-subtle,
[data-bs-theme="dark"] .badge.text-bg-secondary-subtle {
  background: rgba(71,85,105,.32) !important;
  color: #e2e8f0 !important;
  border-color: #64748b !important;
}
[data-bs-theme="dark"] .badge.bg-success-subtle,
[data-bs-theme="dark"] .badge.text-bg-success-subtle {
  background: rgba(34,197,94,.22) !important;
  color: #bbf7d0 !important;
  border-color: rgba(74,222,128,.4) !important;
}
[data-bs-theme="dark"] .badge.bg-warning-subtle,
[data-bs-theme="dark"] .badge.text-bg-warning-subtle {
  background: rgba(245,158,11,.24) !important;
  color: #fde68a !important;
  border-color: rgba(251,191,36,.42) !important;
}
[data-bs-theme="dark"] .badge.bg-danger-subtle,
[data-bs-theme="dark"] .badge.text-bg-danger-subtle {
  background: rgba(239,68,68,.22) !important;
  color: #fecaca !important;
  border-color: rgba(248,113,113,.4) !important;
}
[data-bs-theme="dark"] .badge.bg-info-subtle,
[data-bs-theme="dark"] .badge.text-bg-info-subtle {
  background: rgba(14,165,233,.22) !important;
  color: #bae6fd !important;
  border-color: rgba(56,189,248,.4) !important;
}
[data-bs-theme="dark"] .sched-holiday-pill {
  background: rgba(245,158,11,.2);
  color: #fde68a;
  border-color: rgba(251,191,36,.42);
}
[data-bs-theme="dark"] .bg-primary-subtle.text-primary,
[data-bs-theme="dark"] .bg-primary-subtle.text-primary-emphasis,
[data-bs-theme="dark"] .text-bg-primary-subtle {
  background: rgba(37,99,235,.24) !important;
  color: #bfdbfe !important;
  border-color: rgba(96,165,250,.45) !important;
}
[data-bs-theme="dark"] .bg-secondary-subtle.text-secondary,
[data-bs-theme="dark"] .bg-secondary-subtle.text-secondary-emphasis,
[data-bs-theme="dark"] .text-bg-secondary-subtle {
  background: rgba(71,85,105,.32) !important;
  color: #e2e8f0 !important;
  border-color: #64748b !important;
}
[data-bs-theme="dark"] .bg-success-subtle.text-success,
[data-bs-theme="dark"] .bg-success-subtle.text-success-emphasis,
[data-bs-theme="dark"] .text-bg-success-subtle {
  background: rgba(34,197,94,.22) !important;
  color: #bbf7d0 !important;
  border-color: rgba(74,222,128,.4) !important;
}
[data-bs-theme="dark"] .bg-warning-subtle.text-warning,
[data-bs-theme="dark"] .bg-warning-subtle.text-warning-emphasis,
[data-bs-theme="dark"] .text-bg-warning-subtle {
  background: rgba(245,158,11,.24) !important;
  color: #fde68a !important;
  border-color: rgba(251,191,36,.42) !important;
}
[data-bs-theme="dark"] .bg-danger-subtle.text-danger,
[data-bs-theme="dark"] .bg-danger-subtle.text-danger-emphasis,
[data-bs-theme="dark"] .text-bg-danger-subtle {
  background: rgba(239,68,68,.22) !important;
  color: #fecaca !important;
  border-color: rgba(248,113,113,.4) !important;
}
[data-bs-theme="dark"] .bg-info-subtle.text-info,
[data-bs-theme="dark"] .bg-info-subtle.text-info-emphasis,
[data-bs-theme="dark"] .text-bg-info-subtle {
  background: rgba(14,165,233,.22) !important;
  color: #bae6fd !important;
  border-color: rgba(56,189,248,.4) !important;
}
[data-bs-theme="dark"] .badge.text-primary-emphasis { color: #bfdbfe !important; }
[data-bs-theme="dark"] .badge.text-secondary-emphasis { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .badge.text-success-emphasis { color: #bbf7d0 !important; }
[data-bs-theme="dark"] .badge.text-warning-emphasis { color: #fde68a !important; }
[data-bs-theme="dark"] .badge.text-danger-emphasis { color: #fecaca !important; }
[data-bs-theme="dark"] .badge.text-info-emphasis { color: #bae6fd !important; }
[data-bs-theme="dark"] .badge[class*="bg-"][class*="bg-opacity-"].text-dark {
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .alert-secondary {
  background-color: #162032;
  border-color: #334155;
  color: #cbd5e1;
}
[data-bs-theme="dark"] .form-control.bg-light,
[data-bs-theme="dark"] .form-select.bg-light,
[data-bs-theme="dark"] .input-group-text.bg-white,
[data-bs-theme="dark"] .input-group-text.bg-light {
  background-color: #162032 !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] code.bg-white,
[data-bs-theme="dark"] .bg-white.border,
[data-bs-theme="dark"] .card-header.bg-white {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* Inline light tokens still used across legacy pages */
[data-bs-theme="dark"] #nc-content [style*="background:#fff"],
[data-bs-theme="dark"] #nc-content [style*="background: #fff"],
[data-bs-theme="dark"] #nc-content [style*="background:#ffffff"],
[data-bs-theme="dark"] #nc-content [style*="background: #ffffff"] {
  background: #1e293b !important;
}
[data-bs-theme="dark"] #nc-content [style*="background:#f8f9fa"],
[data-bs-theme="dark"] #nc-content [style*="background: #f8f9fa"],
[data-bs-theme="dark"] #nc-content [style*="background:#f8fafc"],
[data-bs-theme="dark"] #nc-content [style*="background: #f8fafc"],
[data-bs-theme="dark"] #nc-content [style*="background:#eef2f7"],
[data-bs-theme="dark"] #nc-content [style*="background: #eef2f7"],
[data-bs-theme="dark"] #nc-content [style*="background:#f1f5f9"],
[data-bs-theme="dark"] #nc-content [style*="background: #f1f5f9"] {
  background: #162032 !important;
}
[data-bs-theme="dark"] #nc-content [style*="background:#faf5ff"],
[data-bs-theme="dark"] #nc-content [style*="background: #faf5ff"] {
  background: rgba(124, 58, 237, .14) !important;
}
[data-bs-theme="dark"] #nc-content [style*="background:#eff6ff"],
[data-bs-theme="dark"] #nc-content [style*="background: #eff6ff"] {
  background: rgba(37, 99, 235, .14) !important;
}
[data-bs-theme="dark"] #nc-content [style*="background:#f0fdf4"],
[data-bs-theme="dark"] #nc-content [style*="background: #f0fdf4"] {
  background: rgba(34, 197, 94, .14) !important;
}
[data-bs-theme="dark"] #nc-content [style*="background:#fef2f2"],
[data-bs-theme="dark"] #nc-content [style*="background: #fef2f2"] {
  background: rgba(239, 68, 68, .14) !important;
}
[data-bs-theme="dark"] #nc-content [style*="border:1px solid #e2e8f0"],
[data-bs-theme="dark"] #nc-content [style*="border: 1px solid #e2e8f0"],
[data-bs-theme="dark"] #nc-content [style*="border-color:#e2e8f0"],
[data-bs-theme="dark"] #nc-content [style*="border-color: #e2e8f0"],
[data-bs-theme="dark"] #nc-content [style*="border:1px solid #dbe3ef"],
[data-bs-theme="dark"] #nc-content [style*="border: 1px solid #dbe3ef"],
[data-bs-theme="dark"] #nc-content [style*="border-color:#d1d5db"],
[data-bs-theme="dark"] #nc-content [style*="border-color: #d1d5db"] {
  border-color: #334155 !important;
}
[data-bs-theme="dark"] #nc-content [style*="color:#555"],
[data-bs-theme="dark"] #nc-content [style*="color: #555"],
[data-bs-theme="dark"] #nc-content [style*="color:#334155"],
[data-bs-theme="dark"] #nc-content [style*="color: #334155"],
[data-bs-theme="dark"] #nc-content [style*="color:#475569"],
[data-bs-theme="dark"] #nc-content [style*="color: #475569"],
[data-bs-theme="dark"] #nc-content [style*="color:#64748b"],
[data-bs-theme="dark"] #nc-content [style*="color: #64748b"],
[data-bs-theme="dark"] #nc-content [style*="color:#6b7280"],
[data-bs-theme="dark"] #nc-content [style*="color: #6b7280"],
[data-bs-theme="dark"] #nc-content [style*="color:#9ca3af"],
[data-bs-theme="dark"] #nc-content [style*="color: #9ca3af"] {
  color: #cbd5e1 !important;
}

/* ── Form elements ────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .form-section-heading {
  color: #64748b;
  border-bottom-color: #334155;
}

/* Signature pad */
[data-bs-theme="dark"] .sig-container {
  border-color: #334155;
  background: #0f172a;
}
[data-bs-theme="dark"] .sig-placeholder { color: #475569; }

/* NDIS item lookup dropdown */
[data-bs-theme="dark"] .ndis-lookup-dropdown {
  background: #1e293b;
  border-color: #334155;
}
[data-bs-theme="dark"] .ndis-lookup-dropdown li:hover { background: #0f172a; }
[data-bs-theme="dark"] .ndis-lookup-dropdown li       { color: #e2e8f0; }

/* ── Care notes ──────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .note-body { background: #162032; border-color: #334155; }
[data-bs-theme="dark"] .note-card-incident { border-left-color: #ef4444 !important; }
[data-bs-theme="dark"] .note-content-preview { color: #cbd5e1; }

/* ── Document library (documents/index.php) ──────────────────────────── */
[data-bs-theme="dark"] .safeguards-nav-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
[data-bs-theme="dark"] .safeguards-nav-btn:hover {
  border-color: #3b82f6;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .24);
}
[data-bs-theme="dark"] .safeguards-nav-btn.active {
  background: linear-gradient(180deg, rgba(30, 64, 175, .22) 0%, rgba(15, 23, 42, .96) 100%);
  border-color: rgba(96, 165, 250, .45);
}
[data-bs-theme="dark"] .safeguards-nav-icon {
  background: rgba(37, 99, 235, .18);
  color: #93c5fd;
}
[data-bs-theme="dark"] .safeguards-nav-meta { color: #94a3b8; }

@media (max-width: 1199.98px) {
  .safeguards-nav-card {
    position: static;
  }

  .safeguards-nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: .15rem;
  }

  .safeguards-nav-btn {
    min-width: 220px;
  }
}

[data-bs-theme="dark"] .doc-item {
  background: #1e293b;
  border-color: #334155;
}
[data-bs-theme="dark"] .doc-item:hover { background: #162032; }
[data-bs-theme="dark"] .doc-item-count { color: #64748b; }
[data-bs-theme="dark"] .doc-library-category { border-color: #334155; }


/* ── Offcanvas / modals extra surface ────────────────────────────────── */
/* Bootstrap handles .offcanvas and .modal backgrounds in dark mode.
   These cover any custom sub-sections within them.                       */
[data-bs-theme="dark"] .offcanvas-body .nc-card { background: #162032; }

/* ── Misc page patterns ──────────────────────────────────────────────── */
/* Onboarding dot indicator */
[data-bs-theme="dark"] .nc-ob-dot { border-color: #334155; }

/* border-light-subtle used as card dividers */
[data-bs-theme="dark"] .border-light-subtle { border-color: #334155 !important; }
[data-bs-theme="dark"] .border-bottom       { border-bottom-color: #334155 !important; }
[data-bs-theme="dark"] .border-top          { border-top-color:    #334155 !important; }

/* Scroll colour for main content area */
[data-bs-theme="dark"] #nc-content {
  scrollbar-color: #334155 transparent;
}

/* ── FullCalendar (scheduler/index.php) ──────────────────────────────────
   FC uses hardcoded light colours; override every surface that shows.    */

/* Column headers & day numbers */
[data-bs-theme="dark"] .fc .fc-col-header-cell-cushion { color: #94a3b8; }
[data-bs-theme="dark"] .fc .fc-daygrid-day-number      { color: #94a3b8; }

/* Grid borders */
[data-bs-theme="dark"] .fc-theme-bootstrap5 td,
[data-bs-theme="dark"] .fc-theme-bootstrap5 th,
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-scrollgrid { border-color: #334155 !important; }

/* Timegrid */
[data-bs-theme="dark"] .fc .fc-timegrid-axis         { color: #64748b; }
[data-bs-theme="dark"] .fc .fc-timegrid-slot-label   { color: #64748b; }
[data-bs-theme="dark"] .fc .fc-timegrid-slot-minor   { border-top-color: #1e2d40 !important; }

/* Non-business hours & col backgrounds */
[data-bs-theme="dark"] .fc .fc-non-business          { background: rgba(0,0,0,.25) !important; }
[data-bs-theme="dark"] .fc .fc-timegrid-col          { background: transparent; }

/* Today highlight */
[data-bs-theme="dark"] .fc .fc-day-today             { background: rgba(37,99,235,.12) !important; }

/* Now indicator */
[data-bs-theme="dark"] .fc .fc-timegrid-now-indicator-line { border-color: #3b82f6; }
[data-bs-theme="dark"] .fc .fc-timegrid-now-indicator-arrow { border-top-color: #3b82f6; border-bottom-color: #3b82f6; }

/* Toolbar */
[data-bs-theme="dark"] .fc .fc-toolbar-title         { color: #f1f5f9; }
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-button,
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-button:not(:disabled) { background-color: #1e293b; border-color: #334155; color: #cbd5e1; }
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-button:hover           { background-color: #263347; border-color: #475569; color: #f1f5f9; }
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-button-primary:not(:disabled).fc-button-active,
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-button-primary:not(:disabled):active { background-color: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* List view */
[data-bs-theme="dark"] .fc .fc-list-day-cushion        { background: #1e293b !important; color: #94a3b8; }
[data-bs-theme="dark"] .fc .fc-list-event:hover td     { background: #162032; }
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-list-table td { color: #cbd5e1; }
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-list-event-dot { border-color: #3b82f6; }
[data-bs-theme="dark"] .fc .fc-list-empty              { background: transparent; color: #64748b; }

.sched-holiday-pill {
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 700;
}

.fc .sched-public-holiday-event {
  background: transparent !important;
  border: 0 !important;
}

.fc .sched-public-holiday-event .fc-event-main {
  padding: 0 !important;
}

/* ── Staff-board MONTH view (compact: staff rows × ~30 day columns) ────
   Density-first design: each cell is ~28px wide, populated with a single
   coloured "pip" indicating shifts that day. Click a pip to drill into
   that staff/day. */
.sched-month-board-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bs-body-bg);
}
.sched-month-board {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: var(--nc-font-size-xs);
}
.sched-month-board thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bs-tertiary-bg);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 4px 0;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
}
.sched-month-board .sched-month-staff-cell {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bs-body-bg);
  border-right: 1px solid var(--bs-border-color);
  text-align: left;
  padding: 4px 10px;
  vertical-align: middle;
}
.sched-month-board thead .sched-month-staff-cell {
  background: var(--bs-tertiary-bg);
  z-index: 5;
}
.sched-month-board tbody tr + tr td { border-top: 1px solid var(--bs-border-color-translucent); }
.sched-month-day-head {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
}
.sched-month-day-head .sched-month-dow {
  font-size: .58rem;
  color: var(--bs-secondary-color);
  line-height: 1;
}
.sched-month-day-head .sched-month-dom {
  font-size: .72rem;
  font-weight: 600;
  color: var(--bs-emphasis-color);
  line-height: 1.1;
}
.sched-month-day-head.is-today { background: rgba(var(--bs-primary-rgb), .08); }
.sched-month-day-head.is-today .sched-month-dom { color: var(--bs-primary); }
.sched-month-day-head.is-weekend { background: var(--bs-tertiary-bg); }
.sched-month-board td.sched-month-day-cell {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  vertical-align: middle;
  text-align: center;
  padding: 2px 0;
}
.sched-month-board td.sched-month-day-cell.is-weekend { background: var(--bs-tertiary-bg); }
.sched-month-board td.sched-month-day-cell.is-today {
  background: rgba(var(--bs-primary-rgb), .04);
}
.sched-month-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--sched-stripe, #94a3b8);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
}
.sched-month-pip:hover { transform: scale(1.15); transition: transform .12s; }
.sched-month-leave-pip {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ec4899;
  opacity: .7;
}
.sched-month-total-cell {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: right;
  padding: 4px 10px;
  font-weight: 600;
  font-size: .72rem;
  color: var(--bs-emphasis-color);
  border-left: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}
.sched-month-board thead .sched-month-total-cell { font-weight: 600; }
[data-bs-theme="dark"] .sched-month-board thead th { background: #1e293b; border-bottom-color: #334155; }
[data-bs-theme="dark"] .sched-month-board .sched-month-staff-cell { background: var(--bs-body-bg); border-right-color: #334155; }
[data-bs-theme="dark"] .sched-month-board thead .sched-month-staff-cell,
[data-bs-theme="dark"] .sched-month-board .sched-month-total-cell { background: #1e293b; }
[data-bs-theme="dark"] .sched-month-day-head.is-weekend,
[data-bs-theme="dark"] .sched-month-board td.sched-month-day-cell.is-weekend { background: rgba(148,163,184,.06); }

/* ── Staff-board WEEK view (Gantt-style: staff rows × 7 day columns) ────
   Sticky staff column on the left, shift chips stacked per day cell.
   Sized to fit ~20 staff comfortably without horizontal scrolling. */
.sched-week-board-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bs-body-bg);
}
.sched-week-board {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0;
  font-size: var(--nc-font-size-sm);
}
.sched-week-board thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bs-tertiary-bg);
  border-bottom: 1px solid var(--bs-border-color);
  padding: .5rem .5rem;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
}
.sched-week-board .sched-week-staff-cell {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bs-body-bg);
  border-right: 1px solid var(--bs-border-color);
  text-align: left;
  padding: .5rem .75rem;
  vertical-align: middle;
}
.sched-week-board thead .sched-week-staff-cell {
  background: var(--bs-tertiary-bg);
  z-index: 5;
}
.sched-week-board tbody tr + tr td { border-top: 1px solid var(--bs-border-color-translucent); }
.sched-week-day-head .sched-week-day-name {
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--bs-secondary-color);
}
.sched-week-day-head .sched-week-day-date {
  font-size: .9rem;
  font-weight: 600;
  color: var(--bs-emphasis-color);
}
.sched-week-day-head.is-today .sched-week-day-date { color: var(--bs-primary); }
.sched-week-day-head.is-weekend { background: var(--bs-tertiary-bg); }
.sched-week-board td.sched-week-day-cell {
  width: calc((100% - 200px) / 7);
  min-width: 110px;
  vertical-align: top;
  padding: 4px;
  background: var(--bs-body-bg);
}
.sched-week-board td.sched-week-day-cell.is-weekend { background: var(--bs-tertiary-bg); }
.sched-week-board td.sched-week-day-cell.is-today {
  background: rgba(var(--bs-primary-rgb), .04);
}
.sched-week-chip {
  display: block;
  width: 100%;
  border: 0;
  border-left: 3px solid var(--sched-stripe, #94a3b8);
  border-radius: 4px;
  background: rgba(var(--bs-primary-rgb), .06);
  padding: 3px 6px;
  margin-bottom: 3px;
  text-align: left;
  cursor: pointer;
  font-size: .68rem;
  line-height: 1.2;
  color: var(--bs-emphasis-color);
}
.sched-week-chip:last-child { margin-bottom: 0; }
.sched-week-chip:hover { background: rgba(var(--bs-primary-rgb), .12); }
.sched-week-chip.sched-status-confirmed   { background: rgba(34,197,94,.08); }
.sched-week-chip.sched-status-pending     { background: rgba(245,158,11,.1); }
.sched-week-chip.sched-status-completed   { background: rgba(100,116,139,.1); }
.sched-week-chip.sched-status-cancelled   { background: rgba(220,38,38,.08); }
.sched-week-chip.sched-status-in-progress { background: rgba(37,99,235,.08); }
.sched-week-chip.sched-status-vacant      { background: rgba(234,88,12,.1); }
.sched-week-chip-time {
  display: block;
  font-weight: 600;
}
.sched-week-chip-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--bs-secondary-color);
}
.sched-week-leave {
  display: block;
  border-radius: 4px;
  background: rgba(236,72,153,.1);
  border-left: 3px solid #ec4899;
  padding: 3px 6px;
  margin-bottom: 3px;
  font-size: .65rem;
  font-weight: 600;
  color: #9d174d;
}
.sched-week-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  border: 1px dashed transparent;
  border-radius: 4px;
  color: transparent;
  text-decoration: none;
  font-weight: 700;
  transition: border-color .12s, color .12s, background .12s;
}
.sched-week-board td.sched-week-day-cell:hover .sched-week-empty {
  border-color: var(--bs-border-color);
  color: var(--bs-secondary-color);
}
.sched-week-empty:hover {
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
  background: rgba(var(--bs-primary-rgb), .04);
}
[data-bs-theme="dark"] .sched-week-board thead th { background: #1e293b; border-bottom-color: #334155; }
[data-bs-theme="dark"] .sched-week-board .sched-week-staff-cell { background: var(--bs-body-bg); border-right-color: #334155; }
[data-bs-theme="dark"] .sched-week-board thead .sched-week-staff-cell { background: #1e293b; }
[data-bs-theme="dark"] .sched-week-day-head.is-weekend,
[data-bs-theme="dark"] .sched-week-board td.sched-week-day-cell.is-weekend { background: rgba(148,163,184,.06); }
[data-bs-theme="dark"] .sched-week-leave { background: rgba(236,72,153,.18); color: #f9a8d4; }

/* ── FullCalendar event density + status colour stripes ──────────────────
   Goal: pack more shifts into a single day cell without the page becoming
   illegible. Smaller font, tighter padding, and a 4px coloured left stripe
   per status so events are scannable at a glance even when many overlap. */
.fc .fc-event {
  font-size: .68rem;
  line-height: 1.2;
  padding: 0;
  border-width: 0;
  cursor: pointer;
}
.fc .fc-event .fc-event-main,
.fc .fc-event .fc-event-main-frame {
  padding: 1px 4px;
}
.fc .fc-h-event,
.fc .fc-v-event {
  border: 0;
}
.fc .fc-daygrid-event { white-space: normal; }
.fc .fc-daygrid-event .fc-event-time { font-weight: 600; }

/* Per-status coloured left stripe — pale background already comes from PHP,
   but the stripe makes status legible at small sizes. Thicker in dayGrid
   (month) view where events are wide; thinner in timeGrid (week/day) where
   many events stack and a 4px bar would dominate visually. */
.fc .sched-shift-event,
.fc .sched-leave-event {
  border-left: 2px solid var(--sched-stripe, #94a3b8) !important;
  border-radius: 3px;
}
.fc .fc-daygrid-event.sched-shift-event,
.fc .fc-daygrid-event.sched-leave-event {
  border-left-width: 4px !important;
  border-radius: 4px;
}
.fc .sched-status-confirmed   { --sched-stripe: #16a34a; }   /* green */
.fc .sched-status-pending     { --sched-stripe: #f59e0b; }   /* amber */
.fc .sched-status-completed   { --sched-stripe: #64748b; }   /* slate */
.fc .sched-status-cancelled   { --sched-stripe: #dc2626; }   /* red   */
.fc .sched-status-in-progress { --sched-stripe: #2563eb; }   /* blue  */
.fc .sched-status-vacant      { --sched-stripe: #ea580c; }   /* orange */
.fc .sched-leave-event { --sched-stripe: #ec4899; }

/* Tighter time-grid slot height so more shifts fit without scrolling */
.fc .fc-timegrid-slot { height: 1.6em; }

/* Scheduler event content */
.sched-event-meta {
  opacity: .78;
  font-size: .62rem;
  line-height: 1.15;
}
.sched-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  border-radius: var(--bs-border-radius-sm, .25rem);
  font-size: .65rem;
  line-height: 1.4;
  font-weight: 600;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(0,0,0,.08);
  color: inherit;
}
.sched-task-badge .material-symbols-outlined {
  font-size: 12px;
  line-height: 1;
}
.sched-task-badge.is-done {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.sched-task-badge.is-partial {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
/* Group support membership: left-edge ribbon on shift cards + small icon badge.
   Distinguishes shifts that are part of a multi-participant group session from
   regular 1:1 shifts so the calendar shows the relationship at a glance. */
.fc .sched-shift-event.sched-shift-group {
  border-left-width: 4px !important;
  border-left-color: #6366f1 !important;
  position: relative;
}
.sched-group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
}
.sched-group-badge .material-symbols-outlined {
  font-size: 0.85rem;
  line-height: 1;
}
.sched-leave-badge {
  background: #fce7f3;
  color: #9d174d;
  border: 1px solid #ec4899;
}
[data-bs-theme="dark"] .sched-leave-badge {
  background: rgba(236,72,153,.18);
  color: #f9a8d4;
  border-color: rgba(236,72,153,.45);
}
[data-bs-theme="dark"] .fc .sched-shift-event,
[data-bs-theme="dark"] .fc .sched-leave-event {
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .fc .sched-event-meta {
  color: rgba(226,232,240,.82) !important;
}
[data-bs-theme="dark"] .fc .sched-status-confirmed {
  background-color: rgba(34,197,94,.18) !important;
  border-color: rgba(74,222,128,.35) !important;
  color: #bbf7d0 !important;
}
[data-bs-theme="dark"] .fc .sched-status-pending,
[data-bs-theme="dark"] .fc .sched-status-vacant {
  background-color: rgba(245,158,11,.18) !important;
  border-color: rgba(251,191,36,.35) !important;
  color: #fde68a !important;
}
[data-bs-theme="dark"] .fc .sched-status-completed {
  background-color: rgba(148,163,184,.18) !important;
  border-color: rgba(148,163,184,.35) !important;
  color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .fc .sched-status-cancelled {
  background-color: rgba(239,68,68,.18) !important;
  border-color: rgba(248,113,113,.35) !important;
  color: #fca5a5 !important;
}
[data-bs-theme="dark"] .fc .sched-status-in-progress {
  background-color: rgba(59,130,246,.2) !important;
  border-color: rgba(96,165,250,.38) !important;
  color: #bfdbfe !important;
}
[data-bs-theme="dark"] .fc .sched-leave-event {
  background-color: rgba(236,72,153,.18) !important;
  border-color: rgba(236,72,153,.42) !important;
  color: #f9a8d4 !important;
}
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-popover,
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-more-popover {
  background: #1e293b;
  border-color: #334155;
}
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-popover-header {
  background: #162032;
  color: #e2e8f0;
  border-bottom-color: #334155;
}
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-popover-body {
  background: #1e293b;
}

.sched-staff-board-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.sched-staff-board {
  width: calc(var(--sched-staff-col, 220px) + var(--sched-timeline, 1492px));
  min-width: calc(var(--sched-staff-col, 220px) + var(--sched-timeline, 1492px));
}
.sched-staff-board-head,
.sched-staff-board-row {
  display: grid;
}
.sched-staff-board-head {
  background: var(--bs-body-bg, #fff);
  z-index: 2;
}
.sched-staff-board-staffcell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border-right: 1px solid var(--bs-border-color, #e5e7eb);
  border-bottom: 1px solid var(--bs-border-color, #e5e7eb);
  background: var(--bs-body-bg, #fff);
  position: sticky;
  left: 0;
  z-index: 3;
}
.sched-staff-board-head .sched-staff-board-staffcell {
  min-height: 44px;
  font-weight: 700;
  z-index: 4;
}
.sched-staff-board-hours,
.sched-staff-board-track {
  overflow: visible;
  border-bottom: 1px solid var(--bs-border-color, #e5e7eb);
}
.sched-staff-board-hours-inner,
.sched-staff-board-track-inner {
  position: relative;
  min-height: 44px;
  background-image: linear-gradient(to right, rgba(148,163,184,.18) 1px, transparent 1px);
  background-size: 84px 100%;
}
.sched-staff-board-track-inner {
  min-height: 52px;
  background-image:
    linear-gradient(to right, rgba(148,163,184,.18) 1px, transparent 1px),
    linear-gradient(to right, rgba(148,163,184,.12) 1px, transparent 1px);
  background-size: 84px 100%, 42px 100%;
  background-position: 0 0, 0 0;
  cursor: crosshair;
}
.sched-staff-board-hour {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  padding: 8px 6px 0;
  color: var(--bs-secondary-color, #64748b);
  font-size: .68rem;
  font-weight: 600;
}
.sched-staff-board-endcap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52px;
  padding: 8px 0 0 6px;
  color: var(--bs-secondary-color, #64748b);
  font-size: .68rem;
  font-weight: 600;
}
.sched-staff-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.sched-staff-meta {
  min-width: 0;
}
.sched-staff-name {
  font-weight: 600;
  color: var(--bs-emphasis-color, #111827);
  font-size: .9rem;
}
.sched-staff-hours {
  font-size: .72rem;
  color: var(--bs-secondary-color, #64748b);
}
.sched-staff-add {
  margin-left: auto;
}
.sched-staff-leave,
.sched-staff-availability,
.sched-staff-shift {
  position: absolute;
  top: 10px;
  height: 22px;
  border-radius: 6px;
}
.sched-staff-empty {
  position: absolute;
  left: 12px;
  top: 14px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .58rem;
  line-height: 1.2;
  color: #64748b;
  background: rgba(148,163,184,.12);
  border: 1px dashed rgba(148,163,184,.28);
  white-space: nowrap;
  pointer-events: none;
}
.sched-staff-availability {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: rgba(34,197,94,.14);
  border: 1px solid rgba(34,197,94,.28);
  color: #166534;
  font-size: .6rem;
  overflow: hidden;
  white-space: nowrap;
  z-index: 0;
}
.sched-staff-leave {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: rgba(244,114,182,.18);
  border: 1px solid rgba(236,72,153,.35);
  color: #9d174d;
  font-size: .6rem;
  overflow: hidden;
  white-space: nowrap;
  z-index: 2;
}
.sched-staff-leave.is-available-on-request {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.28);
  color: #1d4ed8;
}
.sched-staff-shift {
  border: 1px solid transparent;
  padding: 2px 5px;
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
  background: #e8f3ee;
  border-color: #bfd8cb;
  color: #355b4b;
  z-index: 3;
}
.sched-staff-shift.sched-status-confirmed {
  background: #e8f3ee;
  border-color: #bfd8cb;
  color: #355b4b;
}
.sched-staff-shift.sched-status-pending,
.sched-staff-shift.sched-status-vacant {
  background: #fff3df;
  border-color: #f2d3a2;
  color: #8a5a1f;
}
.sched-staff-shift.sched-status-completed {
  background: #f1f5f9;
  border-color: #d6dee8;
  color: #52606d;
}
.sched-staff-shift.sched-status-cancelled {
  background: #fcebea;
  border-color: #f2c6c4;
  color: #9f3a38;
}
.sched-staff-shift.sched-status-in-progress {
  background: #e8f0ff;
  border-color: #c8d8fb;
  color: #34558b;
}
.sched-staff-shift-title {
  display: block;
  font-weight: 700;
  font-size: .62rem;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-staff-shift-meta {
  display: block;
  font-size: .54rem;
  line-height: 1.05;
  opacity: .72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-bs-theme="dark"] .sched-staff-board-staffcell,
[data-bs-theme="dark"] .sched-staff-board-head {
  background: #0f172a;
  border-color: #334155;
}
[data-bs-theme="dark"] .sched-staff-board-hours,
[data-bs-theme="dark"] .sched-staff-board-track {
  border-color: #334155;
}
[data-bs-theme="dark"] .sched-staff-board-hours-inner,
[data-bs-theme="dark"] .sched-staff-board-track-inner {
  background-image:
    linear-gradient(to right, rgba(71,85,105,.35) 1px, transparent 1px),
    linear-gradient(to right, rgba(51,65,85,.3) 1px, transparent 1px);
}
[data-bs-theme="dark"] .sched-staff-name {
  color: #f1f5f9;
}
[data-bs-theme="dark"] .sched-staff-hours,
[data-bs-theme="dark"] .sched-staff-board-hour,
[data-bs-theme="dark"] .sched-staff-board-endcap {
  color: #94a3b8;
}
[data-bs-theme="dark"] .sched-staff-leave {
  background: rgba(236,72,153,.18);
  border-color: rgba(236,72,153,.35);
  color: #f9a8d4;
}
[data-bs-theme="dark"] .sched-staff-availability {
  background: rgba(34,197,94,.16);
  border-color: rgba(74,222,128,.3);
  color: #86efac;
}
[data-bs-theme="dark"] .sched-staff-leave.is-available-on-request {
  background: rgba(59,130,246,.16);
  border-color: rgba(96,165,250,.35);
  color: #bfdbfe;
}
[data-bs-theme="dark"] .sched-staff-shift {
  background-color: rgba(34,197,94,.18);
  border-color: rgba(74,222,128,.35);
  color: #bbf7d0;
}
[data-bs-theme="dark"] .sched-staff-shift.sched-status-pending,
[data-bs-theme="dark"] .sched-staff-shift.sched-status-vacant {
  background-color: rgba(245,158,11,.18);
  border-color: rgba(251,191,36,.35);
  color: #fde68a;
}
[data-bs-theme="dark"] .sched-staff-shift.sched-status-completed {
  background-color: rgba(148,163,184,.18);
  border-color: rgba(148,163,184,.35);
  color: #cbd5e1;
}
[data-bs-theme="dark"] .sched-staff-shift.sched-status-cancelled {
  background-color: rgba(239,68,68,.18);
  border-color: rgba(248,113,113,.35);
  color: #fca5a5;
}
[data-bs-theme="dark"] .sched-staff-shift.sched-status-in-progress {
  background-color: rgba(59,130,246,.2);
  border-color: rgba(96,165,250,.38);
  color: #bfdbfe;
}
[data-bs-theme="dark"] .sched-staff-empty {
  color: #94a3b8;
  background: rgba(51,65,85,.45);
  border-color: rgba(100,116,139,.45);
}
/* Scheduler shift modal */
[data-bs-theme="dark"] .canvas-section-label { color: #94a3b8; }
[data-bs-theme="dark"] .sched-filter-alert   { background: #162032; border-color: #334155; color: #94a3b8; }

.shift-billing-line {
  padding: .7rem !important;
}

[data-bs-theme="dark"] .shift-billing-line {
  border-color: #334155 !important;
}

[data-bs-theme="dark"] .participant-timeline-card {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
  box-shadow: none;
}

[data-bs-theme="dark"] .participant-timeline-card:hover {
  border-color: rgba(96,165,250,.45);
  box-shadow: 0 10px 24px rgba(2, 6, 23, .28);
}

[data-bs-theme="dark"] .participant-timeline-meta,
[data-bs-theme="dark"] .participant-timeline-date {
  color: var(--bs-secondary-color);
}

/* Reckon export (rx-*) */
[data-bs-theme="dark"] .rx-card {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}

/* Old grid scheduler (day-*, staff-*, add-shift-btn) */
[data-bs-theme="dark"] .day-num          { color: var(--bs-body-color); }
[data-bs-theme="dark"] .day-name         { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .day-cell.today   { background: rgba(37,99,235,.1); }
[data-bs-theme="dark"] .staff-name       { color: var(--bs-body-color); }
[data-bs-theme="dark"] .staff-hours      { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .add-shift-btn    { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .add-shift-btn:hover { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }

/* Shift event label text (ev-*) */
[data-bs-theme="dark"] .ev-time { opacity: .85; }
[data-bs-theme="dark"] .ev-svc  { opacity: .65; }

/* ── Email module (emails/index.php) ─────────────────────────────────────
   All colours are consumed via CSS custom properties set on .em-shell.
   Flip the tokens; every class repaints automatically.                   */
[data-bs-theme="dark"] .em-shell {
  --em-sidebar-bg:          var(--bs-body-bg);
  --em-sidebar-text:        var(--bs-secondary-color);
  --em-sidebar-hover:       var(--bs-secondary-bg);
  --em-sidebar-active:      rgba(var(--bs-primary-rgb), .18);
  --em-sidebar-border:      var(--bs-border-color);
  --em-list-bg:             var(--bs-tertiary-bg);
  --em-list-border:         var(--bs-border-color);
  --em-pane-bg:             var(--bs-body-bg);
  --em-toolbar-bg:          var(--bs-tertiary-bg);
  --em-row-hover:           var(--bs-secondary-bg);
  --em-row-active:          rgba(var(--bs-primary-rgb), .12);
  --em-row-active-border:   #3b82f6;
  --em-text-primary:        var(--bs-emphasis-color);
  --em-text-secondary:      var(--bs-body-color);
  --em-text-muted:          var(--bs-secondary-color);
  --em-text-dim:            #868e96;
  --em-border:              var(--bs-border-color);
  --em-shadow-sm:           0 1px 3px rgba(0,0,0,.4);
  --em-shadow-md:           0 4px 16px rgba(0,0,0,.5);
  --em-shadow-lg:           0 12px 36px rgba(0,0,0,.6);
}
/* A few hardcoded colours inside the email module not using tokens */
[data-bs-theme="dark"] .em-pane-head       { background: var(--em-toolbar-bg); border-color: var(--em-border); }
[data-bs-theme="dark"] .em-pane-card       { background: var(--em-toolbar-bg); border-color: var(--em-border); }
[data-bs-theme="dark"] .em-list-scroll     { background: var(--em-pane-bg); }
[data-bs-theme="dark"] .em-search-bar input { background: var(--bs-body-bg); border-color: var(--em-border); color: var(--em-text-primary); }
[data-bs-theme="dark"] .em-ribbon         { background: var(--em-toolbar-bg); border-color: var(--em-border); }
[data-bs-theme="dark"] .em-ribbon-btn     { background: transparent; border-color: transparent; color: var(--em-text-muted); }
[data-bs-theme="dark"] .em-ribbon-btn:hover { background: var(--bs-secondary-bg); border-color: var(--em-border); color: #9ec5fe; }
[data-bs-theme="dark"] .em-ribbon-divider  { background: var(--em-border); }
[data-bs-theme="dark"] .em-ctx-menu        { background: var(--bs-tertiary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .em-ctx-item        { color: var(--em-text-secondary); }
[data-bs-theme="dark"] .em-ctx-item:hover  { background: var(--bs-secondary-bg); }
[data-bs-theme="dark"] .em-ctx-sep         { border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .em-folder-ctx-menu { background: var(--bs-tertiary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .mail-message-card  { background: var(--em-toolbar-bg); border-color: var(--em-border); }
[data-bs-theme="dark"] .em-page-btn        { background: var(--em-toolbar-bg); border-color: var(--em-border); color: var(--em-text-muted); }
[data-bs-theme="dark"] .em-page-btn:hover  { background: var(--bs-secondary-bg); color: var(--em-text-primary); }
[data-bs-theme="dark"] .reply-composer     { background: var(--em-toolbar-bg); border-color: var(--em-border); }
[data-bs-theme="dark"] .cmp-card           { background: var(--em-toolbar-bg); border-color: var(--em-border); }
[data-bs-theme="dark"] .cmp-field-row      { border-color: var(--em-border); }
[data-bs-theme="dark"] .cmp-field-label    { color: var(--em-text-muted); }
[data-bs-theme="dark"] .mail-attach-card   { background: var(--bs-secondary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .mail-body-frame,
[data-bs-theme="dark"] .em-body-frame      { background: var(--bs-tertiary-bg); }
[data-bs-theme="dark"] .mail-message-shell { background: transparent; }
[data-bs-theme="dark"] .mail-view-title    { color: #f1f5f9; }
[data-bs-theme="dark"] .mail-view-subtle   { color: var(--em-text-muted); }
[data-bs-theme="dark"] .mail-side-nav {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .mail-side-nav-label {
  background: var(--bs-tertiary-bg);
  border-bottom-color: var(--bs-border-color);
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .mail-side-nav .list-group-item {
  background: #1e293b;
  color: #94a3b8;
}
[data-bs-theme="dark"] .mail-side-nav .list-group-item:hover {
  background: #162032;
  color: #f1f5f9;
}
[data-bs-theme="dark"] .mail-side-nav .list-group-item.active {
  background: rgba(37,99,235,.16);
  border-left-color: #60a5fa;
  color: #f1f5f9;
}
[data-bs-theme="dark"] .mail-side-nav .list-group-item i { color: #64748b; }
[data-bs-theme="dark"] .mail-side-nav .list-group-item.active i { color: #93c5fd; }
[data-bs-theme="dark"] .mail-body-shell      { background: #0f172a; }
[data-bs-theme="dark"] .mail-attachment-card { background: #162032; border-color: #334155; }
[data-bs-theme="dark"] .mail-attachment-name { color: #f1f5f9; }
[data-bs-theme="dark"] .mail-attachment-size { color: #94a3b8; }
[data-bs-theme="dark"] .ck.ck-toolbar {
  background: #162032 !important;
  border-color: #334155 !important;
}
[data-bs-theme="dark"] .ck.ck-editor__editable_inline {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .cmp-wrap { color: #e2e8f0; }
[data-bs-theme="dark"] .cmp-nav .btn-back:hover {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
[data-bs-theme="dark"] .cmp-ribbon {
  background: #1a2540;
  border-color: #1e2d45;
}
[data-bs-theme="dark"] .cmp-rbn-btn:hover {
  background: #162032;
  border-color: #334155;
  color: #f1f5f9;
}
[data-bs-theme="dark"] .cmp-rbn-btn.active {
  background: rgba(37,99,235,.16);
  border-color: #3b82f6;
  color: #93c5fd;
}
[data-bs-theme="dark"] .em-token-field:focus-within {
  background: #0f172a;
  border-color: #3b82f6;
}
[data-bs-theme="dark"] .em-token {
  background: rgba(37,99,235,.18);
  border-color: rgba(96,165,250,.35);
  color: #bfdbfe;
}
[data-bs-theme="dark"] .em-token button { color: #bfdbfe; }
[data-bs-theme="dark"] .em-ac-drop {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
[data-bs-theme="dark"] .em-ac-item {
  border-bottom-color: #334155;
  color: #cbd5e1;
}
[data-bs-theme="dark"] .em-ac-item:hover,
[data-bs-theme="dark"] .em-ac-item.focused { background: #162032; }
[data-bs-theme="dark"] .em-ac-email { color: #94a3b8; }
[data-bs-theme="dark"] .mail-attach-rail {
  background: #162032;
  border-color: #334155;
}
[data-bs-theme="dark"] .mail-attach-rail.dragover {
  background: rgba(37,99,235,.16);
  border-color: #60a5fa;
}
[data-bs-theme="dark"] .mail-attach-trigger {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
[data-bs-theme="dark"] .mail-attach-chip {
  background: #1e293b;
  border-color: #334155;
}
[data-bs-theme="dark"] .compose-sig-preview {
  background: #162032;
  border-color: #334155;
}
[data-bs-theme="dark"] .cmp-groups-popover {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
[data-bs-theme="dark"] .cmp-groups-pop-head,
[data-bs-theme="dark"] .cmp-group-count { color: #94a3b8; }
[data-bs-theme="dark"] .cmp-group-item:hover { background: #162032; }
[data-bs-theme="dark"] .cmp-group-icon {
  background: rgba(124,58,237,.22);
  color: #c4b5fd;
}
[data-bs-theme="dark"] .cmp-group-name { color: #f1f5f9; }
[data-bs-theme="dark"] .cmp-groups-pop-footer { border-top-color: #334155; }

/* ── Document library / PDF tools ───────────────────────────────────── */
[data-bs-theme="dark"] #doc-toolbar {
  background: #1e293b;
  border-bottom-color: #334155;
}
[data-bs-theme="dark"] #doc-sidebar-inline,
[data-bs-theme="dark"] #doc-sidebar-expand {
  background: #0f172a;
  border-right-color: #334155;
}
[data-bs-theme="dark"] #doc-sidebar-header {
  background: #1e293b;
  border-bottom-color: #334155;
}
[data-bs-theme="dark"] #doc-sidebar-caret { color: #94a3b8; }
[data-bs-theme="dark"] #doc-sidebar-caret:hover {
  background: #162032;
  color: #f1f5f9;
}
[data-bs-theme="dark"] #sel-bar {
  background: #1e293b;
  border-color: #334155;
}
[data-bs-theme="dark"] .pdf-form-preview iframe {
  border-color: #334155;
  background: #fff;
}
[data-bs-theme="dark"] .pdf-field-card {
  background: #1e293b;
  border-color: #334155;
}
[data-bs-theme="dark"] .pdf-field-card.is-prefilled {
  background: #162032;
  border-color: #475569;
}
[data-bs-theme="dark"] .pdf-field-label { color: #f1f5f9; }
[data-bs-theme="dark"] .pdf-field-meta,
[data-bs-theme="dark"] .pdf-field-help { color: #94a3b8; }

/* ── Install control plane ───────────────────────────────────────────── */
[data-bs-theme="dark"] .ops-shell {
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 24%),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
  border-color: #334155;
}
[data-bs-theme="dark"] .ops-chip,
[data-bs-theme="dark"] .ops-toolbar,
[data-bs-theme="dark"] .ops-panel,
[data-bs-theme="dark"] .ops-summary-item,
[data-bs-theme="dark"] .ops-directory-pane,
[data-bs-theme="dark"] .ops-directory-pane-head,
[data-bs-theme="dark"] .ops-directory-search,
[data-bs-theme="dark"] .ops-directory-list,
[data-bs-theme="dark"] .ops-entity,
[data-bs-theme="dark"] .ops-stat,
[data-bs-theme="dark"] .ops-metric,
[data-bs-theme="dark"] .ops-work-card,
[data-bs-theme="dark"] .ops-rollout-section,
[data-bs-theme="dark"] .ops-collapsible {
  background: #1e293b;
  border-color: #334155;
  box-shadow: none;
}
[data-bs-theme="dark"] .ops-rollout-section-primary {
  background: linear-gradient(180deg, #162032 0%, #1e293b 100%);
  border-color: rgba(59,130,246,.35);
}
[data-bs-theme="dark"] .ops-status-card {
  background: #162032;
  border-color: #334155;
}
[data-bs-theme="dark"] .ops-status-card.success {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.28);
}
[data-bs-theme="dark"] .ops-status-card.warning {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.3);
}
[data-bs-theme="dark"] .ops-status-card.info {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.28);
}
[data-bs-theme="dark"] .ops-status-card.danger {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.28);
}
[data-bs-theme="dark"] .ops-directory-row,
[data-bs-theme="dark"] .ops-collapsible > summary { border-color: #334155; }
[data-bs-theme="dark"] .ops-directory-row:hover { background: #162032; }
[data-bs-theme="dark"] .ops-directory-row.is-active { background: rgba(37,99,235,.16); }
[data-bs-theme="dark"] .ops-directory-row.is-active::before { background: #60a5fa; }
[data-bs-theme="dark"] .ops-entity.active {
  background: #162032;
  border-color: #60a5fa;
  box-shadow: none;
}
[data-bs-theme="dark"] .ops-topnav .nav-link,
[data-bs-theme="dark"] .ops-subtabs .nav-link,
[data-bs-theme="dark"] .ops-section-link,
[data-bs-theme="dark"] .ops-directory-pill {
  background: #162032;
  border-color: #334155;
  color: #cbd5e1;
}
[data-bs-theme="dark"] .ops-topnav .nav-link.active,
[data-bs-theme="dark"] .ops-subtabs .nav-link.active,
[data-bs-theme="dark"] .ops-section-link.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
[data-bs-theme="dark"] .ops-directory-title,
[data-bs-theme="dark"] .ops-rollout-title,
[data-bs-theme="dark"] .ops-directory-name,
[data-bs-theme="dark"] .ops-chip-value,
[data-bs-theme="dark"] .ops-summary-value,
[data-bs-theme="dark"] .ops-metric-value,
[data-bs-theme="dark"] .ops-entity.active .ops-directory-name {
  color: #f1f5f9;
}
[data-bs-theme="dark"] .ops-chip-kicker,
[data-bs-theme="dark"] .ops-rollout-kicker,
[data-bs-theme="dark"] .ops-metric-label,
[data-bs-theme="dark"] .ops-summary-label,
[data-bs-theme="dark"] .ops-toolbar .form-label {
  color: #64748b;
}
[data-bs-theme="dark"] .ops-chip-note,
[data-bs-theme="dark"] .ops-directory-copy,
[data-bs-theme="dark"] .ops-directory-meta,
[data-bs-theme="dark"] .ops-rollout-copy,
[data-bs-theme="dark"] .ops-summary-note,
[data-bs-theme="dark"] .ops-metric-note,
[data-bs-theme="dark"] .ops-status-step,
[data-bs-theme="dark"] .ops-directory-count,
[data-bs-theme="dark"] .ops-rollout-version-label,
[data-bs-theme="dark"] .ops-rollout-select-label,
[data-bs-theme="dark"] .ops-directory-version {
  color: #94a3b8;
}
[data-bs-theme="dark"] .ops-directory-domain,
[data-bs-theme="dark"] .ops-directory-pill strong,
[data-bs-theme="dark"] .ops-collapsible > summary {
  color: #cbd5e1;
}

/* ── Invoices ─────────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .inv-th { background: #1d4ed8 !important; }
[data-bs-theme="dark"] .inv-section-label { color: #64748b; }
[data-bs-theme="dark"] .lines-table thead th { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-bs-theme="dark"] .lines-table tbody td { border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .total-display,
[data-bs-theme="dark"] .subtotal-display   { color: #f1f5f9; }
[data-bs-theme="dark"] .shaded-gray        { background: #1e293b !important; }
[data-bs-theme="dark"] .shaded-blue        { background: rgba(37,99,235,.15) !important; }
[data-bs-theme="dark"] .shaded-green       { background: rgba(21,128,61,.18) !important; }
[data-bs-theme="dark"] .shaded-yellow      { background: rgba(180,83,9,.18) !important; }
[data-bs-theme="dark"] .st-paid,
[data-bs-theme="dark"] .rv-paid,
[data-bs-theme="dark"] .hort-paid          { color: #6ee7b7; }
[data-bs-theme="dark"] .st-closed,
[data-bs-theme="dark"] .rv-closed          { color: #94a3b8; }
[data-bs-theme="dark"] .invoice-simple {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] .invoice-simple .invoice-simple-detail-label,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-meta .invoice-simple-detail-label,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-recipient-prefix,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-line-meta,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-payment-grid span,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-payment-sep {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .invoice-simple .invoice-simple-detail-value,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-provider-name,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-heading,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-recipient-name,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-recipient-meta-side,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-payment-inline,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-payment-reference strong,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-total-label,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-lines td,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-lines th {
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] .invoice-simple .invoice-simple-divider,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-lines th,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-lines td,
[data-bs-theme="dark"] .invoice-simple .invoice-simple-lines tfoot td {
  border-color: #334155;
}
[data-bs-theme="dark"] .invoice-simple .invoice-simple-lines thead th {
  background: #162032;
}
/* Exceptions that should stay light for usability */
[data-bs-theme="dark"] #manageTotpQrCode {
  background: #fff !important;
  color: #111827 !important;
}

/* ── Outreach / blast builder (b-rtab / b-rpane are light-panel) ──────── */
[data-bs-theme="dark"] .b-rtab          { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .b-rtab:hover    { background: #162032; color: #e2e8f0; }
[data-bs-theme="dark"] .b-rtab.active   { background: #162032; color: #93c5fd; }
[data-bs-theme="dark"] .b-rpane         { background: #0f172a; }
[data-bs-theme="dark"] .contact-browse-list { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .status-dot.live   { background: #22c55e; }
[data-bs-theme="dark"] .status-dot.draft  { background: #64748b; }
[data-bs-theme="dark"] .preview-modal .modal-content { background: #1e293b; }
[data-bs-theme="dark"] .preview-subject-line { color: #f1f5f9; }
[data-bs-theme="dark"] .tpl-grid        { background: #0f172a; }
[data-bs-theme="dark"] .tpl-modal .modal-content { background: #1e293b; }

/* ── Staff module ────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .at-risk         { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.3); }
[data-bs-theme="dark"] .ssm-current-badge { background: #162032; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .fc-pop-title    { color: #f1f5f9; }
[data-bs-theme="dark"] .fc-pop-body     { color: #94a3b8; }

/* ── table-light rows ─────────────────────────────────────────────────── */
[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark"] .table-light td  { background: #162032 !important; color: #94a3b8; border-color: #334155 !important; }

/* ── Photo / avatar placeholders ─────────────────────────────────────── */
[data-bs-theme="dark"] .photo-placeholder { background: #1e293b; border-color: #334155; color: #475569; }
[data-bs-theme="dark"] .photo-preview img { border-color: #334155; }

/* ── section-head (generic heading divider used across pages) ────────── */
[data-bs-theme="dark"] .section-head    { border-color: #334155; color: #64748b; }
[data-bs-theme="dark"] .section-title   { color: #94a3b8; }

/* ── required-star ────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .required-star   { color: #f87171; }

/* ── Flatpickr calendar popup ─────────────────────────────────────────── */
[data-bs-theme="dark"] .flatpickr-calendar {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
[data-bs-theme="dark"] .flatpickr-day             { color: #cbd5e1; }
[data-bs-theme="dark"] .flatpickr-day:hover        { background: #162032; border-color: #334155; }
[data-bs-theme="dark"] .flatpickr-day.selected     { background: #2563eb; border-color: #2563eb; color: #fff; }
[data-bs-theme="dark"] .flatpickr-day.today        { border-color: #3b82f6; }
[data-bs-theme="dark"] .flatpickr-day.flatpickr-disabled { color: #334155; }
[data-bs-theme="dark"] .flatpickr-months           { color: #f1f5f9; }
[data-bs-theme="dark"] .flatpickr-prev-month,
[data-bs-theme="dark"] .flatpickr-next-month       { fill: #94a3b8; }
[data-bs-theme="dark"] .flatpickr-weekday          { color: #64748b; }
[data-bs-theme="dark"] .flatpickr-current-month input.cur-year { color: #f1f5f9; }
[data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months { color: #f1f5f9; background: #1e293b; }

/* ── nc-actions bar ───────────────────────────────────────────────────── */
[data-bs-theme="dark"] .nc-actions { border-color: var(--bs-border-color); background: var(--bs-tertiary-bg); }

/* Batch A widgets — toasts, dialogs, empty states, pills, skeletons */
[data-bs-theme="dark"] .nc-toast {
  background: var(--bs-tertiary-bg); color: var(--bs-body-color);
  box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
}
[data-bs-theme="dark"] #nc-dialog-backdrop { background: rgba(0,0,0,.65); }
[data-bs-theme="dark"] .nc-dialog { background: var(--bs-tertiary-bg); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .nc-dialog .nc-dlg-title { color: #f1f5f9; }
[data-bs-theme="dark"] .nc-dialog .nc-dlg-msg   { color: var(--bs-body-color); }
[data-bs-theme="dark"] .nc-dialog .nc-dlg-actions { background: var(--bs-secondary-bg); }
[data-bs-theme="dark"] .nc-pill { background: #334155; color: #cbd5e1; }
[data-bs-theme="dark"] .nc-pill.success { background: rgba(134,239,172,.15); color: #86efac; }
[data-bs-theme="dark"] .nc-pill.danger  { background: rgba(252,165,165,.15); color: #fca5a5; }
[data-bs-theme="dark"] .nc-pill.warning { background: rgba(252,211,77,.15);  color: #fcd34d; }
[data-bs-theme="dark"] .nc-pill.info    { background: rgba(125,211,252,.15); color: #7dd3fc; }
[data-bs-theme="dark"] .nc-skeleton {
  background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%);
}
[data-bs-theme="dark"] .nc-selected,
[data-bs-theme="dark"] label.nc-selected {
  background: #0f172a !important;
  color: #93c5fd !important;
  box-shadow: inset 0 0 0 1px #3b82f6;
}
[data-bs-theme="dark"] .nc-soft         { background: #0f172a; color: #cbd5e1; }
[data-bs-theme="dark"] .nc-soft-success { background: rgba(134,239,172,.12); color: #86efac; }
[data-bs-theme="dark"] .nc-soft-danger  { background: rgba(252,165,165,.12); color: #fca5a5; }
[data-bs-theme="dark"] .nc-soft-warning { background: rgba(252,211,77,.12);  color: #fcd34d; }
[data-bs-theme="dark"] .nc-soft-info    { background: rgba(125,211,252,.12); color: #7dd3fc; }
[data-bs-theme="dark"] .bg-primary.bg-opacity-10,
[data-bs-theme="dark"] .bg-primary.bg-opacity-25 {
  background-color: #0f172a !important; color: #93c5fd !important;
}

/* Generic Bootstrap nav-pills */
[data-bs-theme="dark"] #nc-content .nav-pills .nav-link {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-nav-link-color);
}
[data-bs-theme="dark"] #nc-content .nav-pills .nav-link:hover {
  background: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-nav-link-hover-color);
}
[data-bs-theme="dark"] #nc-content .nav-pills .nav-link.active,
[data-bs-theme="dark"] #nc-content .nav-pills .show > .nav-link {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* Catch-all for hard-coded white surfaces from earlier blocks */
[data-bs-theme="dark"] #nc-topbar { background: var(--bs-tertiary-bg); border-bottom-color: var(--bs-border-color); }
[data-bs-theme="dark"] .nc-header-search .form-control,
[data-bs-theme="dark"] .nc-header-search .form-select {
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] body { color: var(--bs-body-color); }

.participant-workspace-switch .nav-link {
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-radius: .65rem;
  padding: .45rem .95rem;
  font-weight: 600;
  line-height: 1.2;
}

.participant-workspace-switch .nav-link:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.participant-workspace-switch .nav-link.active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

[data-bs-theme="dark"] .participant-workspace-switch .nav-link {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-nav-link-color);
}

[data-bs-theme="dark"] .participant-workspace-switch .nav-link:hover {
  background: var(--bs-secondary-bg);
  border-color: var(--bs-primary);
  color: #9ec5fe;
}

[data-bs-theme="dark"] .participant-workspace-switch .nav-link.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
