/* Auto-Deployment Test - v1.0.3 - WEBHOOK ONLY TEST */
@import url("tokens.css?v=20260307");
@import url("components.buttons.css?v=20260307");
@import url("components.modal.css?v=20260307");
@import url("components.forms.css?v=20260307");
@import url("components.toast.css?v=20260307");
@import url("components.table.css?v=20260307");
@import url("components.pagination.css?v=20260307");
@import url("components.notifications.css?v=20260307a");
@import url("ai-wizard.css?v=20260307");

/* Layout + Dashboard styles */

.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  min-width: 100% !important;
  background: var(--bg) !important;
  position: relative;
  width: 100%;
}

/* Sidebar */
.sidebar {
  --sidebar-rail-w: 78px;
  width: var(--sidebar-rail-w);
  padding: 0;
  background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.98), rgba(var(--surface-rgb), 0.94));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  z-index: 120;
  overflow: visible;
  box-shadow: none;
  transition: width var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.sidebar::before {
  display: none;
}

.sidebar.is-desktop-open {
  width: var(--sidebar-w);
  box-shadow: none;
}

.sidebar__quick-nav {
  position: absolute;
  top: 18px;
  left: 17px;
  bottom: 18px;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding-top: 0;
  z-index: 2;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast);
}

.sidebar__quick-brand {
  flex-shrink: 0;
}

.sidebar.is-desktop-open .sidebar__quick-nav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-14px);
}

.sidebar__quick-brand,
.sidebar__quick-link {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border: 0;
  background: transparent;
  box-shadow: none;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.sidebar__quick-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 16px 30px rgba(var(--brand-rgb), 0.24);
}

.sidebar__quick-links {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sidebar__quick-links--primary {
  flex: 1 1 auto;
  justify-content: center;
  padding: 22px 0 16px;
}

.sidebar__quick-links--utility {
  flex: 0 0 auto;
  gap: 8px;
  padding-bottom: 14px;
}

.sidebar__quick-link:hover,
.sidebar__quick-brand:hover,
.hamburger:hover {
  transform: translateY(-1px);
}

.sidebar__quick-link:hover {
  background: rgba(var(--brand-rgb), 0.08);
  color: var(--text);
  box-shadow: none;
}

.sidebar__quick-link.is-active {
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand-darker);
  box-shadow: 0 10px 24px rgba(var(--brand-rgb), 0.14);
}

.sidebar__quick-link--utility {
  color: rgba(var(--text-rgb), 0.72);
}

.sidebar__quick-link--utility:hover,
.sidebar__quick-link--utility.is-active {
  color: var(--text);
}

.sidebar__quick-link::after {
  content: '';
  position: absolute;
  left: -9px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.8);
  box-shadow: 0 0 12px rgba(var(--brand-rgb), 0.28);
  opacity: 0;
  transform: scaleY(0.45);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.sidebar__quick-link--active::after {
  opacity: 1;
  transform: scaleY(1);
}

.sidebar__quick-link-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  border: 0;
  box-shadow: 0 8px 16px rgba(var(--danger-rgb), 0.18);
}

.sidebar__quick-divider {
  display: none;
}

.sidebar__quick-item-group {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar__quick-submenu {
  position: absolute;
  bottom: -6px;
  left: calc(100% + 16px);
  width: 188px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(var(--surface-rgb), 0.98);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast);
  z-index: 30;
}

.sidebar__quick-submenu::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -20px;
  width: 20px;
  background: transparent;
}

.sidebar__quick-item-group--submenu:hover .sidebar__quick-submenu,
.sidebar__quick-item-group--submenu:focus-within .sidebar__quick-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.sidebar__quick-item-group--submenu:hover .sidebar__quick-link .sidebar__tooltip,
.sidebar__quick-item-group--submenu:focus-within .sidebar__quick-link .sidebar__tooltip {
  opacity: 0;
  visibility: hidden;
}

.sidebar__quick-submenu-item {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.sidebar__quick-submenu-item:hover {
  background: rgba(var(--brand-rgb), 0.08);
  color: var(--brand-dark);
}

.sidebar__quick-submenu-item.is-active {
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand-darker);
}

.sidebar__quick-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(var(--text-rgb), 0.08);
}

.sidebar__tooltip {
  position: absolute;
  top: 50%;
  left: calc(100% + 14px);
  transform: translateY(-50%) translateX(-6px);
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(var(--surface-rgb), 0.96);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast);
  z-index: 20;
}

.sidebar__tooltip::before {
  content: '';
  position: absolute;
  left: -5px;
  top: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(var(--surface-rgb), 0.96);
  transform: rotate(45deg);
}

@media (hover: hover) and (pointer: fine) {
  .sidebar__quick-brand:hover .sidebar__tooltip,
  .sidebar__quick-link:hover .sidebar__tooltip,
  .sidebar__quick-brand:focus-visible .sidebar__tooltip,
  .sidebar__quick-link:focus-visible .sidebar__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    transition-delay: 0s;
  }
}

.sidebar__quick-brand:focus-visible,
.sidebar__quick-link:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid rgba(var(--brand-rgb), 0.65);
  outline-offset: 3px;
}

.sidebar__quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar__quick-icon--theme {
  font-size: 18px;
  line-height: 1;
}

.sidebar__quick-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  padding: 18px 14px;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t);
}

.sidebar.is-desktop-open .sidebar__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 0s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: rgba(var(--surface-rgb), 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.brand__logo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.brand__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.brand__name {
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--brand-dark);
  font-size: 16px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(var(--surface-rgb), .65);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.profile__meta {
  flex: 1
}

.profile__name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text);
}

.profile__role {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--brand-rgb), 0.2) transparent;
}

.nav::-webkit-scrollbar {
  width: 4px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  background-color: rgba(var(--brand-rgb), 0.2);
  border-radius: 20px;
}

.nav::-webkit-scrollbar-thumb:hover {
  background-color: rgba(var(--brand-rgb), 0.4);
}

.nav__caption {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 14px 12px 6px;
  opacity: 0.7;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text);
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease);
}

.nav__icon {
  width: 24px;
  text-align: center;
  opacity: 0.9;
  font-size: 18px;
  /* Standardize icon size */
}

.nav__item:hover {
  background: rgba(var(--brand-rgb), .08);
  border-color: rgba(var(--brand-rgb), .16);
  color: var(--text);
}

.nav__item.is-active {
  background: rgba(var(--brand-rgb), .12);
  border-color: rgba(var(--brand-rgb), .18);
  color: var(--brand-darker);
  font-weight: 800;
}

.sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.small-muted {
  font-size: 12px;
  color: var(--muted)
}

/* Added for Client Portal Consistency */
.brand__sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.8;
}

/* FAB - Floating Action Button (Client Portal) */
.fab-qr {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.4);
  cursor: pointer;
  z-index: 2000;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 1024px) {
  .fab-qr {
    display: none !important;
  }
}

/* Pull-to-Refresh Styles (Client Portal) */
#ptr-indicator {
  position: fixed;
  top: -60px;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2005;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#ptr-indicator .ptr-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--primary, #6366f1);
  border-radius: 50%;
  animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================
   Membership Pass - MINIMAL PREMIUM CARD
   ============================================= */
/* =============================================
   Student Pass - APPLE WALLET GLASS (FINAL)
   ============================================= */
.student-pass {
  position: relative;
  width: 360px;
  max-width: 90vw;
  /* Enhanced Apple Glass: Lighter, more blur, subtle noise */
  background: rgba(30, 41, 59, 0.65);
  /* More translucent */
  backdrop-filter: blur(40px) saturate(200%);
  /* Stronger blur & saturation */
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  /* Slightly brighter border */
  border-radius: 32px;
  overflow: hidden;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  box-shadow:
    0 40px 80px -12px rgba(0, 0, 0, 0.6),
    /* Deeper shadow */
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  /* Stronger top highlight */
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  min-height: 580px;
  /* Increased height for mobile presence */
}

/* --- ZONE A: HEADER --- */
.pass-header {
  padding: 20px 20px 14px;
  /* Top spacing */
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: unset;
  flex-direction: row;
  margin-bottom: 0;
}

.pass-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pass-logo-box {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  /* Rounded 8px as requested */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.pass-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.pass-text-group {
  display: flex;
  flex-direction: column;
}

.pass-org-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.pass-label-sub {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  /* Subtitle opacity */
}

/* Status Pill */
.pass-status-pill {
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pass-status-pill.status-active {
  background: rgba(34, 197, 94, 0.15);
  /* Green accent bg */
  color: #4ade80;
  /* Green accent text */
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.pass-status-pill.status-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- ZONE B: MAIN BODY (QR) --- */
.pass-body {
  padding: 0 20px 16px;
  /* Side padding */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
}

.qr-block {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

/* Scanner Beam */
.qr-block::after,
#qrCodeContainer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(34, 197, 94, 0.7);
  /* Subtle green beam */
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6), 0 0 12px rgba(34, 197, 94, 0.4);
  pointer-events: none;
  animation: scan-beam 2.5s cubic-bezier(0.53, 0, 0.43, 0.99) infinite;
  opacity: 0.8;
  z-index: 10;
}

@keyframes scan-beam {
  0% {
    top: 0;
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  85% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Ensure canvas/img fits */
.qr-block canvas,
.qr-block img {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-instruction {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
  text-align: center;
}

/* --- ZONE C: INFO GRID (FOOTER) --- */
.pass-footer {
  padding: 0 20px 32px;
  /* Increased bottom padding */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.pass-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 20px 0 24px;
  /* Increased margins */
  width: 100%;
}

.pass-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 24px;
  /* Increased vertical gap */
  column-gap: 16px;
  align-items: baseline;
}

.pass-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.pass-field.right-align {
  align-items: flex-end;
  text-align: right;
}

.pass-label {
  font-size: 10px;
  /* 10-11px */
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  /* 0.65 opacity */
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.pass-value {
  font-size: 15px;
  /* 15-16px */
  font-weight: 600;
  /* Semibold */
  color: #fff;
  line-height: 1.3;
}

/* External Close Button (Bottom Center) */
.pass-close-external {
  margin-top: 16px;
  /* Moved up (closer to card) */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  /* Slightly lighter */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20002;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  position: static;
}

.pass-close-external:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

#qrModal .modal__dialog {
  overflow: visible !important;
  flex-direction: column !important;
  /* Stack card and button vertically */
}

/* Dark mode overrides */
html[data-theme='dark'] .student-pass {
  background: linear-gradient(to bottom, #0B1220 0%, #151e32 100%);
}

/* Main */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 20, 0.54);
  /* Slightly darker to compensate for lack of blur */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 110;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.is-active {
  display: block;
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.mobile-close-btn {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  background: rgba(var(--text-rgb), 0.04);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 12px;
  border: 1px solid rgba(var(--text-rgb), 0.08);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.2s ease;
}

.mobile-close-btn:active {
  transform: scale(0.9);
  background: rgba(var(--text-rgb), 0.1);
}

.modal--lg .modal__content {
  width: min(760px, 100%);
}

.modal--full .modal__dialog {
  padding: 0;
}

.modal--full .modal__content {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0;
  border: none;
}

.modal--full .modal__header {
  justify-content: space-between;
}

.modal--full .modal__title-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.modal--full .modal__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal--premium .modal__content {
  border-radius: 28px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.main-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

.main-shell__topbar {
  position: relative;
  z-index: 2;
}

.main-shell__content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  height: max(var(--topbar-h), calc(var(--topbar-h) + var(--safe-area-inset-top)));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: max(12px, var(--safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 50;
}

.hamburger {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(var(--text-rgb), 0.08);
  background: rgba(var(--surface-rgb), 0.82);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

.hamburger:hover {
  background: rgba(var(--brand-rgb), 0.1);
  border-color: var(--brand);
  color: var(--text);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.12);
}

.hamburger[aria-expanded="true"] {
  background: rgba(var(--brand-rgb), 0.12);
  border-color: rgba(var(--brand-rgb), 0.22);
  color: var(--brand-darker);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(550px, 85vw);
  background: rgba(255, 255, 255, .70);
  border: 1px solid var(--border);
  border-radius: 999px;
  /* Position relative ensures autocomplete suggestions list positions relative to the search container */
  position: relative;
  padding: 8px 12px;
  box-shadow: 0 6px 18px rgba(17, 24, 39, .05);
}

/* Dark mode overrides for global search */
html[data-theme='dark'] .search {

  border-color: rgba(255, 255, 255, 0.14);

}

html[data-theme='dark'] .search .ac__list {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] .search .ac__item:hover {
  background: rgba(139, 92, 246, 0.20);
}

html[data-theme='dark'] .search .ac__item.is-active {
  background: rgba(139, 92, 246, 0.28);
}

html[data-theme='dark'] .search .ac__name {
  color: var(--text);
}

html[data-theme='dark'] .search .ac__meta {
  color: var(--muted);
}

.search__icon {
  opacity: .55
}

.search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: var(--text-md);
}

/* Global search autocomplete list */
.search .ac__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 24px rgba(17, 24, 39, .08);
  padding: 4px;
  z-index: 200;
  display: none;
}

.search .ac__item {
  padding: 6px 10px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background .15s;
}

.search .ac__item:hover {
  background: rgba(139, 92, 246, .08);
}

.search .ac__item.is-active {
  background: rgba(139, 92, 246, .12);
}

.search .ac__name {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search .ac__meta {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.search .ac__tags {
  display: flex;
  gap: 6px;
}

.search .ac__tag {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #6B21A8;
  text-transform: uppercase;
}

.search .ac__btn-create {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #6366f1;
  color: #fff;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  transition: all 0.2s;
}

.pulse-dot-green {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.search .ac__list.is-visible {
  display: block;
}

/* Filter buttons (members page) */
.filters {
  display: flex;
  gap: 8px;
  /* Add space above filters so they don't touch the surrounding container */
  margin-top: 8px;
  margin-bottom: 12px;
  /* Align filters with the container padding (20px) */
  margin-left: 20px;
}

.filter-bar {
  background: var(--surface);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.filter-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filters .btn--filter {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(var(--brand-rgb), .18);
  background: rgba(var(--brand-rgb), .10);
  color: var(--brand-darker);
  font-weight: 700;
  transition: background .15s, color .15s;
}

.filters .btn--filter:hover {
  background: rgba(var(--brand-rgb), .18);
}

.filters .btn--filter.is-active {
  background: linear-gradient(135deg, var(--pink1), var(--pink2));
  border-color: rgba(var(--brand-rgb), .2);
  color: #fff;
}

/* Buttons in payments cards */
.payments-kpis .card .btn--ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}

.payments-kpis .card .btn--ghost:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .34);
}

/* Notification badge positioning and style */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid var(--surface);
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
  pointer-events: none;
  z-index: 10;
}

.notif-badge.is-hidden {
  display: none !important;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Push icon group to the far right of the top bar */
  margin-left: auto;
}

/* Icon buttons (like notifications, fullscreen) should be relative to hold positioned badges */
.icon-btn {
  position: relative;
}

.nav__badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav__badge--warning {
  background: var(--warning);
}

/* Client Portal user avatar in topbar */
.client-profile__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
}

.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .65);
  cursor: pointer;
}

.userchip__avatar {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: var(--text);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.userchip__name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.content {
  padding: 8px 20px 24px
}

@media (min-width: 1025px) {
  .app {
    background:
      radial-gradient(circle at top left, rgba(var(--brand-rgb), 0.08), transparent 26%),
      linear-gradient(180deg, rgba(var(--text-rgb), 0.02), rgba(var(--text-rgb), 0.035)),
      var(--bg) !important;
  }

  .sidebar {
    top: 12px;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    margin: 12px 0 12px 12px;
    border-radius: 32px;
    border: 0;
    box-shadow: none;
  }

  .sidebar__quick-nav {
    top: 20px;
    left: 17px;
    bottom: 20px;
  }

  .sidebar__quick-links--primary {
    padding: 26px 0 18px;
  }

  .sidebar__quick-links--utility {
    padding-bottom: 14px;
  }

  .sidebar__quick-footer {
    padding-top: 16px;
  }

  .sidebar__panel {
    padding: 18px 16px 18px 20px;
  }

  .main {
    padding: 12px 14px 12px 12px;
    overflow: hidden;
  }

  .main.main--shellless {
    padding: 0;
    overflow: visible;
  }

  .main-shell {
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    min-height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.98), rgba(var(--surface-rgb), 0.94));
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  .main-shell::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 31px;
    border: 1px solid rgba(var(--surface-rgb), 0.45);
    box-shadow: inset 0 1px 0 rgba(var(--surface-rgb), 0.4);
    pointer-events: none;
    opacity: 0.7;
    z-index: 1;
  }

  .main.main--shellless .main-shell {
    height: auto;
    min-height: 0;
    max-height: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .main.main--shellless .main-shell::before {
    display: none;
  }

  .main-shell__content {
    padding: 10px 18px 26px;
    overflow: hidden;
  }

  .main.main--shellless .main-shell__content {
    padding: 0;
  }

  .topbar {
    background: transparent;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
  }

  .content {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 8px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--brand-rgb), 0.22) transparent;
  }

  .content::-webkit-scrollbar {
    width: 10px;
  }

  .content::-webkit-scrollbar-track {
    background: transparent;
  }

  .content::-webkit-scrollbar-thumb {
    background: rgba(var(--brand-rgb), 0.18);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
  }

  .content::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--brand-rgb), 0.28);
    background-clip: content-box;
  }

  .main.main--shellless .content {
    padding: 8px 20px 24px;
    overflow: visible;
  }
}

/* Page head */
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pagehead__left {
  flex: 1;
  min-width: 300px;
}

.pagehead__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.h1 {
  margin: 10px 0 0;
  font-size: 26px;
  letter-spacing: -.03em
}

.h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.02em
}

.muted {
  color: var(--muted);
  margin: 8px 0 0
}

/* Modal Tabs UI */
.modal-tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  margin: 0 -24px 20px -24px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.modal-tabs::-webkit-scrollbar {
  display: none;
}

.modal-tab {
  padding: 14px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  white-space: nowrap;
}

.modal-tab:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 10px 10px 0 0;
  opacity: 0;
  transform: translateY(1px);
  transition: all 0.2s;
}

.modal-tab.is-active {
  color: var(--primary);
}

.modal-tab.is-active:after {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .modal-tabs {
    padding: 0 20px;
    margin: 0 -20px 16px -20px;
  }

  .modal-tab {
    padding: 16px 12px;
    font-size: 14px;
    /* slightly larger for touch */
  }

  .modal--full .modal__header {
    padding: 16px 20px;
  }
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.is-active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-rgb), .18);
  background: rgba(var(--brand-rgb), .10);
  color: var(--brand-darker);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 8px;
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .18);
}

/* Grid */
.grid {
  display: grid;
  gap: 16px
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr))
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr))
}

.grid--profile {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
}

/* Standard section spacing (helps card grids stay consistent) */
.section {
  margin: 16px 0
}

/* Dropdown (table actions) */
.dropdown {
  position: relative;
  display: inline-flex;
  justify-content: flex-end
}

.dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.dropdown__caret {
  font-size: 12px;
  opacity: .7;
  transform: translateY(1px)
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100px;
  max-width: 200px;
  width: max-content;
  padding: 4px;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), .92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 40;
}

.dropdown.is-open .dropdown__menu {
  display: block;
  animation: dd-slide 0.2s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes dd-slide {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: #111827;
  background: transparent;
  border: none;
  text-decoration: none;
  cursor: pointer;
}

.dropdown__item:hover {
  background: rgba(var(--brand-rgb), .10)
}

.dropdown__item--danger {
  color: var(--danger)
}

.dropdown__item--danger:hover {
  background: rgba(239, 68, 68, .10)
}

.dropdown__sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px
}

@media (max-width: 1100px) {
  :root {
    --sidebar-w: 250px;
  }

  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 1001;
    height: var(--topbar-h);
    height: max(var(--topbar-h), calc(var(--topbar-h) + var(--safe-area-inset-top)));
    padding: 0 16px;
    padding-top: max(0px, var(--safe-area-inset-top));
    display: flex !important;
    align-items: center;
    justify-content: space-between !important;
    background: var(--surface) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid var(--border);
  }

  .hamburger {
    display: none;
    order: -1;
    color: var(--text);
  }

  .topbar .search {
    display: none !important;
  }

  /* Centered Floating Search - Premium Dark Style */
  .search.js-global-search {
    position: fixed !important;
    bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(420px, calc(100% - 32px)) !important;
    height: 60px !important;
    background: #1e293b !important;
    /* Solid background for performance */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 30px !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
    z-index: 10000 !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
  }

  .search.js-global-search .search__icon {
    color: #ffffff !important;
    opacity: 0.8;
  }

  .search.js-global-search .control {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 16px !important;
    height: 100% !important;
    width: 100% !important;
    padding: 0 0 0 10px !important;
    font-weight: 500 !important;
  }

  .search.js-global-search .control::placeholder {
    color: var(--muted) !important;
    opacity: 0.7 !important;
  }

  .search.js-global-search:focus-within {
    bottom: calc(30px + env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) scale(1.02) !important;
  }

  .search.js-global-search .ac__list {
    top: auto !important;
    bottom: calc(100% + 12px) !important;
    width: 100% !important;
    background: var(--surface) !important;
    border-radius: 24px !important;
    box-shadow: 0 -15px 45px rgba(0, 0, 0, 0.3) !important;
    max-height: 40vh !important;
  }

  /* Member Profile & General Layout Fixes */
  .pagehead {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px !important;
  }

  .pagehead__left {
    min-width: 0 !important;
  }

  .pagehead__right {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    grid-template-columns: none !important;
    /* Override current grid if any */
  }

  .pagehead__right .btn,
  .pagehead__right form,
  .pagehead__right form .btn {
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
  }

  .h1 {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 24px !important;
  }

  .grid--profile {
    grid-template-columns: 1fr !important;
  }

  .member-kv {
    margin-bottom: 12px;
  }

  /* PT Summary (Member Profile) */
  .pt-summary {
    display: flex;
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .pt-summary__card {
    width: 100% !important;
    padding: 16px !important;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .pt-summary__label {
    margin-bottom: 6px !important;
    font-size: 11px !important;
    opacity: 0.7;
  }

  .pt-summary__value {
    font-size: 22px !important;
    font-weight: 800;
  }

  /* Calendar summary grid - FORCE 3x2 on mobile */
  .panel__body .cal-summary-grid.grid--3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 10px !important;
    justify-content: center !important;
    width: 100% !important;
    margin-bottom: 20px !important;
  }

  .cal-summary-grid .card {
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 12px 8px !important;
    min-height: 70px !important;
  }

  /* Calendar Header Refinements */
  .cal-header {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 20px 16px !important;
  }

  .cal-header__title-row {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .cal-title {
    font-size: 20px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .cal-nav {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .cal-btn-prev,
  .cal-btn-next {
    flex: 0 0 auto !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
  }

  .cal-month-pill {
    flex: 1 !important;
    text-align: center !important;
    margin: 0 !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
    white-space: nowrap !important;
  }

  /* Table Card & Overflow Fixes */
  .table-card {
    margin: 0 !important;
    width: 100% !important;
    overflow-x: auto !important;
    border-radius: 12px !important;
    /* Keep it rounded on mobile for cleaner look */
  }

  /* Cleaner Closing */
  .content>.panel:last-child,
  .content>.section:last-child {
    margin-bottom: 80px !important;
    padding-bottom: 40px !important;
  }

  .day-summary {
    padding-bottom: 20px;
  }

  .section-title {
    font-size: 14px !important;
  }
}

/* PT Summary Desktop Styles */
.pt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 24px;
}

.pt-summary__card {
  background: var(--bg);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  min-width: 160px;
}

.pt-summary__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  opacity: 0.7;
  font-weight: 600;
}

.pt-summary__value {
  font-size: 18px;
  font-weight: 800;
}

.pt-summary__value--success {
  color: var(--success);
}

.pt-summary__meta {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.6;
}


/* Global Styles (Desktop) */
.search.js-global-search {
  position: relative;
  top: auto;
  left: auto;
  width: min(560px, 100%);
  max-width: 100%;
  min-height: 56px;
  background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.88), rgba(var(--surface-rgb), 0.82));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  box-shadow: 0 10px 24px rgba(var(--text-rgb), 0.04);
  z-index: 8;
}

.topbar__left .search.js-global-search {
  flex: 0 1 560px;
  margin: 0;
}

.search.js-global-search .control {
  height: 54px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.search.js-global-search .search__icon {
  font-size: 18px;
  margin-right: 12px;
  color: var(--muted);
  opacity: 0.76;
}

.search.js-global-search .search__kbd {
  margin-left: 12px;
  flex-shrink: 0;
}

.search.js-global-search .ac__list {
  position: absolute;
  top: calc(100% + 10px);
  bottom: auto;
  left: 0;
  right: 0;
  background: rgba(var(--surface-rgb), 0.98);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 8px;
  animation: slideDownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search.js-global-search .ac__list.is-visible {
  display: block !important;
}

.search.js-global-search .ac__item {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 2px;
  transition: all 0.2s ease;
}

.search.js-global-search .ac__item:last-child {
  margin-bottom: 0;
}

.search.js-global-search .ac__item:hover,
.search.js-global-search .ac__item.is-active {
  background: rgba(var(--brand-rgb), 0.08);
  color: var(--brand-dark);
}

.search.js-global-search .ac__name {
  font-size: 14px;
  font-weight: 600;
}

.search.js-global-search .ac__meta {
  font-size: 11px;
  opacity: 0.7;
}

.search.js-global-search .ac__item {
  align-items: center;
}

.search.js-global-search .ac__tag {
  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  height: auto;
  border: none;
}

.search.js-global-search .ac__tag::before {
  display: none;
}

/* Also for mobile search overlay */
.admin-search-overlay .ac__tag::before {
  display: none;
}



.content {
  padding: 8px 18px 24px
}

@media (max-width: 600px) {

  .grid--4,
  .grid--profile,
  .grid--3:not(.cal-summary-grid),
  .grid--2 {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .drawer-section .muted,
  .drawer-section__head .muted,
  .cal-mobile-nav .muted {
    display: none !important;
  }

  .card {
    min-height: auto !important;
    padding: 16px !important;
  }

  .card__value {
    font-size: 24px !important;
  }

  .filter-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .filter-form>.field,
  .filter-form>div {
    width: 100% !important;
    margin: 0 !important;
  }

  .filter-bar .btn {
    width: 100% !important;
  }

  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-w));
    top: 0;
    bottom: 0;
    height: 100dvh;
    z-index: 10001;
    /* Above search bar */
    transition: left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
  }

  .sidebar.is-open {
    left: 0;
  }

  /* Tap feedback for mobile */
  .btn:active,
  .nav__item:active,
  .hamburger:active {
    transform: scale(0.96);
    opacity: 0.8;
  }

  .content {
    padding: 16px !important;
    padding-bottom: 120px !important;
    /* Space for fixed search bar */
  }

  .pagehead__right {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .pagehead__right .btn {
    width: 100% !important;
    justify-content: center;
  }

  .table-card {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    width: calc(100% + 32px);
    border-radius: 0;
  }

  table {
    font-size: 13px !important;
  }

  th,
  td {
    padding: 12px 10px !important;
  }

  .table-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  .member-kv {
    background: var(--bg);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
  }

  .kv-label {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    opacity: 0.7;
  }

  .kv-value {
    font-size: 15px !important;
    font-weight: 700 !important;
  }

  .pagehead .muted {
    display: none !important;
  }

  .table-tools {
    width: 100%;
  }

  .table-tools .input {
    width: 100%;
  }

  .table-tools .control {
    width: 100%;
  }

  /* Settings Page responsive */
  .settings-layout {
    flex-direction: column !important;
    min-height: auto !important;
  }

  .settings-nav {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    flex-direction: row !important;
    overflow-x: auto;
    padding: 12px !important;
    white-space: nowrap;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .settings-nav__item {
    padding: 10px 16px !important;
    width: auto !important;
    justify-content: center !important;
    flex-shrink: 0;
  }

  /* Calendar mobile tweaks - Hide month grid, show day view */
  .cal--premium {
    display: none !important;
  }

  .cal-mobile-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .cal-mobile-content {
    display: block !important;
    min-height: 200px;
  }

  .table-head .muted {
    display: none;
  }

  .filter-bar form {
    flex-direction: column;
    align-items: stretch !important;
  }

  .filter-bar .field {
    width: 100% !important;
    min-width: 0 !important;
  }
}

.cal-mobile-nav {
  display: none;
}

.cal-mobile-content {
  display: none;
}

@media (max-width: 600px) {
  .h1 {
    font-size: 22px !important;
  }

  .h2 {
    font-size: 18px !important;
  }

  .h3 {
    font-size: 15px !important;
  }

  .badge {
    padding: 6px 10px;
    font-size: 11px;
  }

  .member-kv {
    margin-bottom: 8px;
  }
}

/* Dashboard cards */
.card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 18px 18px;
  overflow: hidden;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  min-height: 138px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  background: var(--surface);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--brand-rgb), 0.3);
}

/* Notifications dropdown menu styles */
.notifications-menu {
  min-width: 240px;
  max-width: 320px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

@media (max-width: 600px) {
  .dropdown__menu.notifications-menu {
    position: fixed;
    top: 64px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: translateY(-5px);
    /* The hover/open animation handles the rest */
  }
}

.notifications-menu .notifications__header {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: var(--text-md);
}

.notifications-menu .notifications__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notifications-menu .notifications__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--text);
  transition: background .15s;
}

.notifications-menu .notifications__item:hover {
  background: rgba(var(--brand-rgb), .08);
}

.notifications-menu .notifications__item .label {
  color: var(--text);
  flex: 1;
}

.notifications-menu .notifications__item .count {
  font-weight: 600;
  color: var(--brand);
  flex: 0 0 auto;
  min-width: 32px;
  text-align: right;
}

/* User dropdown menu styles */
.user-menu {
  min-width: 200px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.user-menu__header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu__name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.user-menu__email {
  font-size: 11px;
  color: var(--muted);
}

.user-menu__item {
  display: block;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--text);
  transition: background .15s;
}

.user-menu__item:hover {
  background: rgba(var(--brand-rgb), .08);
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.card__title {
  font-weight: 800;
  opacity: .92;
  -webkit-user-select: none;
  user-select: none;
}

.card__value {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-top: 12px
}

.card__sub {
  opacity: .92;
  margin-top: 8px;
  font-size: 13px
}

.card__bg {
  position: absolute;
  inset: -40px -60px auto auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(var(--surface-rgb), .18);
}

.card--grad {
  background: linear-gradient(135deg, rgba(var(--surface-rgb), .0), rgba(var(--surface-rgb), .0));
  color: #fff;
}

.card--grad.card--pink {
  background: linear-gradient(135deg, var(--pink1), var(--pink2));
}

.card--grad.card--blue {
  background: linear-gradient(135deg, var(--blue1), var(--blue2));
}

.card--grad.card--green {
  background: linear-gradient(135deg, var(--green1), var(--green2));
}

.card--grad.card--orange {
  background: linear-gradient(135deg, #FFD89B, var(--orange));
}

.card--premium {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-darker) 100%) !important;
  color: #ffffff !important;
  border: none !important;
  position: relative;
  overflow: hidden;
}

.card--premium .card__header,
.card--premium .card__title {
  color: #ffffff !important;
  border-bottom-color: rgba(var(--surface-rgb), 0.1) !important;
}

.revenue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.revenue-item {
  padding: 0 12px;
  border-right: 1px solid rgba(var(--surface-rgb), 0.1);
}

.revenue-item:last-child {
  border-right: none;
}

.revenue-label {
  color: rgba(var(--surface-rgb), 0.7);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.revenue-value {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
}

.revenue-growth {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(var(--surface-rgb), 0.15);
  backdrop-filter: blur(4px);
}

@media (max-width: 900px) {
  .revenue-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .revenue-item {
    border-right: none;
    border-bottom: 1px solid rgba(var(--surface-rgb), 0.1);
    padding: 0 0 24px 0;
  }

  .revenue-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

.card--pink {
  background: linear-gradient(135deg, var(--pink1), var(--pink2));
}

.card--blue {
  background: linear-gradient(135deg, var(--blue1), var(--blue2));
}

.card--green {
  background: linear-gradient(135deg, var(--green1), var(--green2));
}

.card--orange {
  background: linear-gradient(135deg, #FFD89B, #F97316);
}

/* Dark mode override for orange card */
html[data-theme='dark'] .card--orange {
  background: linear-gradient(135deg, #9A3412, #EA580C);
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .22);
  font-weight: 900;
  font-size: 12px;
}

.pill--warn {
  background: rgba(17, 24, 39, .14);
  border-color: rgba(255, 255, 255, .18)
}

.is-unread {
  background: rgba(var(--brand-rgb), 0.05) !important;
  font-weight: 600;
}

.is-unread:hover {
  background: rgba(var(--brand-rgb), 0.08) !important;
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
}

.is-read.muted {
  opacity: 0.6;
}

/* Panels */
.panel {
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 24px rgba(17, 24, 39, .06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Dark mode adjustments for panels */
html[data-theme='dark'] .panel {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.panel__head {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.panel__body {
  padding: 12px 14px
}

/* Payments overview cards: add subtle tint so the page isn't too "white" */
.payments-kpis .panel {
  background:
    radial-gradient(1200px 240px at 15% 0%, rgba(139, 92, 246, 0.14), rgba(255, 255, 255, 0.78) 55%),
    rgba(255, 255, 255, 0.78);
}

/* Colored panels for Payments overview (match dashboard card colors) */
.payments-kpis .panel--pink,
.payments-kpis .panel--blue,
.payments-kpis .panel--green {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.payments-kpis .panel--pink {
  background: linear-gradient(135deg, var(--pink1), var(--pink2));
}

.payments-kpis .panel--blue {
  background: linear-gradient(135deg, var(--blue1), var(--blue2));
}

.payments-kpis .panel--green {
  background: linear-gradient(135deg, var(--green1), var(--green2));
}

/* Ensure text and links inside colored panels remain readable */
.payments-kpis .panel--pink a,
.payments-kpis .panel--blue a,
.payments-kpis .panel--green a {
  color: #fff;
  text-decoration: underline;
}

.payments-kpis .panel--pink .muted,
.payments-kpis .panel--blue .muted,
.payments-kpis .panel--green .muted {
  color: rgba(255, 255, 255, 0.9);
}

.payments-kpis .panel--pink .bullets li,
.payments-kpis .panel--blue .bullets li,
.payments-kpis .panel--green .bullets li {
  color: #fff;
}


.legend {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block
}

.dot--p {
  background: var(--brand)
}

.dot--r {
  background: var(--danger)
}

.dot--b {
  background: #38BDF8
}

.dot--g {
  background: var(--success)
}

/* Donut + list */
.donut-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-center__num {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.02em
}

.donut-center__txt {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px
}

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

.list__row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(var(--surface-rgb), .65);
}

.list__label {
  color: #111827;
  font-weight: 700;
  font-size: 13px
}

.list__value {
  color: var(--muted);
  font-weight: 900;
  font-size: 13px
}

/* Simple bullet list for summary cards */
.bullets {
  margin: 10px 0 0 18px;
  padding: 0;
  list-style: disc;
  color: var(--text);
}

.bullets li {
  margin: 0 0 6px;
  color: var(--text);
}

.bullets__link {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.bullets__link:hover {
  text-decoration: underline;
}

/* Auth */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
}

.auth-card {
  width: min(420px, 92vw);
  background: rgba(255, 255, 255, .80);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 40px rgba(17, 24, 39, .12);
  padding: 18px;
}

.auth-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px
}

.auth-title {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.02em
}

.alert {
  padding: 16px 20px;
  border-radius: 16px;
  font-weight: 600;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert--danger,
.alert {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.alert--success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
  color: #065f46;
}

.alert--warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.15);
  color: #92400e;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Autocomplete */
.ac {
  position: relative;
}

.ac__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .12);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  display: none;
  z-index: 10060;
}

.ac.is-open .ac__list {
  display: block;
}

.ac__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ac__item:hover {
  background: rgba(var(--brand-rgb), 0.08);
}

.ac__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 2px;
}

.ac__meta {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

.ac__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.15);
  color: #166534;
  white-space: nowrap;
  height: 26px;
}

.ac__tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.ac__tag--inactive {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.ac__tag--inactive::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Check-in modal alignment */
#modal-checkin-create .form--2 .control {
  width: 100%;
  height: 44px;
}

#modal-checkin-create .field {
  align-content: start;
}

/* Ensure the 'Add Member' modal in groups has enough height for autocomplete results */
#modal-group-add-member .modal__body {
  min-height: 400px;
}




/* Actions alignment v3 */
.table td.actions-cell {
  white-space: nowrap;
  text-align: right;
}

.table tbody tr.table__row--primary-action {
  cursor: pointer;
}

.table tbody tr.table__row--primary-action:hover td {
  background: rgba(var(--brand-rgb), 0.04);
}

.table tbody tr.table__row--primary-action:focus-visible {
  outline: 2px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: -2px;
}

.actions {
  gap: 8px;
}

.actions .btn {
  height: 36px;
  padding: 0 12px;
}

.actions .btn--sm {
  height: 36px;
  padding: 0 12px;
}

.actions .btn--info {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.actions .btn--info:hover {
  background: rgba(34, 197, 94, 0.14);
}


/* Member profile contrast v3 */
.member-kv {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.member-kv .kv-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.member-kv .kv-value {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.member-kv .kv-value--muted {
  color: var(--muted);
  font-weight: 800;
}

.member-note {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  min-height: 88px;
}

.pill {
  color: rgba(17, 24, 39, 0.88);
}


/* Member headings + pills v5 */
.section-title {
  color: rgba(17, 24, 39, 0.92);
  font-weight: 950;
  font-size: 13px;
  letter-spacing: .02em;
  margin: 0 0 10px 0;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(var(--brand-rgb), 0.10);
  border: 1px solid rgba(var(--brand-rgb), 0.18);
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
}

.stat-pill__label {
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.stat-pill__value {
  color: var(--brand-darker);
  font-weight: 950;
}

.group-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 950;
  font-size: 13px;
  text-decoration: none;
}

.note-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
}

.note-form textarea.control {
  min-height: 96px;
  resize: vertical;
}

.note-form .btn {
  height: 40px;
}


/* Icon close button v6 */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
  transition: all var(--t-fast) var(--ease);
  position: relative;
}

.icon-btn:hover {
  background: rgba(var(--brand-rgb), 0.10);
  border-color: rgba(var(--brand-rgb), 0.20);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0px) scale(.98);
}


/* Attendance calendar v6 */
.cal {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.cal__row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal__row--head .cal__cell {
  background: var(--surface-2);
  font-weight: 950;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
}

.cal__cell {
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  min-height: 140px;
  position: relative;
}

.cal__row .cal__cell:last-child {
  border-right: 0;
}

.cal__cell--empty {
  background: var(--surface-2);
  opacity: 0.5;
}

.cal__cell--day {
  background: var(--surface);
  width: 100%;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.cal__cell--day:hover {
  background: rgba(var(--brand-rgb), 0.04);
}

.cal__cell--today {
  box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), 0.22);
}

.cal__day--active {
  background:
    radial-gradient(120px 120px at 20% 20%, rgba(var(--brand-rgb), 0.12), transparent 60%),
    radial-gradient(160px 160px at 80% 80%, rgba(var(--brand-rgb), 0.08), transparent 65%),
    var(--surface);
}

.cal__day--active:hover {
  background:
    radial-gradient(120px 120px at 20% 20%, rgba(var(--brand-rgb), 0.16), transparent 60%),
    radial-gradient(160px 160px at 80% 80%, rgba(var(--brand-rgb), 0.10), transparent 65%),
    var(--surface);
}

.pill--soft {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.18);
  color: rgba(17, 24, 39, 0.88);
}

.cal__daynum {
  font-weight: 950;
  color: rgba(17, 24, 39, 0.82);
  font-size: 12px;
}

.cal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  border: 1px solid transparent;
}

.cal-chip--purple {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.18);
  color: rgba(17, 24, 39, 0.88);
}

.cal-chip--blue {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.18);
  color: rgba(17, 24, 39, 0.88);
}

.cal-chip--green {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.18);
  color: rgba(17, 24, 39, 0.88);
}

.cal-chip--orange {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.22);
  color: #92400e;
}

/* Dark mode overrides for chips (calendar chips, group pills, generic chips) */
html[data-theme='dark'] .cal-chip--purple {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.40);
  color: #d8b4fe;
}

html[data-theme='dark'] .cal-chip--blue {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.40);
  color: #93c5fd;
}

html[data-theme='dark'] .cal-chip--green {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

/* Premium Calendar Dark Mode Overrides */
html[data-theme='dark'] .cal--premium {
  background: rgba(0, 0, 0, 0.2);
}

html[data-theme='dark'] .cal--premium .cal__row--head .cal__cell {
  color: #94a3b8;
}

html[data-theme='dark'] .cal-day {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* QR Scanner Premium Styles */
#reader {
  width: 100% !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: #000 !important;
  border: 1px solid var(--border) !important;
}

#reader video {
  border-radius: 12px;
}

html[data-theme='dark'] .cal-day:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: #243147;
}

html[data-theme='dark'] .cal-day.is-today {
  border-color: var(--brand);
  background: rgba(139, 92, 246, 0.1);
}

html[data-theme='dark'] .cal-day__num {
  color: #f3f4f6;
}

html[data-theme='dark'] .cal-chip {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

html[data-theme='dark'] .cal-chip--muted {
  background: rgba(255, 255, 255, 0.08);
  /* Slightly brighter */
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Fix visibility of generic chips in dark mode */
html[data-theme='dark'] .chip:not(.chip--status) {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.35);
  color: #ffffff !important;
}

/* Force white text on group pills in drawer specifically */
html[data-theme='dark'] .drawer__body .group-pill {
  color: #ffffff !important;
}

/* Fix readable text for "No activity" or empty states in drawer */
html[data-theme='dark'] .drawer__body .muted,
html[data-theme='dark'] .drawer__body .empty-state,
html[data-theme='dark'] .drawer__body .muted-text {
  color: rgba(255, 255, 255, 0.65) !important;
  /* Brighter to be readable */
  font-weight: 500;
}

/* Headers in drawer need to be very white */
html[data-theme='dark'] .drawer-section__title {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 800;
}




/* Generic chip overrides */
html[data-theme='dark'] .chip {
  background: rgba(107, 114, 128, 0.25);
  border-color: rgba(107, 114, 128, 0.40);
  color: var(--text);
}

html[data-theme='dark'] .chip--green {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.40);
  color: #86efac;
}

html[data-theme='dark'] .chip--purple {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.40);
  color: #d8b4fe;
}

html[data-theme='dark'] .chip--blue {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.40);
  color: #93c5fd;
}

/* =========================
   Member notes (better UI)
   ========================= */
.note-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
}

.note-form__field {
  flex: 1;
}

.note-form textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 14px 16px;
  /* gives air so placeholder isn't glued to top */
  line-height: 1.35;
  border-radius: 14px;
}

.note-form .btn {
  white-space: nowrap;
}

.note-form .btn--primary {
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
}

.note-form textarea::placeholder {
  opacity: .7;
}

/* =========================
   Quick stats chips visibility
   ========================= */
.quick-stats .group-pill {
  background: rgba(124, 77, 255, 0.14);
  color: #3b2bbf;
  border: 1px solid rgba(124, 77, 255, 0.18);
}

.quick-stats .group-pill strong {
  color: #2a1aa3;
}


/* ================================
   Attendance calendar premium v9
   ================================ */
.cal--premium {
  padding: 12px;
  background: rgba(17, 24, 39, 0.02);
  border-radius: 18px;
}

.cal--premium .cal__row--head .cal__cell {
  background: transparent;
  border: 0;
  padding: 10px 8px 14px;
  font-weight: 950;
  color: rgba(17, 24, 39, 0.58);
}

.cal-day {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  min-height: 165px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.cal-day:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.12);
}

.cal-day.is-today {
  border-color: var(--brand);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.15);
  border-width: 2px;
  z-index: 2;
}

.cal-day.is-selected {
  border-color: var(--brand);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
  transform: scale(1.02);
  z-index: 3;
}

html[data-theme='dark'] .cal-day.is-today {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--brand);
}

html[data-theme='dark'] .cal-day.is-selected {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--brand-2);
}

.cal-day__top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
}

.cal-day__num {
  font-weight: 950;
  color: rgba(17, 24, 39, 0.86);
  font-size: 12px;
}

.cal-day__chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  width: 100%;
}

.cal-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  width: 100%;
}

.cal-chip--muted {
  background: rgba(17, 24, 39, 0.05);
  border-color: rgba(17, 24, 39, 0.08);
  color: rgba(17, 24, 39, 0.55);
}

.cal-chip--purple {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.18);
}

.cal-chip--green {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.18);
}

.cal-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.cal-pill--blue {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.18);
  color: rgba(17, 24, 39, 0.86);
}

/* Drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.drawer.is-open {
  display: block;
}

.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(520px, 92vw);
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: -20px 0 50px rgba(17, 24, 39, 0.18);
  transform: translateX(12px);
  animation: drawerIn .16s ease forwards;
  display: flex;
  flex-direction: column;
}

@keyframes drawerIn {
  from {
    transform: translateX(24px);
    opacity: .6;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer__header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.drawer__title {
  font-weight: 950;
  font-size: 16px;
  color: rgba(17, 24, 39, 0.88);
}

.drawer__body {
  padding: 14px 16px;
  overflow: auto;
  flex: 1;
}

.drawer__footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(17, 24, 39, 0.02);
}

/* Day drawer content */
.day-summary {

  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
}

.day-summary__title {
  font-weight: 950;
  font-size: 18px;
  color: rgba(17, 24, 39, 0.88);
  margin-top: 6px;
}

.day-summary__stats {
  display: flex;
  gap: 10px;
}

.kpi {
  width: 110px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(17, 24, 39, 0.02);
}

.kpi__value {
  font-weight: 950;
  font-size: 18px;
  color: rgba(17, 24, 39, 0.88);
}

.kpi__label {
  font-size: 12px;
  font-weight: 800;
  color: rgba(17, 24, 39, 0.55);
}

.drawer-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
}

.drawer-section__title {
  font-weight: 950;
  color: rgba(17, 24, 39, 0.84);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-card {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
  padding: 12px;
}

.session-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.session-card__title {
  font-weight: 950;
  color: rgba(17, 24, 39, 0.86);
  margin-top: 8px;
}

.session-card__sub {
  margin-top: 6px;
}

.session-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(17, 24, 39, 0.02);
  color: rgba(17, 24, 39, 0.82);
}

.chip--green {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.18);
}

.chip--purple {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.18);
}

.chip--blue {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.18);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  overflow: hidden;
  margin-top: 12px;
}

.progress__bar {
  height: 100%;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.55);
}

.session-card__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.btn--sm {
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
}

.attendees {
  margin-top: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  padding-top: 10px;
}

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

.attendee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.02);
}

.attendee-row__name {
  font-weight: 900;
  color: rgba(17, 24, 39, 0.82);
}

.empty-state {
  padding: 14px;
  border: 1px dashed rgba(17, 24, 39, 0.18);
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.02);
  color: rgba(17, 24, 39, 0.62);
  font-weight: 800;
}

/* Dashboard calendar: subtle purple tint in active days */
.cal-day.has-activity {
  background:
    radial-gradient(140px 140px at 18% 20%, rgba(124, 58, 237, 0.12), transparent 60%),
    radial-gradient(180px 180px at 85% 85%, rgba(124, 58, 237, 0.08), transparent 65%),
    rgba(255, 255, 255, 0.72);
}

.cal-day.has-activity:hover {
  background:
    radial-gradient(140px 140px at 18% 20%, rgba(124, 58, 237, 0.16), transparent 60%),
    radial-gradient(180px 180px at 85% 85%, rgba(124, 58, 237, 0.10), transparent 65%),
    rgba(255, 255, 255, 0.78);
}

/* Fullscreen mode: CSS-based (not using browser API). When .app--fullscreen is applied
   to the .app container, it fills the viewport and hides scrollbars. */
.app--fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg) !important;
  z-index: 9999;
}


/* Anchor highlight (used by Global Search deep links like #pt-123, #gs-45, #payment-9) */
.is-anchor-hit td,
.is-anchor-hit {
  background: rgba(139, 92, 246, 0.10) !important;
}

.is-anchor-hit {
  box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.28);
  transition: box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

/* ================================
   Dark mode readability fixes (v10)
   ================================ */

/* Sidebar */
html[data-theme='dark'] .sidebar {
  background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.96), rgba(var(--surface-rgb), 0.9));
}

html[data-theme='dark'] .brand__name {
  color: var(--brand-2);
}

html[data-theme='dark'] .profile {
  background: rgba(var(--surface-rgb), 0.62);
  border-color: rgba(var(--text-rgb), 0.1);
}

html[data-theme='dark'] .profile__name {
  color: var(--text);
}

html[data-theme='dark'] .main-shell {
  background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.98), rgba(var(--surface-rgb), 0.94));
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.36);
}

html[data-theme='dark'] .main-shell::before {
  border-color: rgba(255, 255, 255, 0.05);
}

html[data-theme='dark'] .sidebar__quick-link {
  color: var(--text);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme='dark'] .sidebar__quick-link:hover {
  background: rgba(var(--brand-rgb), 0.18);
  color: var(--text);
}

html[data-theme='dark'] .sidebar__quick-link.is-active {
  background: rgba(var(--brand-rgb), 0.24);
  color: #f5f3ff;
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.32), 0 12px 24px rgba(0, 0, 0, 0.2);
}

html[data-theme='dark'] .sidebar__quick-link--utility {
  color: rgba(var(--text-rgb), 0.76);
}

html[data-theme='dark'] .sidebar__quick-submenu {
  background: rgba(var(--surface-rgb), 0.98);
  border-color: rgba(var(--text-rgb), 0.08);
}

html[data-theme='dark'] .sidebar__quick-submenu-item:hover {
  background: rgba(var(--brand-rgb), 0.18);
  color: #fff;
}

html[data-theme='dark'] .sidebar__quick-submenu-item.is-active {
  background: rgba(var(--brand-rgb), 0.24);
  color: #fff;
}

html[data-theme='dark'] .sidebar__quick-footer {
  border-top-color: rgba(var(--text-rgb), 0.08);
}

html[data-theme='dark'] .sidebar__tooltip {
  background: rgba(var(--surface-rgb), 0.98);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

html[data-theme='dark'] .sidebar__tooltip::before {
  background: rgba(var(--surface-rgb), 0.98);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] .search.js-global-search {
  background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.9), rgba(var(--surface-rgb), 0.84));
  border-color: rgba(var(--text-rgb), 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

html[data-theme='dark'] .search.js-global-search .search__icon {
  color: var(--muted);
  opacity: 0.88;
}

html[data-theme='dark'] .search.js-global-search .ac__list {
  background: rgba(var(--surface-rgb), 0.98);
  border-color: rgba(var(--text-rgb), 0.08);
}

html[data-theme='dark'] .nav__item {
  color: var(--text);
}

html[data-theme='dark'] .nav__item:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.22);
}

html[data-theme='dark'] .nav__item.is-active {
  background: rgba(139, 92, 246, 0.24);
  border-color: rgba(139, 92, 246, 0.26);
  color: #E9D5FF;
}

/* Topbar chips */
html[data-theme='dark'] .userchip {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] .userchip__name {
  color: var(--text);
}

/* Icon buttons */
html[data-theme='dark'] .icon-btn {
  background: rgba(30, 41, 59, 0.70);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

html[data-theme='dark'] .icon-btn:hover {
  background: rgba(139, 92, 246, 0.20);
  border-color: rgba(139, 92, 246, 0.28);
}

/* Modern & Premium User Menu Redesign */
.user-menu {
  min-width: 250px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 20px 50px -12px rgba(17, 24, 39, 0.18);
  display: none;
  /* Keep hidden by default */
  flex-direction: column;
  gap: 4px;
}

/* Show as flex when parent is open */
.dropdown.is-open .user-menu {
  display: flex !important;
}


.user-menu__header {
  padding: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(139, 92, 246, 0.02));
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  border: 1px solid rgba(139, 92, 246, 0.05);
}

.user-menu__avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.25);
}

.user-menu__info {
  display: flex;
  flex-direction: column;
}

.user-menu__name {
  font-weight: 800;
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
}

.user-menu__email {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.user-menu__item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4b5563;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.user-menu__item:hover {
  background: rgba(139, 92, 246, 0.08);
  color: var(--brand);
  transform: translateX(4px);
}

.user-menu__item:active {
  transform: scale(0.97);
}

.dropdown__sep {
  height: 1px;
  background: rgba(17, 24, 39, 0.05);
  margin: 10px 0 6px;
  /* Added more top margin for spacing from last item */
}


/* Dark Mode: Premium User Menu */
html[data-theme='dark'] .user-menu {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 20px 50px -12px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] .user-menu__header {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

html[data-theme='dark'] .user-menu__name {
  color: #fff;
}

html[data-theme='dark'] .user-menu__email {
  color: #94a3b8;
}

html[data-theme='dark'] .user-menu__item {
  color: #94a3b8;
}

html[data-theme='dark'] .user-menu__item:hover {
  background: rgba(139, 92, 246, 0.16);
  color: #e9d5ff;
}

html[data-theme='dark'] .dropdown__sep {
  background: rgba(255, 255, 255, 0.06);
}

/* Generic Dropdown Dark Mode Overrides */
html[data-theme='dark'] .dropdown__menu {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] .dropdown__item {
  color: #cbd5e1;
}

html[data-theme='dark'] .dropdown__item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Drawer Dark Mode: Force better visibility */
html[data-theme='dark'] .drawer__panel {
  background: #0f172a;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

html[data-theme='dark'] .drawer__title {
  color: #fff;
  font-weight: 800;
}

html[data-theme='dark'] .drawer-section__head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .drawer-section__title {
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Filter pills dark mode visibility */
html[data-theme='dark'] .filters .btn--filter {
  background: #1e293b;
  border-color: rgba(139, 92, 246, 0.3);
  color: #a78bfa;
}

html[data-theme='dark'] .filters .btn--filter:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
}

html[data-theme='dark'] .filters .btn--filter.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Fix global search placeholder in dark mode */
html[data-theme='dark'] .search input::placeholder {
  color: rgba(148, 163, 184, 0.45);
}



/* Lists */
html[data-theme='dark'] .list__row {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] .list__label {
  color: var(--text);
}

html[data-theme='dark'] .list__value {
  color: var(--muted);
}

/* Actions toolbar tweaks */
html[data-theme='dark'] .actions .btn--secondary {
  background: color-mix(in srgb, var(--surface) 88%, white);
  border-color: color-mix(in srgb, var(--border) 72%, white);
  color: var(--heading);
}

html[data-theme='dark'] .actions .btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme='dark'] .actions .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme='dark'] .actions .btn--danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.28);
  color: #FECACA;
}

html[data-theme='dark'] .actions .btn--danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

/* Member profile blocks */
html[data-theme='dark'] .member-kv,
html[data-theme='dark'] .member-note {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme='dark'] .member-kv .kv-label {
  color: rgba(226, 232, 240, 0.70);
}

html[data-theme='dark'] .member-kv .kv-value,
html[data-theme='dark'] .member-kv .kv-value--muted,
html[data-theme='dark'] .member-note {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .section-title {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .stat-pill {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .stat-pill__label {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme='dark'] .pill {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .group-pill {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
  color: rgba(243, 244, 246, 0.92);
}

/* Member quick stats card */
.card.quick-stats {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  color: var(--text);
}

html[data-theme='dark'] .card.quick-stats {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  color: var(--text);
}

html[data-theme='dark'] .quick-stats .group-pill {
  background: rgba(124, 77, 255, 0.22);
  border-color: rgba(124, 77, 255, 0.30);
  color: #E9D5FF;
}

html[data-theme='dark'] .quick-stats .group-pill strong {
  color: #fff;
}

/* Global search tags (green/red pills) */
html[data-theme='dark'] .ac__list {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

html[data-theme='dark'] .ac__item:hover {
  background: rgba(139, 92, 246, 0.18);
}

html[data-theme='dark'] .ac__meta {
  color: rgba(148, 163, 184, 0.82);
}

html[data-theme='dark'] .ac__name {
  color: rgba(243, 244, 246, 0.94);
}

html[data-theme='dark'] .ac__tag {
  background: rgba(34, 197, 94, 0.25);
  /* More background */
  border-color: rgba(34, 197, 94, 0.45);
  color: #aaf9c8;
  /* Brighter green */
}

html[data-theme='dark'] .ac__tag::before {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

html[data-theme='dark'] .ac__tag--inactive {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ffcfcf;
  /* Brighter red */
}


html[data-theme='dark'] .ac__tag--inactive::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}

/* Auth screens */
html[data-theme='dark'] .auth-card {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

/* Attendance calendar + drawer (dashboard + attendance pages) */
html[data-theme='dark'] .cal {
  background: rgba(15, 23, 42, 0.70);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] .cal__row--head .cal__cell {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 232, 240, 0.78);
}

html[data-theme='dark'] .cal__cell {
  border-right-color: rgba(255, 255, 255, 0.08);
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .cal__cell--empty {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme='dark'] .cal__cell--day {
  background: rgba(15, 23, 42, 0.55);
}

html[data-theme='dark'] .cal__cell--day:hover {
  background: rgba(139, 92, 246, 0.10);
}

html[data-theme='dark'] .cal__daynum {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .pill--soft {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.28);
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .cal__day--active,
html[data-theme='dark'] .cal__day--active:hover {
  background:
    radial-gradient(120px 120px at 20% 20%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(160px 160px at 80% 80%, rgba(124, 58, 237, 0.14), transparent 65%),
    rgba(15, 23, 42, 0.64);
}

html[data-theme='dark'] .cal--premium {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme='dark'] .cal--premium .cal__row--head .cal__cell {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme='dark'] .cal-day {
  background: rgba(15, 23, 42, 0.60);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.40);
}

html[data-theme='dark'] .cal-day:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.48);
}

html[data-theme='dark'] .cal-day__num {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .cal-chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .cal-chip--muted {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
  color: rgba(148, 163, 184, 0.78);
}

html[data-theme='dark'] .cal-pill--blue {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

html[data-theme='dark'] .cal-chip--orange {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

html[data-theme='dark'] .cal-day.has-activity,
html[data-theme='dark'] .cal-day.has-activity:hover {
  background:
    radial-gradient(140px 140px at 18% 20%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(180px 180px at 85% 85%, rgba(124, 58, 237, 0.14), transparent 65%),
    rgba(15, 23, 42, 0.60);
}

html[data-theme='dark'] .drawer__overlay {
  background: rgba(2, 6, 23, 0.62);
}

html[data-theme='dark'] .drawer__panel {
  background: rgba(15, 23, 42, 0.96);
  border-left-color: rgba(255, 255, 255, 0.12);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.60);
}

html[data-theme='dark'] .drawer__header {
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

html[data-theme='dark'] .drawer__footer {
  border-top-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme='dark'] .drawer__title,
html[data-theme='dark'] .day-summary__title,
html[data-theme='dark'] .drawer-section__title,
html[data-theme='dark'] .session-card__title,
html[data-theme='dark'] .attendee-row__name {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .kpi,
html[data-theme='dark'] .session-card,
html[data-theme='dark'] .attendee-row,
html[data-theme='dark'] .empty-state {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

html[data-theme='dark'] .kpi__label {
  color: rgba(148, 163, 184, 0.80);
}

html[data-theme='dark'] .kpi__value {
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(243, 244, 246, 0.92);
}

html[data-theme='dark'] .progress {
  background: rgba(255, 255, 255, 0.10);
}

/* Premium Check-in Modal Enhancements */
.modal--premium .modal__content {
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal--premium .modal__header {
  border-bottom: 0;
  padding: 24px 24px 8px;
}

.modal--premium .modal__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.modal--premium .modal__body {
  padding: 24px;
}

.checkin-field-group {
  background: rgba(139, 92, 246, 0.04);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.1);
  margin-bottom: 20px;
}

html[data-theme='dark'] .checkin-field-group {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.checkin-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--brand);
}

html[data-theme='dark'] .checkin-label {
  color: var(--brand-2);
}

.checkin-input-wrapper {
  position: relative;
}

.checkin-input-wrapper .control {
  background: var(--surface);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  height: 48px;
  font-size: 15px;
}

.checkin-input-wrapper .control:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

/* ── Settings Tabbed Layout ─────────────────────────────── */
.settings-layout {
  display: flex;
  gap: 0;
  min-height: 520px;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.settings-nav {
  width: 230px;
  flex-shrink: 0;
  padding: 16px 12px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.settings-nav__item:hover {
  background: rgba(139, 92, 246, .06);
  border-color: rgba(139, 92, 246, .10);
}

.settings-nav__item.is-active {
  background: rgba(var(--brand-rgb), .12);
  border-color: rgba(var(--brand-rgb), .18);
  color: var(--brand-darker);
  font-weight: 800;
}

html[data-theme='dark'] .settings-nav__item.is-active {
  background: rgba(var(--brand-rgb), .22);
  border-color: rgba(var(--brand-rgb), .30);
  color: var(--brand-light);
}

.settings-nav__icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.settings-nav__badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(34, 197, 94, .12);
  color: var(--success);
}

.settings-content {
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}

.settings-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  animation: settingsFadeIn .25s var(--ease);
}

.settings-panel.is-active {
  display: flex;
}

@keyframes settingsFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.settings-panel__header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.settings-panel__header .panel-icon {
  font-size: 24px;
}

.settings-panel__desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

.settings-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}

.settings-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
}

.settings-section__title .section-icon {
  font-size: 16px;
}

.settings-section__title .section-color {
  color: var(--brand);
}

.settings-section__title .section-color--green {
  color: #059669;
}

.settings-section__title .section-color--amber {
  color: var(--warning);
}

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

/* Status row */
.settings-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
}

.settings-status-row+.settings-status-row {
  border-top: 1px solid var(--border);
}

.settings-status-row .status-label {
  color: var(--muted);
}

.settings-status-row .status-value {
  font-weight: 700;
}

.settings-status-row .status-value--on {
  color: var(--success);
}

.settings-status-row .status-value--off {
  color: var(--danger);
}

/* Cron note fallback */
.settings-cron-note {
  padding: 14px;
  background: var(--surface);
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid var(--border);
}

.settings-cron-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
}

/* Settings save bar */
.settings-save-bar {
  position: sticky;
  bottom: 0;
  padding: 16px 0 0;
  margin-top: auto;
  background: linear-gradient(to top, var(--surface) 60%, transparent);
}

/* Mobile: horizontal tabs */
@media (max-width: 860px) {
  .settings-layout {
    flex-direction: column;
    border-radius: var(--r-md);
  }

  .settings-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px;
    gap: 6px;
    scrollbar-width: none;
  }

  .settings-nav::-webkit-scrollbar {
    display: none;
  }

  .settings-nav__item {
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .settings-content {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .settings-content {
    padding: 16px 12px;
  }

  .settings-section {
    padding: 14px;
  }
}

/* Business KPI Cards */
.card--stat {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card--stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.card--stat .card__bg {
  position: absolute;
  right: 12px;
  bottom: 0px;
  font-size: 84px;
  line-height: 1;
  opacity: 0.05;
  pointer-events: none;
  transform: rotate(-10deg);
}

.card--stat .card__value {
  font-size: 32px;
  font-weight: 800;
  margin: 12px 0 4px;
  letter-spacing: -0.5px;
}

.card--stat .card__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

/* =============================================
   Native App Support (Capacitor)
   ============================================= */

:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

/* Disable text selection and callouts for a native feel */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Allow text selection in content areas */
.modal__body,
.content,
.card,
p,
span,
h1,
h2,
h3,
h4,
h5,
h6,
li,
td,
th {
  -webkit-user-select: text;
  user-select: text;
}

input,
textarea {
  -webkit-user-select: auto !important;
  user-select: auto !important;
}

/* iOS: prevent auto-zoom on focus for inputs (font-size must be >= 16px) */
.is-capacitor input.control,
.is-capacitor textarea.control,
.is-capacitor select.control {
  font-size: max(16px, var(--text-md)) !important;
}

html,
body {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: var(--bg) !important;
}

/* .app min-height is already set at the top of this file with dvh */

/* Adjust sidebar and navigation for safe areas */
.sidebar {
  padding-top: calc(18px + var(--safe-area-inset-top));
  padding-bottom: calc(14px + var(--safe-area-inset-bottom));
}

/* Topbar height and safe-area is now handled by the unified .topbar rule above.
   The .is-capacitor .topbar override is no longer needed —
   the unified topbar uses max() with --safe-area-inset-top */

/* Capacitor Specific Overrides (Triggered by JS) */
.is-capacitor .toast-wrap {
  top: calc(32px + env(safe-area-inset-top)) !important;
}

.is-capacitor .ai-chat-widget {
  bottom: calc(110px + env(safe-area-inset-bottom)) !important;
  right: 20px !important;
}

.is-capacitor .ai-chat-container {
  bottom: 80px !important;
  max-height: calc(100vh - 220px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) !important;
  max-height: calc(100dvh - 220px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) !important;
}

/* Bottom Navigation (for Client Portal) */
.bottom-nav {
  padding-bottom: max(8px, var(--safe-area-inset-bottom));
  height: calc(var(--bottomnav-h) + max(0px, var(--safe-area-inset-bottom)));
}

/* Adjust fixed buttons */
.fab-qr {
  bottom: calc(24px + var(--safe-area-inset-bottom));
  right: calc(24px + var(--safe-area-inset-left));
}

/* Performance: simplify animations on low-power devices */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================
   Admin Bottom Navigation (Mobile Only)
   ============================================= */
.admin-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding-bottom: max(8px, var(--safe-area-inset-bottom));
  height: calc(var(--bottomnav-h) + max(0px, var(--safe-area-inset-bottom)));
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.admin-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-bottom-nav__item.is-active {
  color: var(--brand);
}

.admin-bottom-nav__item:active {
  transform: scale(0.92);
  opacity: 0.7;
}

.admin-bottom-nav__button-reset {
  background: none;
  border: none;
  padding: 0;
}

.admin-bottom-nav__icon {
  font-size: 20px;
}

@media (max-width: 1024px) {
  .admin-bottom-nav {
    display: grid;
  }

  .main {
    padding-bottom: calc(64px + var(--safe-area-inset-bottom));
  }
}

/* =============================================
   Native Scanner Support
   ============================================= */
.barcode-scanner-active {
  background: transparent !important;
}

.barcode-scanner-active .app,
.barcode-scanner-active .sidebar,
.barcode-scanner-active .topbar,
.barcode-scanner-active .main,
.barcode-scanner-active .admin-bottom-nav {
  visibility: hidden !important;
}

.scanner-ui {
  display: none !important;
}

.scanner-reader {
  width: 100%;
}

.barcode-scanner-active .scanner-ui {
  display: flex;
  visibility: visible;
  position: fixed;
  inset: 0;
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 20px;
  background: transparent;
}

.scanner-ui__close {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  backdrop-filter: blur(10px);
}

.scanner-ui__target {
  width: 260px;
  height: 260px;
  border: 2px solid white;
  border-radius: 20px;
  position: relative;
}

.barcode-scanner-active .scanner-ui__target {
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5);
}

.scanner-ui__target::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: scan-mobile 2s linear infinite;
}

@keyframes scan-mobile {
  from {
    top: 0;
  }

  to {
    top: 100%;
  }
}

/* =============================================
   Admin Search Overlay
   ============================================= */
.admin-search-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-admin-search-active .admin-search-overlay {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.search-input-wrapper {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: calc(16px + var(--safe-area-inset-top));
}

#admin-mobile-search-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 16px;
  color: var(--text);
  outline: none;
}

#admin-mobile-search-input:focus {
  border-color: var(--brand);
  background: var(--surface);
}

.search-close-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 700;
  font-size: 15px;
  padding: 8px;
  white-space: nowrap;
}

#admin-mobile-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface);
}

.ac__list.is-visible {
  display: block;
}

#admin-mobile-search-results .ac__item {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 4px;
}

#admin-mobile-search-results .ac__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

#admin-mobile-search-results .ac__meta {
  font-size: 12px;
  color: var(--muted);
}

/* =============================================
   Dashboard Tabs
   ============================================= */
.dash-shell {
  display: grid;
  gap: 16px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(140deg, var(--surface) 0%, var(--surface-2) 100%);
}

.dash-header__kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dash-header__title {
  margin: 6px 0 0;
  font-size: clamp(26px, 3.8vw, 38px);
  line-height: 1.1;
  color: var(--heading);
}

.dash-header__subtitle {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 780px;
}

.dash-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-tab {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}

.dash-tab.is-active {
  border-color: rgba(var(--brand-rgb), 0.35);
  box-shadow: 0 8px 18px -14px rgba(var(--brand-rgb), 0.9);
}

.dash-tab__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.dash-tab__meta {
  font-size: 12px;
  color: var(--muted);
}

.dash-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-kpi {
  min-height: 132px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dash-kpi__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.dash-kpi__value {
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.dash-kpi__meta {
  font-size: 12px;
  color: var(--muted);
}

.dash-priority {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-panel {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
}

.dash-panel__head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.dash-panel__eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dash-panel__title {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.dash-list {
  display: grid;
  gap: 8px;
}

.dash-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  padding: 10px 12px;
}

.dash-row--static {
  cursor: default;
}

.dash-row__time {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
}

html[data-theme='dark'] .dash-row__time {
  color: var(--brand-light, #cad4ed);
}

.dash-row__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dash-row__meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.dash-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  background: var(--surface-2);
}

.dash-empty__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dash-empty__text {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.dash-briefing {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  border-color: rgba(148, 163, 184, 0.25);
  color: #f8fafc;
}

.dash-briefing .dash-panel__eyebrow,
.dash-briefing .dash-panel__title {
  color: #f8fafc;
}

.dash-briefing__actions {
  display: flex;
  gap: 8px;
}

.dash-briefing__body {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.95);
  white-space: pre-wrap;
}

.dash-quick-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-quick-link {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-weight: 700;
}

.dash-quick-link__arrow {
  color: var(--muted);
}

.dash-warnings {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.05);
}

.dash-warning-list {
  display: grid;
  gap: 8px;
}

.dash-warning-item {
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
}

/* =============================================
   Shared Layout Helpers
   ============================================= */
.brand-powered {
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.8;
  line-height: 1.4;
  text-align: center;
}

.brand-powered__accent {
  color: var(--brand);
  font-weight: 700;
}

.brand-powered__meta {
  font-size: 9px;
  opacity: 0.7;
}

.brand-powered__link {
  color: inherit;
  text-decoration: underline;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.topbar__left--client {
  gap: 8px;
}

.topbar__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
}

.topbar__context {
  display: none !important;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 2px;
}

.topbar__eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(var(--text-rgb), 0.55);
  white-space: nowrap;
}

.topbar__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar__context .topbar__title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
}

.topbar__section-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-rgb), 0.16);
  background: rgba(var(--brand-rgb), 0.1);
  color: var(--brand-darker);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.dropdown-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 12px;
}

.dropdown-trigger-btn__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dropdown-trigger-btn__caret {
  font-size: 10px;
  opacity: 0.5;
}

.client-avatar-mini {
  width: 28px;
  height: 28px;
  margin: 0;
  overflow: hidden;
  padding: 0;
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu--narrow {
  width: 180px;
}

.user-menu__profile-link {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}

.user-menu__profile-link:hover {
  background: var(--surface-2);
}

.user-menu__sep {
  border-top: 1px solid var(--border);
}

.user-menu__logout {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 12px;
  font-size: 13px;
  color: #ef4444;
  cursor: pointer;
  font-weight: 600;
}

.notif-panel__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.7;
}

.notif-trigger {
  position: relative;
  z-index: 10001;
  touch-action: manipulation;
}

.avatar--cover {
  overflow: hidden;
  padding: 0;
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.avatar__img--cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.avatar__img--contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.search__kbd {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: rgba(var(--primary-rgb), 0.08);
  border-radius: 6px;
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  margin-left: 8px;
}

.search__kbd-key {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.8;
}

.push-banner.is-hidden {
  display: none;
}

.live-banner-link {
  text-decoration: none;
  display: block;
}

.pt-banner {
  margin: 0 0 20px;
  padding: 14px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  animation: ptBannerPulse 3s ease-in-out infinite;
}

@keyframes ptBannerPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
  }
}

.pt-banner:hover {
  transform: translateY(-1px);
}

.pt-banner--live {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.pt-banner--live:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
}

.pt-banner--pending {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.12) 0%, rgba(var(--brand-rgb), 0.08) 100%);
  border-color: rgba(var(--brand-rgb), 0.35);
}

.pt-banner--pending:hover {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.18) 0%, rgba(var(--brand-rgb), 0.12) 100%);
}

.pt-banner__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.pt-banner__icon--live {
  background: rgba(239, 68, 68, 0.16);
}

.pt-banner__icon--pending {
  background: rgba(var(--warning-rgb), 0.15);
}

.pt-banner__body {
  flex: 1;
  min-width: 200px;
}

.pt-banner__title {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.pt-banner__text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pt-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}

.pt-banner__cta--live {
  background: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.pt-banner__cta--pending {
  background: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.pt-modal-body {
  padding: 0;
}

.pt-modal-state {
  padding: 40px;
  text-align: center;
}

.pt-modal-state--muted {
  color: var(--muted);
}

.pt-modal-state--error {
  color: #ef4444;
}

.pt-request-card {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
}

.pt-request-card:hover {
  background: rgba(0, 0, 0, 0.01);
}

.pt-request-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.pt-request-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.pt-request-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pt-request-meta__trainer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
}

.pt-request-contact {
  display: flex;
  gap: 8px;
}

.pt-request-contact-link {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pt-request-contact-link--wa {
  color: #25d366;
  background: rgba(37, 211, 102, 0.1);
}

.pt-request-contact-link--phone {
  color: var(--brand);
  background: rgba(var(--primary-rgb), 0.1);
}

.pt-conflict-box {
  margin-top: 12px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #dc2626;
}

.pt-conflict-box__title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.pt-conflict-box__list {
  margin: 0;
  padding-left: 18px;
}

.pt-request-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.pt-request-actions .btn {
  flex: 1;
}

.pt-request-actions .btn--success,
.pt-request-actions .btn--ghost {
  font-weight: 600;
}

.pt-request-actions .btn--ghost {
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.pt-inline-form {
  margin: 0;
}

.ac__item-main {
  flex: 1;
  min-width: 0;
}

.ac__tag--student {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding-top: 0;
  padding-bottom: 0;
  height: 22px;
  font-size: 9px;
}

.ac__tag--pt {
  background: #6366f1;
  color: #fff;
  border: none;
  padding-top: 0;
  padding-bottom: 0;
  height: 22px;
  font-size: 9px;
}

.ac__tag--payment {
  background: #8b5cf6;
  color: #fff;
  border: none;
  padding-top: 0;
  padding-bottom: 0;
  height: 22px;
  font-size: 9px;
}

.ac__tag--default {
  background: var(--primary);
  color: #fff;
  border: none;
  opacity: 0.8;
  padding-top: 0;
  padding-bottom: 0;
  height: 22px;
  font-size: 9px;
}

.ac__empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1100px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .dash-header {
    flex-direction: column;
  }

  .dash-header__actions {
    width: 100%;
  }

  .dash-header__actions .btn {
    flex: 1;
    min-height: 44px;
  }

  .dash-tabs {
    grid-template-columns: 1fr;
  }

  .dash-kpis,
  .dash-priority,
  .dash-quick-actions {
    grid-template-columns: 1fr;
  }

  .dash-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pt-request-header {
    flex-direction: column;
  }

  .pt-request-actions {
    flex-direction: column;
  }
}

/* =============================================================
   @media print — Clean print preview for all admin pages
   =============================================================
   Hides chrome (sidebar, topbar, navbars, modals, drawers,
   floating bars, AI banners) and forces a clean white layout
   suitable for printing member cards, payment receipts,
   attendance reports, etc.

   IMPORTANT: We first re-map all design tokens to light-mode
   print-safe values inside @media print so that every rule
   below can still use var(--...) consistently — exactly the
   same token names as the rest of the codebase.
   ============================================================= */
@media print {

  /* 1. Re-map design tokens to print-safe (light-mode) values.
        This covers users who have dark-mode active so that the
        printed page is always high-contrast on white paper.     */
  :root,
  html[data-theme='dark'] {
    --bg: #ffffff !important;
    --surface: #ffffff !important;
    --surface-2: #f3f4f6 !important;
    /* matches --surface-2 light value */
    --text: #111827 !important;
    --muted: #4b5563 !important;
    --border: #e5e7eb !important;

    /* Keep brand colours so var(--brand) etc. still work */
    --brand: #7c3aed !important;
    /* --brand-dark in light mode */
    --brand-dark: #7c3aed !important;
    --brand-darker: #5b21b6 !important;
    --brand-lighter: #ede9fe !important;
    --brand-2: #a78bfa !important;

    /* Semantic colours */
    --success: #16a34a !important;
    --danger: #dc2626 !important;
    --warning: #d97706 !important;
  }

  /* 2. Reset body / html */
  html,
  body {
    background: var(--bg) !important;
    color: var(--text) !important;
    font-size: 12pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 3. Flatten the flex app shell */
  .app {
    display: block !important;
    min-height: unset !important;
    background: var(--bg) !important;
  }

  .main {
    display: block !important;
    padding-bottom: 0 !important;
  }

  .main-shell,
  .main-shell::before,
  .main-shell__topbar,
  .main-shell__content {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  .content {
    padding: 0 !important;
  }

  /* 4. Hide all chrome / navigation */
  .sidebar,
  .sidebar-overlay,
  .topbar,
  .hamburger,
  .admin-bottom-nav,
  .live-pulse-bar,
  .fab-qr,
  .admin-search-overlay,
  .search.js-global-search,
  #aiBriefing,
  .ai-briefing-banner,
  .ai-insights-strip,
  .update-banner,
  .modal,
  .drawer,
  .dropdown__menu,
  .toast-wrap,
  .pwa-install-banner,
  .ai-chat-widget,
  .ai-chat-container,
  .scanner-ui,
  .pagehead__right,
  .bottom-nav,
  .cal-btn-prev,
  .cal-btn-next,
  .cal-nav,
  .cal-mobile-nav,
  [data-drawer-close],
  [data-modal-open],
  [data-modal-close],
  .actions .dropdown,
  .table td .dropdown,
  .filter-bar,
  .filters {
    display: none !important;
  }

  /* 5. Strip all visual effects */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* 6. Cards and panels — white background, simple border */
  .card,
  .panel,
  .card--grad,
  .card--pink,
  .card--blue,
  .card--green,
  .card--orange,
  .card--premium {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card--grad .card__title,
  .card--grad .card__value,
  .card--grad .card__sub {
    color: var(--text) !important;
  }

  /* 7. Page head */
  .pagehead {
    border-bottom: 2px solid var(--border);
    padding-bottom: 8pt;
    margin-bottom: 16pt;
  }

  .pagehead .h1 {
    font-size: 18pt !important;
    color: var(--text) !important;
  }

  .pagehead .muted {
    display: block !important;
    font-size: 10pt !important;
    color: var(--muted) !important;
  }

  /* 8. Tables */
  .table-card {
    overflow: visible !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    width: 100% !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10pt !important;
  }

  th,
  td {
    border: 1px solid var(--border) !important;
    padding: 6pt 8pt !important;
    color: var(--text) !important;
    background: var(--surface) !important;
    word-break: break-word;
  }

  thead th {
    background: var(--surface-2) !important;
    font-weight: 700 !important;
    color: var(--text) !important;
  }

  /* 9. Badges, chips, pills */
  .badge,
  .badge2,
  .chip,
  .cal-chip,
  .stat-pill,
  .group-pill,
  .pill {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    font-size: 9pt !important;
  }

  /* 10. Links */
  a {
    color: var(--brand-dark) !important;
    text-decoration: none !important;
  }

  /* 11. Calendar grid */
  .cal--premium {
    display: block !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
  }

  .cal-day {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    min-height: 80px !important;
    page-break-inside: avoid;
  }

  /* Days with activity: very light brand tint */
  .cal-day.has-activity {
    background: rgba(var(--brand-rgb), 0.05) !important;
  }

  /* Today: brand-lighter background + brand border */
  .cal-day.is-today {
    background: var(--brand-lighter) !important;
    border-color: var(--brand-dark) !important;
  }

  .cal-mobile-nav,
  .cal-mobile-content {
    display: none !important;
  }

  /* 12. Member profile key-value blocks */
  .member-kv,
  .member-note {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
  }

  /* 13. Drawer (hidden entirely) */
  .drawer {
    display: none !important;
  }

  /* 14. Settings layout */
  .settings-layout {
    display: block !important;
  }

  .settings-nav {
    display: none !important;
  }

  .settings-panel {
    display: flex !important;
  }

  /* 15. Grids — two-column max for A4 */
  .grid--4,
  .grid--3,
  .grid--2,
  .grid--profile {
    grid-template-columns: 1fr 1fr !important;
    gap: 12pt !important;
  }

  /* 16. Page setup */
  @page {
    margin: 15mm 12mm;
    size: A4 portrait;
  }

  /* 17. Page-break hints */
  h2,
  h3,
  .panel,
  .section {
    page-break-after: auto;
    break-after: auto;
  }

  .panel,
  .card,
  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 18. Disable hover effects */
  .card:hover,
  .cal-day:hover,
  .nav__item:hover {
    transform: none !important;
  }

  /* 19. Progress bars */
  .progress {
    background: var(--border) !important;
    border: 1px solid var(--border) !important;
  }

  .progress__bar {
    background: var(--success) !important;
  }

  /* 20. Helper class: add class="no-print" to hide anything on print */
  .no-print,
  .btn.no-print,
  button.no-print {
    display: none !important;
  }

  /* 21. Charts — cap height so they don't overflow the page */
  #mainChart,
  #revenueChart {
    max-height: 180pt !important;
    overflow: hidden !important;
    page-break-inside: avoid;
  }
}
