/**
 * LUNA A.P Operating System – Brand theme
 * Alternative Provision Compliance & Safeguarding OS
 * PWA-first, calm, SEN-appropriate design system.
 * All colour, gradient, card, and button logic. No hard-coded colours.
 */
:root {
  /* Brand colours */
  --luna-pink: #ff69b4;
  --luna-blue: #7ad7f0;
  --luna-gradient: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%);
  --luna-gradient-soft: linear-gradient(135deg, rgba(255,105,180,0.1) 0%, rgba(122,215,240,0.1) 100%);
  --primary: #ff69b4;
  --secondary: #7ad7f0;
  --button-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  
  /* Backgrounds */
  --bg-light: #f8fafc;
  --bg-content-lighter-light: #ffffff;
  --bg-app: #f1f5f9;
  
  /* Text */
  --text-primary-dark: #334155;
  --text-header-dark: #1e293b;
  --text-secondary-dark: #64748b;
  
  /* Borders & shadows */
  --border-color-light: #e2e8f0;
  --card-shadow: rgba(0, 0, 0, 0.06);
  --card-shadow-hover: rgba(0, 0, 0, 0.1);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Footer */
  --footer-bg-light: #f1f5f9;
  --footer-text-primary-dark: #1e293b;
  --footer-text-secondary-dark: #64748b;
  
  /* Spacing system */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Sizing */
  --header-h: 56px;
  --bottom-nav-h: 64px;
  --touch-target: 44px;
  --radius: 16px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-card: 16px;
  --radius-btn: 16px;
  --card-radius: 16px;
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.08);
  --border-soft: 1px solid #e2e8f0;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
  /* RAG – semantic status (audit/compliance only) */
  --rag-red: #dc2626;
  --rag-amber: #d97706;
  --rag-green: #16a34a;
}

/* Base styles – Inter font, calm, projector-safe */
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary-dark);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App shell - main content area (same for HTML and PWA) */
.main {
  background: var(--bg-app);
  min-height: calc(100vh - var(--header-h));
  padding: var(--space-lg);
  box-sizing: border-box;
}

/* Desktop: two-column layout */
body.has-sidebar { display: flex; flex-direction: column; min-height: 100vh; }
body.has-sidebar .app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}
body.has-sidebar .app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border-color-light);
  padding: var(--space-md) 0;
}
body.has-sidebar .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
body.has-sidebar .sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  text-decoration: none;
  color: var(--text-primary-dark);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}
body.has-sidebar .sidebar-item:hover { background: var(--bg-light); color: var(--luna-pink); }
body.has-sidebar .sidebar-item.active {
  background: rgba(255,105,180,0.08);
  color: var(--luna-pink);
  border-left: 3px solid var(--luna-pink);
  padding-left: calc(var(--space-lg) - 3px);
}
body.has-sidebar .sidebar-icon { font-size: 1.1rem; }
body.has-sidebar .main { flex: 1; }

@media (max-width: 768px) {
  body.has-sidebar .app-sidebar { display: none; }
}

/* PWA with bottom nav - extra padding so content isn't hidden */
body.has-bottom-nav .main {
  padding-bottom: calc(var(--bottom-nav-h) + var(--space-lg));
  min-height: calc(100vh - var(--header-h) - var(--bottom-nav-h));
}

.main {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* PWA only (bottom nav): tighten horizontal padding and centre toolbars on small screens.
   Scoped to has-bottom-nav so HTML/browser pages keep their original toolbar alignment. */
@media (max-width: 768px) {
  body.has-bottom-nav .main {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  body.has-bottom-nav .main .flex-between {
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
  }
}

/* HTML shell (browser): no bottom nav; .main width already set above */
body.has-html-shell .bottom-nav {
  display: none !important;
}

/* Brand hierarchy layout */
.brand-hierarchy {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
  text-align: center;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--text-header-dark);
  font-weight: 500;
}
.system-instance-id {
  font-size: 0.7rem;
  color: var(--text-secondary-dark);
  white-space: nowrap;
  text-align: center;
}
.app-header .brand-hierarchy.brand-hierarchy-header { text-align: left; }
.app-header .brand-hierarchy .brand-subtitle { font-size: 0.85rem; color: var(--text-header-dark); }

/* Page titles and headings – always centre-aligned; brand gradient when .luna-text-gradient */
.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--text-header-dark);
  text-align: center;
  width: 100%;
}

.main .page-title:first-of-type {
  text-align: center;
}

.page-title-tight {
  margin-bottom: 0;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary-dark);
  margin-top: calc(var(--space-xs) * -1);
  margin-bottom: var(--space-lg);
  text-align: center;
  width: 100%;
}

/* Notifications page: action row under title */
.notifications-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-md);
}

@media (max-width: 520px) {
  .notifications-actions {
    justify-content: center;
  }
  .notifications-actions .btn {
    width: 100%;
    max-width: 420px;
  }
}

.notification-item .notification-link {
  display: block;
}
.notification-item .mark-read-btn {
  display: inline-flex;
  margin-top: 0.6rem;
}

/* Exports page: centre card headings/text/CTAs; keep PDF list left-aligned and dark */
.exports-main .card { text-align: center; }
.exports-main .card h2 { text-align: center; }
.exports-main .card p { text-align: center; }
.exports-main .card .btn { margin-left: auto; margin-right: auto; }
.exports-main .card ul.list-unstyled { text-align: left; margin: 0; padding-left: 0; }
.exports-main .card ul.list-unstyled a { color: var(--text-header-dark); text-decoration: none; }
.exports-main .card ul.list-unstyled a:hover { color: var(--text-header-dark); text-decoration: underline; }

/* Exports: 2nd card (Evidence Pack) header gets pink→blue gradient on hover */
.exports-main .card-list .card:nth-child(3n+2):hover h2,
.exports-main .card-list .card:nth-child(3n+2):focus-within h2 {
  background-image: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.exports-main .exports-pdf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  justify-content: center;
  justify-items: start;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
@media (min-width: 720px) {
  /* Two equal columns; each list centered within its half (looks perfectly balanced) */
  .exports-main .exports-pdf-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-2xl);
    justify-items: center;
  }
  .exports-main .exports-pdf-grid ul.list-unstyled {
    width: max-content;
    min-width: 260px;
  }
}

.card h2 { 
  margin: 0 0 var(--space-sm); 
  font-size: 1.1rem; 
  font-weight: 600;
  color: var(--text-header-dark);
  text-align: center;
}

.card h3 {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-header-dark);
  text-align: center;
}

.card p {
  margin: 0 0 var(--space-sm);
  color: var(--text-primary-dark);
}

.card p:last-child {
  margin-bottom: 0;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--text-header-dark);
  color: var(--bg-content-lighter-light);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  box-shadow: 0 4px 12px var(--card-shadow);
}


.app-header .role-badge {
  font-size: 0.75rem;
  background: var(--border-color-light);
  color: var(--text-primary-dark);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  margin-left: auto;
}

.app-header .search-wrap { flex: 0 1 220px; }
.app-header .search-wrap input {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--bg-content-lighter-light);
  color: var(--text-primary-dark);
}

.app-header .quick-export {
  padding: 0.35rem 0.6rem;
  background: var(--button-gradient);
  color: white;
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.35);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}

.app-header .quick-export:hover {
  opacity: 0.95;
  box-shadow: 0 4px 16px rgba(255, 105, 180, 0.4);
}

.app-header .nav a {
  color: var(--bg-content-lighter-light);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  border-radius: var(--radius);
}

.app-header .nav a:hover { background: var(--border-color-light); color: var(--text-primary-dark); }
.app-header .nav a.active { background: var(--secondary); color: var(--text-header-dark); }

.app-header .logout-btn {
  background: transparent;
  border: 1px solid var(--border-color-light);
  color: var(--bg-content-lighter-light);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}

.app-header .logout-btn:hover { background: var(--border-color-light); color: var(--text-primary-dark); }

/* =====================================
   MINIMAL HEADER (PWA style)
   Clean, calm header for app shell
   ===================================== */
.app-header-minimal {
  position: sticky;
  top: 0;
  z-index: 200;
  min-height: var(--header-h);
  background: #fff;
  color: var(--text-header-dark);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand actions";
  align-items: center;
  flex-wrap: nowrap;
  padding-top: max(4px, env(safe-area-inset-top, 0px));
  padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--space-md), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-md), env(safe-area-inset-right, 0px));
  box-shadow: var(--shadow-soft);
  border-bottom: 1px solid var(--border-color-light);
  box-sizing: border-box;
  overflow: visible;
}

.app-header-minimal .header-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 1;
  min-width: 0;
}
.app-header-minimal .header-brand img,
.app-header-minimal .header-brand .header-logo,
.app-header-minimal .header-brand .tenant-logo {
  display: block;
  height: 36px;
  width: auto;
  max-height: 36px;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

/* PWA minimal header: one line for brand text (ellipsis) */
.app-header-minimal .header-brand-text {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

/* Safety rail: never allow tenant/logo images to blow up layouts */
img.header-logo,
img.tenant-logo {
  max-width: 120px;
  height: auto;
  object-fit: contain;
}
.app-header-minimal .header-brand .brand-luna,
.app-header-minimal .header-brand .brand-apo,
.app-header-minimal .header-brand-text .brand-luna,
.app-header-minimal .header-brand-text .brand-apo {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}
.app-header-minimal .header-brand .brand-apo {
  color: var(--text-header-dark);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0.95;
}

.app-header-minimal .header-title {
  display: none;
}

.app-header-minimal .header-user {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: nowrap;
  flex-shrink: 0;
  justify-content: flex-end;
  margin-left: 0;
}

@media (max-width: 720px) {
  .app-header-minimal .header-title { display: none; }
}

/* Minimal header: reuse same avatar dropdown patterns as HTML header */
.app-header-minimal .user-menu-wrap { position: relative; z-index: 1; }
.app-header-minimal .user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: #fff;
  border: 2px solid var(--border-color-light);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.app-header-minimal .user-menu-trigger:hover {
  background: var(--bg-light);
  border-color: var(--luna-pink);
  box-shadow: 0 0 0 1px var(--luna-pink);
}
.app-header-minimal .user-menu-trigger-avatar-only { width: 44px; height: 44px; }
.app-header-minimal .user-menu-trigger-avatar-only .user-avatar { width: 100%; height: 100%; }
.app-header-minimal .user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.app-header-minimal .user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 16px));
  max-height: min(70vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-xs);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-header-minimal .user-menu-dropdown[hidden] { display: none; }
.app-header-minimal .user-dropdown-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary-dark);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
}
.app-header-minimal .user-dropdown-link:hover { background: var(--bg-light); color: var(--luna-pink); }
.app-header-minimal .user-dropdown-signout {
  margin-top: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border-color-light);
  color: var(--text-secondary-dark);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}
.app-header-minimal .user-dropdown-signout:hover { background: var(--bg-light); color: var(--text-header-dark); }

.app-header-minimal .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--luna-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}
.app-header-minimal .user-avatar-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  background: none;
}

@media (max-width: 520px) {
  .app-header-minimal {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  .app-header-minimal .header-brand {
    min-width: 0;
    max-width: 55vw;
    overflow: hidden;
  }
  body.has-bottom-nav .app-header-minimal .header-brand {
    max-width: min(38vw, 9.75rem);
  }
  .app-header-minimal .header-title {
    display: none; /* avoid crowding on very small screens */
  }
  .app-header-minimal .header-user {
    gap: 0.35rem;
  }
  .app-header-minimal .header-brand img,
  .app-header-minimal .header-brand .header-logo,
  .app-header-minimal .header-brand .tenant-logo {
    max-width: 48px;
  }
  .app-header-minimal .logout-btn .logout-label {
    display: none;
  }
}

/* PWA shell (bottom nav): tighter header row so brand + actions stay on one line */
body.has-bottom-nav .app-header-minimal {
  flex-wrap: nowrap;
  align-items: center;
  min-height: 48px;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}
body.has-bottom-nav .app-header-minimal .header-brand .brand-luna,
body.has-bottom-nav .app-header-minimal .header-brand .brand-apo,
body.has-bottom-nav .app-header-minimal .header-brand-text .brand-luna,
body.has-bottom-nav .app-header-minimal .header-brand-text .brand-apo {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
body.has-bottom-nav .app-header-minimal .header-brand img,
body.has-bottom-nav .app-header-minimal .header-brand .tenant-logo {
  max-height: 26px;
  max-width: 80px;
}
body.has-bottom-nav .app-header-minimal .header-icon-btn .search-icon-svg,
body.has-bottom-nav .app-header-minimal .minimal-bell .bell-icon-svg {
  width: 20px;
  height: 20px;
}
body.has-bottom-nav .app-header-minimal .user-menu-trigger-avatar-only {
  width: 44px;
  height: 44px;
}

/* Mobile / PWA: compact browser header + policy pages */
@media (max-width: 768px) {
  .app-header-luna {
    z-index: 200;
    overflow: visible;
  }
  .app-header-luna .header-container {
    flex-wrap: nowrap;
    padding: var(--space-xs) max(var(--space-md), env(safe-area-inset-right, 0px)) var(--space-xs) max(var(--space-md), env(safe-area-inset-left, 0px));
    padding-top: max(var(--space-xs), env(safe-area-inset-top, 0px));
    gap: var(--space-sm);
  }
  .app-header-luna .header-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 46vw;
  }
  .app-header-luna .header-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    gap: 0.35rem;
  }
  .app-header-luna .search-wrap,
  .app-header-luna .quick-export { display: none !important; }
  .app-header-luna .user-menu-trigger-avatar-only {
    width: 44px;
    height: 44px;
  }
  .app-header-luna .user-menu-dropdown,
  .app-header-luna .header-app-dropdown {
    max-height: min(70vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .luna-policy-hub-grid {
    gap: var(--space-sm);
  }
  .luna-policy-hub-card {
    min-height: 8rem;
    padding: 1rem 0.75rem;
  }
  .luna-policy-drill-nav .btn {
    width: 100%;
    justify-content: center;
  }
  .luna-policy-card-buttons-primary {
    flex-direction: column;
    align-items: stretch;
  }
  .luna-policy-card-buttons-primary .btn {
    width: 100%;
  }
  .luna-policy-card-buttons .btn-luna-pink.remove-policy {
    width: 100%;
    margin-top: 0.35rem;
  }
  #policies-upload .form-fields--center {
    padding-left: 0;
    padding-right: 0;
  }
}

.app-header-minimal .logout-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary-dark);
  padding: var(--space-sm);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.app-header-minimal .logout-btn.logout-btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-header-minimal .logout-btn.logout-btn--icon::before {
  content: "⎋";
  font-size: 1rem;
  line-height: 1;
}
.app-header-minimal .logout-btn .logout-label {
  display: inline;
}

.app-header-minimal .logout-btn:hover {
  background: var(--bg-light);
  color: var(--text-header-dark);
}

/* =====================================
   BOTTOM NAVIGATION (PWA style)
   Primary navigation for the app
   ===================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bottom-nav-h);
  background: var(--bg-content-lighter-light);
  border-top: 1px solid var(--border-color-light);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-secondary-dark);
  font-size: 0.7rem;
  font-weight: 500;
  padding: var(--space-xs) 0;
  transition: var(--transition-fast);
  position: relative;
  min-height: var(--touch-target);
}

.bottom-nav .nav-item:hover {
  color: var(--text-header-dark);
}

.bottom-nav .nav-item.active {
  color: var(--luna-pink);
}

.bottom-nav .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--luna-gradient);
  border-radius: 0 0 3px 3px;
}

.bottom-nav .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  line-height: 1;
  color: inherit;
}
.bottom-nav .nav-icon .bottom-nav-svg {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.bottom-nav .nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* More menu indicator */
.dfe-readiness-list { list-style: none; padding: 0; margin: 0; }
.dfe-readiness-list li { padding: 0.35rem 0; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; }
.dfe-check-ok .dfe-check-icon { color: var(--rag-green); font-weight: 700; }
.dfe-check-pending .dfe-check-icon { color: var(--rag-amber); }
.scr-register-table { font-size: 0.85rem; }
.scr-register-table th, .scr-register-table td { text-align: center; vertical-align: middle; }
.scr-register-table td:first-child, .scr-register-table th:first-child { text-align: left; }

.bottom-nav .nav-item.has-badge::after {
  content: '';
  position: absolute;
  top: 8px;
  right: calc(50% - 12px);
  width: 6px;
  height: 6px;
  background: var(--luna-pink);
  border-radius: 50%;
}

/* =====================================
   UNIFIED LUNA CARD SYSTEM (MANDATORY)
   Petition-derived. ONE system across ALL pages.
   Pattern: 3n+1 pink | 3n+2 gradient | 3n+3 blue
   ===================================== */

/* Base card – white bg, generous spacing */
.luna-card,
.card {
  background: #ffffff;
  border-radius: var(--card-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: box-shadow var(--transition-normal), outline var(--transition-normal), color var(--transition-normal);
  border: 1px solid var(--border-color-light);
  outline: 2px solid transparent;
  outline-offset: -1px;
}

/* Card 1 – Pink accent */
.luna-card--pink,
.luna-card:nth-child(3n+1),
.luna-card-list .luna-card:nth-child(3n+1),
.card:nth-child(3n+1),
.card-list .card:nth-child(3n+1) {
  border-top: 4px solid #ff69b4;
}

.luna-card--pink:hover,
.luna-card:nth-child(3n+1):hover,
.card:nth-child(3n+1):hover {
  box-shadow: 0 4px 20px rgba(255, 105, 180, 0.15);
  outline-color: rgba(255, 105, 180, 0.4);
}

.luna-card--pink:hover h2,
.luna-card--pink:hover h3,
.luna-card:nth-child(3n+1):hover h2,
.card:nth-child(3n+1):hover h2,
.card:nth-child(3n+1):hover h3 {
  color: #ff69b4;
}

/* Card 2 – Gradient accent (same 4px top strip as pink/blue; content aligned) */
.luna-card--gradient,
.luna-card:nth-child(3n+2),
.luna-card-list .luna-card:nth-child(3n+2),
.card:nth-child(3n+2),
.card-list .card:nth-child(3n+2) {
  position: relative;
  border-top: none;
  overflow: hidden;
  padding-top: calc(4px + var(--space-lg));
}

.luna-card--gradient::before,
.luna-card:nth-child(3n+2)::before,
.card:nth-child(3n+2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--luna-gradient);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  z-index: 0;
}

.luna-card--gradient:hover,
.luna-card:nth-child(3n+2):hover,
.card:nth-child(3n+2):hover {
  box-shadow: 0 4px 24px rgba(255, 105, 180, 0.12), 0 4px 24px rgba(122, 215, 240, 0.12);
  outline: none;
}

.luna-card--gradient:hover h2,
.luna-card--gradient:hover h3,
.luna-card:nth-child(3n+2):hover h2,
.card:nth-child(3n+2):hover h2,
.card:nth-child(3n+2):hover h3 {
  color: var(--text-header-dark);
}

/* Card 3 – Blue accent */
.luna-card--blue,
.luna-card:nth-child(3n+3),
.luna-card-list .luna-card:nth-child(3n+3),
.card:nth-child(3n+3),
.card-list .card:nth-child(3n+3) {
  border-top: 4px solid #7ad7f0;
}

.luna-card--blue:hover,
.luna-card:nth-child(3n+3):hover,
.card:nth-child(3n+3):hover {
  box-shadow: 0 4px 20px rgba(122, 215, 240, 0.2);
  outline-color: rgba(122, 215, 240, 0.5);
}

.luna-card--blue:hover h2,
.luna-card--blue:hover h3,
.luna-card:nth-child(3n+3):hover h2,
.card:nth-child(3n+3):hover h2,
.card:nth-child(3n+3):hover h3 {
  color: #7ad7f0;
}

/* Card links – match card colour, NO default blue */
.luna-card a,
.card a {
  color: inherit;
  text-decoration: none;
}

.luna-card--pink a,
.luna-card:nth-child(3n+1) a,
.card:nth-child(3n+1) a {
  color: #ff69b4;
}

.luna-card--pink a:hover,
.luna-card:nth-child(3n+1) a:hover {
  text-decoration: underline;
}

.luna-card--gradient a,
.luna-card:nth-child(3n+2) a,
.card:nth-child(3n+2) a {
  color: var(--text-header-dark);
}
.luna-card--gradient a:hover,
.luna-card:nth-child(3n+2) a:hover,
.card:nth-child(3n+2) a:hover {
  color: var(--luna-pink);
}

.luna-card--blue a,
.luna-card:nth-child(3n+3) a,
.card:nth-child(3n+3) a {
  color: #7ad7f0;
}

.luna-card--blue a:hover,
.luna-card:nth-child(3n+3) a:hover {
  text-decoration: underline;
}

/* Buttons inside cards: always visible (override card link colour) */
.card a.btn-secondary,
.card a.btn-ghost,
.luna-card a.btn-secondary,
.luna-card a.btn-ghost {
  color: var(--text-primary-dark);
}
.card a.btn-secondary:hover,
.luna-card a.btn-secondary:hover {
  color: var(--text-header-dark);
}

/* Card without accent – plain/neutral */
.card-plain,
.luna-card--plain {
  border-top: 1px solid var(--border-color-light) !important;
}

.card-plain::before,
.luna-card--plain::before {
  display: none !important;
}

/* Explicit 3-colour accents (deterministic; overrides nth-child) */
.card-accent-pink,
.card.card-accent-pink,
.card-plain.card-accent-pink {
  border-top: 4px solid var(--luna-pink) !important;
}
.card-accent-pink:hover h2,
.card-accent-pink:hover h3,
.card.card-accent-pink:hover h2,
.card.card-accent-pink:hover h3,
.card-plain.card-accent-pink:hover h2,
.card-plain.card-accent-pink:hover h3 { color: var(--luna-pink); }

.card-accent-gradient,
.card.card-accent-gradient,
.card-plain.card-accent-gradient {
  border-top: none !important;
  position: relative;
  overflow: hidden;
}
.card-accent-gradient::before,
.card.card-accent-gradient::before,
.card-plain.card-accent-gradient::before {
  display: block !important;
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--luna-gradient);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  z-index: 0;
}
.card-accent-gradient:hover h2,
.card-accent-gradient:hover h3,
.card.card-accent-gradient:hover h2,
.card.card-accent-gradient:hover h3,
.card-plain.card-accent-gradient:hover h2,
.card-plain.card-accent-gradient:hover h3 { color: var(--text-header-dark); }

/* Gradient-accent cards: header becomes gradient on hover (learner profile, etc.) */
.card-accent-gradient:hover h2,
.card-accent-gradient:hover h3,
.card.card-accent-gradient:hover h2,
.card.card-accent-gradient:hover h3,
.card-plain.card-accent-gradient:hover h2,
.card-plain.card-accent-gradient:hover h3 {
  background-image: var(--luna-gradient) !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

.card-accent-blue,
.card.card-accent-blue,
.card-plain.card-accent-blue {
  border-top: 4px solid var(--luna-blue) !important;
}
.card-accent-blue:hover h2,
.card-accent-blue:hover h3,
.card.card-accent-blue:hover h2,
.card.card-accent-blue:hover h3,
.card-plain.card-accent-blue:hover h2,
.card-plain.card-accent-blue:hover h3 { color: var(--luna-blue); }

.card-plain:hover h2,
.card-plain:hover h3 {
  color: var(--text-header-dark) !important;
  background: none !important;
  -webkit-text-fill-color: inherit !important;
}

/* Dashboard commissioning card: never switch to brand pink on hover; keep RAG edge */
.dashboard-main #commissioning-status-card:hover {
  border-top-color: inherit !important;
}

.dashboard-main #commissioning-status-card.commissioning-card--awaiting:hover,
.dashboard-main #commissioning-status-card.commissioning-card--awaiting:focus-within {
  border-color: #f59e0b !important;
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.18);
}

/* SINGLE CARD RULE: One card in section = GRADIENT (never pink-only) */
.luna-card--single,
.luna-card:only-child,
.card:only-child {
  position: relative;
  border-top: none;
  background: #ffffff;
  overflow: hidden;
}
.luna-card--single.luna-card--gradient,
.luna-card--single.card-actions--center {
  padding-top: calc(4px + var(--space-lg));
}

.luna-card--single::before,
.luna-card:only-child::before,
.card:only-child::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--luna-gradient);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.luna-card--single:hover,
.luna-card:only-child:hover,
.card:only-child:hover {
  box-shadow: 0 4px 24px rgba(255, 105, 180, 0.12), 0 4px 24px rgba(122, 215, 240, 0.12);
}

.luna-card--single:hover h2,
.luna-card--single:hover h3,
.luna-card:only-child:hover h2,
.luna-card:only-child:hover h3,
.card:only-child:hover h2,
.card:only-child:hover h3 {
  color: var(--text-header-dark);
}

/* Hero card – gradient accent when standalone */
.card-hero {
  background: #ffffff;
  padding: var(--space-xl);
}

.card-hero.luna-card--gradient,
.card-hero.luna-card--single {
  background: #ffffff;
}

.card-hero h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

/* Status card – compact metric */
.card-status {
  padding: var(--space-md);
  text-align: center;
}

.card-status .status-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-header-dark);
  line-height: 1.2;
}

.card-status .status-label {
  font-size: 0.85rem;
  color: var(--text-secondary-dark);
  margin-top: var(--space-xs);
}

.status-value--ok { color: #16a34a; }
.status-value--warn { color: #dc2626; }
.card-status--warn { border-left: 4px solid #dc2626 !important; }

/* Card grid layout */
.card-grid,
.luna-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.card-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (min-width: 768px) {
  .card-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Settings page – compact cards, aligned grid */
.settings-main .page-title { margin-bottom: var(--space-sm); }
.settings-main .page-subtitle { margin-bottom: var(--space-lg); }
.settings-main .card.card-plain {
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}
.settings-main .card h2 { font-size: 1rem; margin-bottom: var(--space-xs); }
.settings-main .card h3 { font-size: 0.95rem; margin-bottom: var(--space-xs); }
.settings-main .card p.text-muted { font-size: 0.875rem; margin-bottom: var(--space-sm); }
.settings-main .settings-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .settings-main .settings-grid { grid-template-columns: repeat(2, 1fr); }
}
.settings-main .settings-grid .card { margin-bottom: 0; }

/* Extra breathing room before Support card on Settings */
.settings-main #ticket-card {
  margin-top: var(--space-xl);
}

/* =====================================
   BUTTONS – Touch-friendly, calm
   ===================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--touch-target);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius);
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: var(--button-gradient);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.25);
  transition: var(--transition-normal);
}

.btn:hover {
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.35);
}

.btn-secondary {
  background: var(--bg-light);
  /* Override .btn's white text */
  color: var(--text-header-dark) !important;
  box-shadow: none;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: var(--border-color-light);
  color: var(--text-header-dark);
  transform: none;
  box-shadow: none;
}

/* Amber button for high priority / action needed */
.btn-warning {
  background: #fef3c7;
  color: #92400e !important;
  box-shadow: none;
  border: 1px solid #f59e0b;
}
.btn-warning:hover {
  background: #fde68a;
  color: #92400e !important;
  box-shadow: none;
  transform: none;
}

.btn-ghost {
  background: transparent;
  /* Override .btn's white text */
  color: var(--text-primary-dark) !important;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--bg-light);
  transform: none;
  box-shadow: none;
}

.btn-ghost.active {
  background: var(--bg-light);
  font-weight: 600;
}

.btn-danger {
  background: #ef4444;
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover { 
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-sm { 
  min-height: 36px;
  padding: var(--space-xs) var(--space-md);
  font-size: 0.85rem;
}

/* Luna brand button trio: blue · pink→blue gradient · pink */
.btn-luna-blue {
  background: var(--luna-blue);
  color: #1e293b !important;
  box-shadow: 0 2px 8px rgba(122, 215, 240, 0.45);
  border: none;
}
.btn-luna-blue:hover {
  background: #5ec9e8;
  color: #1e293b !important;
  box-shadow: 0 4px 12px rgba(122, 215, 240, 0.55);
}

.btn-luna-gradient {
  background: var(--luna-gradient);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.25);
  border: none;
}
.btn-luna-gradient:hover {
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.35);
}

.btn-luna-pink {
  background: var(--luna-pink);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.35);
  border: none;
}
.btn-luna-pink:hover {
  background: #ff4da6;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.45);
}

.btn-lg {
  min-height: 52px;
  padding: var(--space-md) var(--space-xl);
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

/* Quick action button - calm, less prominent */
.btn-action {
  background: var(--bg-content-lighter-light);
  color: var(--text-primary-dark);
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-soft);
}

.btn-action:hover {
  border-color: var(--luna-pink);
  color: var(--luna-pink);
  transform: none;
  box-shadow: var(--shadow-soft);
}

/* Text */
.text-muted { color: var(--text-secondary-dark); font-size: 0.9rem; }

/* RAG – semantic colours (red=action needed, amber=review, green=compliant) */
.rag-red { color: var(--rag-red); font-weight: 600; }
.rag-amber { color: var(--rag-amber); font-weight: 600; }
.rag-green { color: var(--rag-green); font-weight: 600; }
.status-pill { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status-pill.status-red { background: rgba(220,38,38,0.15); color: var(--rag-red); }
.status-pill.status-amber { background: rgba(217,119,6,0.15); color: var(--rag-amber); }
.status-pill.status-green { background: rgba(22,163,74,0.15); color: var(--rag-green); }
.status-border.status-red { border-left-color: var(--rag-red); }
.status-border.status-amber { border-left-color: var(--rag-amber); }
.status-border.status-green { border-left-color: var(--rag-green); }
.status-bg.status-red { background: rgba(220,38,38,0.06); }
.status-bg.status-amber { background: rgba(217,119,6,0.08); }
.status-bg.status-green { background: rgba(22,163,74,0.06); }

/* =====================================
   FORMS – Touch-friendly inputs
   ===================================== */
.form-group { margin-bottom: var(--space-md); }
.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-header-dark);
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 400px;
  min-height: var(--touch-target);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg-content-lighter-light);
  color: var(--text-primary-dark);
  transition: var(--transition-fast);
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--luna-pink);
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.form-group textarea { 
  min-height: 100px;
  resize: vertical;
}

.form-group .form-hint {
  font-size: 0.8rem;
  color: var(--text-secondary-dark);
  margin-top: var(--space-xs);
}

/* Password field + show/hide toggle */
.form-group .password-field-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 400px;
}
.form-group .password-field-wrap input[type="password"],
.form-group .password-field-wrap input[type="text"].luna-password-visible {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-right: 2.75rem;
}
.password-toggle-btn {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary-dark);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.password-toggle-btn:hover {
  color: var(--text-header-dark);
  background: rgba(0, 0, 0, 0.04);
}
.password-toggle-btn:focus-visible {
  outline: 2px solid var(--luna-pink);
  outline-offset: 2px;
}

/* Tables */
.table-wrap { overflow-x: auto; }
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-primary-dark);
}
th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-header-dark);
}
tr:hover { background: var(--bg-light); }

/* Learners list: student name link in black (not brand pink) */
.learner-name-link { color: #111 !important; text-decoration: none; }
.learner-name-link:hover { color: #333 !important; text-decoration: underline; }

/* Alerts – theme only */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  background: var(--bg-content-lighter-light);
  border: 1px solid var(--border-color-light);
  color: var(--text-primary-dark);
}

.alert-warning {
  border-left: 4px solid var(--primary);
}

.alert-info {
  border-left: 4px solid var(--secondary);
}

.alert-success {
  border-left: 4px solid var(--primary);
}

/* Commissioner / QA notice */
.commissioner-notice {
  background: var(--bg-content-lighter-light);
  border: 1px solid var(--secondary);
  border-left: 4px solid var(--secondary);
  color: var(--text-primary-dark);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Guided panel */
.guided-panel {
  background: var(--bg-content-lighter-light);
  border: 1px solid var(--border-color-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--card-radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.guided-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text-header-dark);
}

.guided-panel ul { margin: 0; padding-left: 1.25rem; }

/* RAG grid – semantic status colours (red/amber/green) */
.rag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.rag-grid .item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--border-color-light);
  border-left: 4px solid var(--text-secondary-dark);
  font-size: 0.9rem;
  color: var(--text-primary-dark);
}

/* RAG edge: red / amber / green by status (approved, in review, action needed) */
.rag-grid .item.red { border-left-color: var(--rag-red); background: rgba(220,38,38,0.06); }
.rag-grid .item.amber { border-left-color: var(--rag-amber); background: rgba(217,119,6,0.08); }
.rag-grid .item.green { border-left-color: var(--rag-green); background: rgba(22,163,74,0.06); }
.rag-grid .item,
.rag-grid .item a { color: #1e293b; }

/* Login – centred, clean, operating system login */
/* When splash is active, hide form so only splash is visible; after splash, form fades in */
body.luna-splash-active .login-wrap {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}
body.splash-done .login-wrap {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
/* Sign-in card keeps logo + LUNA text (no extra title); splash unchanged */
.login-form-title {
  display: none !important;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
}

.login-box {
  background: #ffffff;
  isolation: isolate;
  padding: 2rem;
  border-radius: var(--card-radius);
  box-shadow: 0 4px 12px var(--card-shadow);
  border: 1px solid var(--border-color-light);
  width: 100%;
  max-width: 380px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.login-box form {
  text-align: center;
}

.brand-hierarchy-login .brand-subtitle {
  font-size: 1rem;
  color: var(--text-header-dark);
  margin: 0 0 0.5rem 0;
}
.brand-hierarchy-login h1.luna-text-gradient {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.login-logo-placeholder,
.luna-logo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0.5rem auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.login-logo-placeholder { background: var(--luna-gradient); }
.luna-logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.login-logo-placeholder img,
.luna-logo-placeholder img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
/* Logo img visible when it has src (index/demo/founder/admin) – no JS required for display */
.login-logo-placeholder img.login-logo-img,
.login-logo-placeholder img#luna-platform-logo,
.luna-logo-placeholder img {
  display: block;
}
.demo-private-message { margin: 1rem 0; color: var(--text-secondary-dark); }
.demo-subtitle { font-size: 0.9rem; color: var(--text-secondary-dark); }
.login-box .system-instance-id {
  font-size: 0.7rem;
  color: var(--text-secondary-dark);
  margin: 0 0 1.25rem 0;
  text-align: center;
}

.login-box .form-group {
  margin-bottom: 0.75rem;
  text-align: left;
}
.login-box .form-group label { text-align: left; }
.login-box .form-group input:not([type="checkbox"]) { max-width: 100%; }
.login-box .form-group .password-field-wrap { max-width: 100%; }
.login-box .form-group-checkbox { text-align: left; margin-bottom: 0.5rem; }
.login-box .form-group-checkbox .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary-dark);
}
/* Remember me: original style – solid blue when checked (Lauren + whitelabel) */
.login-box .form-group-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border-color-light);
  border-radius: 3px;
  background: var(--bg-content-lighter-light);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.login-box .form-group-checkbox input[type="checkbox"]:hover {
  border-color: #1e90ff;
}
.login-box .form-group-checkbox input[type="checkbox"]:checked {
  background: #1e90ff;
  border-color: #1e90ff;
}
.login-box .form-group-checkbox input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  width: 0.28rem;
  height: 0.5rem;
  margin: 0.12rem 0 0 0.28rem;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* Login footer – bottom of sign-in modal, centered, same H1 gradient on LUNA (Lauren + whitelabel) */
.login-box .login-page-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  font-size: 0.8rem;
  text-align: center;
  border-top: none;
}
.login-box .login-page-footer .login-footer-line1 {
  display: block;
  color: var(--text-secondary-dark);
  margin-bottom: 0.2rem;
}
.login-box .login-page-footer .login-footer-line2 {
  display: block;
}
.login-box .login-page-footer .login-footer-line2.luna-text-gradient {
  display: inline-block;
}
/* Secure sign-in message – data only through this login */
.login-secure-message {
  font-size: 0.8rem;
  text-align: center;
  margin: 0.5rem 0 0;
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}
.login-box .btn {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.5rem;
  border-radius: var(--radius);
  background: var(--button-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.35);
}
.login-box .pwa-install { margin-top: 1rem; font-size: 0.85rem; }
.login-box .pwa-install button { font-size: 0.85rem; padding: 0.4rem 0.8rem; }

.login-box .alert.alert-info { font-size: 0.9rem; }
.login-box h2.page-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.login-box p.text-muted { margin-bottom: 1rem; }
.login-box .subtitle { color: var(--text-secondary-dark); font-size: 0.9rem; margin-bottom: 1.25rem; text-align: center; }

/* Founder / Admin login boxes – accent on button only; title always LUNA / A.P Operating System */
.founder-login-box .btn { background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%); }
.admin-login-box .btn { background: linear-gradient(135deg, #1e90ff 0%, #7ad7f0 100%); }

/* Founder / Support under sign-in (Lauren / Allissa centre only) */
.login-footer-access {
  margin-top: 1rem;
  text-align: center;
  width: 100%;
}
.login-footer-access a {
  text-decoration: none;
  font-weight: 600;
}
/* Sign-in (index/demo/PWA): Founder = LUNA pink, Support = LUNA blue – single rule for all */
a.founder-link,
#login-footer-founder {
  color: #ff69b4 !important;
  -webkit-text-fill-color: #ff69b4 !important;
}
a.admin-link,
#login-footer-support {
  color: #7ad7f0 !important;
  -webkit-text-fill-color: #7ad7f0 !important;
}
a.founder-link:hover,
a.founder-link:active,
a.founder-link:focus,
#login-footer-founder:hover,
#login-footer-founder:active,
#login-footer-founder:focus {
  color: #ff69b4 !important;
  -webkit-text-fill-color: #ff69b4 !important;
  text-decoration: underline;
}
a.admin-link:hover,
a.admin-link:active,
a.admin-link:focus,
#login-footer-support:hover,
#login-footer-support:active,
#login-footer-support:focus {
  color: #7ad7f0 !important;
  -webkit-text-fill-color: #7ad7f0 !important;
  text-decoration: underline;
}
.centre-link {
  font-weight: 600;
  text-decoration: none;
}
.centre-link:hover,
.centre-link:active,
.centre-link:focus {
  text-decoration: underline;
}
/* Founder sign-in: ← Centre = LUNA pink (default + hover/click) */
.founder-login-box .mt-2 a.centre-link {
  color: #ff69b4 !important;
  -webkit-text-fill-color: #ff69b4 !important;
}
.founder-login-box .mt-2 a.centre-link:hover,
.founder-login-box .mt-2 a.centre-link:active,
.founder-login-box .mt-2 a.centre-link:focus {
  color: #ff69b4 !important;
  -webkit-text-fill-color: #ff69b4 !important;
  text-decoration: underline;
}
/* Support sign-in: ← Centre = LUNA blue (default + hover/click) */
.admin-login-box .mt-2 a.centre-link {
  color: #7ad7f0 !important;
  -webkit-text-fill-color: #7ad7f0 !important;
}
.admin-login-box .mt-2 a.centre-link:hover,
.admin-login-box .mt-2 a.centre-link:active,
.admin-login-box .mt-2 a.centre-link:focus {
  color: #7ad7f0 !important;
  -webkit-text-fill-color: #7ad7f0 !important;
  text-decoration: underline;
}
/* In-app header: Founder | Support switches */
.nav-switch { margin-left: 0.5rem; font-size: 0.9rem; }
.nav-link-founder, .nav-link-admin { text-decoration: none; font-weight: 500; }
.nav-link-founder { color: var(--luna-pink, #ff1493); }
.nav-link-founder:hover { text-decoration: underline; }
.nav-link-admin { color: var(--luna-blue, #1e90ff); }
.nav-link-admin:hover { text-decoration: underline; }
.nav-switch-divider { margin: 0 0.4rem; color: var(--text-secondary-dark); font-weight: 400; }
.divider {
  margin: 0 0.5rem;
  color: var(--text-secondary-dark);
}

/* Founder/Admin link – Founder pink gradient, Admin access blue gradient */
.admin-link { text-decoration: none; font-weight: 500; }
.admin-link-founder {
  background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-link-admin {
  background: linear-gradient(135deg, #1e90ff 0%, #7ad7f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-link:hover .admin-link-founder,
.admin-link:hover .admin-link-admin { opacity: 0.9; }
.clear-demo-link { color: var(--text-secondary-dark); text-decoration: none; font-size: 0.9rem; }
.clear-demo-link:hover { color: var(--text-header-dark); text-decoration: underline; }

/* Footer – HTML mode only; thin strip; LUNA ownership always asserted */
.app-footer {
  background: var(--footer-bg-light);
  color: var(--footer-text-primary-dark);
  padding: 0.5rem 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color-light);
  font-size: 0.8rem;
  text-align: center;
}

body.has-html-shell .app-footer { display: block; }
body.has-bottom-nav .app-footer { display: none !important; }

.app-footer .footer-copyright { color: var(--footer-text-secondary-dark); }
.app-footer .footer-line1,
.app-footer .footer-line2 { color: var(--footer-text-secondary-dark); display: block; }
.app-footer .footer-line3 { color: var(--footer-text-secondary-dark); font-size: 0.75rem; display: block; margin-top: 0.15rem; }
.app-footer .brand-subtitle { color: var(--footer-text-primary-dark); }
.app-footer .secondary { color: var(--footer-text-secondary-dark); }

/* =====================================
   DEMO LANDING – Premium showcase
   ===================================== */
.demo-landing {
  min-height: 100vh;
  background: var(--luna-gradient-soft);
}

.demo-hero {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--luna-gradient);
  color: white;
}

.demo-hero-logo {
  margin-bottom: var(--space-sm);
}
.demo-hero-logo img {
  border-radius: var(--radius);
}
.demo-hero .brand-luna,
.demo-hero .demo-hero-title {
  font-size: 4rem;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
  margin-bottom: var(--space-sm);
}

.demo-hero .hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.95;
  margin-bottom: var(--space-xs);
}

.demo-hero .hero-tagline {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

.demo-backend-alert {
  max-width: 600px;
  margin: 1rem auto;
}

.demo-cta-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-2xl);
}

.demo-cta-note {
  font-size: 0.85rem;
  margin-top: var(--space-sm);
}

.demo-features-title {
  font-size: 1.75rem;
  font-weight: 600;
}

.demo-hero .hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

.demo-hero .btn-cta-primary {
  background: #ffffff;
  color: #ff69b4;
  font-weight: 600;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: box-shadow var(--transition-normal);
}

.demo-hero .btn-cta-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.demo-hero .btn-cta-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  font-weight: 500;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.demo-hero .btn-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #ffffff;
}

.demo-features {
  padding: var(--space-2xl) var(--space-lg);
  max-width: 1000px;
  margin: 0 auto;
}

.demo-features h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
  font-size: 1.5rem;
  color: var(--text-header-dark);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

/* Feature cards use LUNA 3-card pattern */
.feature-card {
  background: #ffffff;
  border-radius: var(--card-radius);
  padding: var(--space-xl);
  text-align: center;
  border: 1px solid var(--border-color-light);
  transition: box-shadow var(--transition-normal), outline var(--transition-normal);
  outline: 2px solid transparent;
  outline-offset: -1px;
}

.feature-grid .feature-card:nth-child(3n+1) {
  border-top: 4px solid #ff69b4;
}

.feature-grid .feature-card:nth-child(3n+1):hover {
  box-shadow: 0 4px 20px rgba(255, 105, 180, 0.15);
  outline-color: rgba(255, 105, 180, 0.4);
}

.feature-grid .feature-card:nth-child(3n+1) .feature-icon { opacity: 1; }
.feature-grid .feature-card:nth-child(3n+2) {
  position: relative;
  border-top: none;
  overflow: hidden;
}
.feature-grid .feature-card:nth-child(3n+2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #ff69b4, #7ad7f0);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}
.feature-grid .feature-card:nth-child(3n+2):hover {
  box-shadow: 0 4px 24px rgba(255, 105, 180, 0.12), 0 4px 24px rgba(122, 215, 240, 0.12);
}
.feature-grid .feature-card:nth-child(3n+2) .feature-icon { opacity: 1; }
.feature-grid .feature-card:nth-child(3n+3):hover {
  box-shadow: 0 4px 20px rgba(122, 215, 240, 0.2);
  outline-color: rgba(122, 215, 240, 0.5);
}
.feature-grid .feature-card:nth-child(3n+3) .feature-icon { opacity: 1; }

.feature-card .feature-icon {
  font-size: 2.25rem;
  margin-bottom: var(--space-md);
  display: block;
  line-height: 1;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-header-dark);
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-secondary-dark);
  margin: 0;
}

/* =====================================
   SECTION HEADERS
   ===================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color-light);
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-header-dark);
  margin: 0;
  text-align: center;
}

.section-header .section-action {
  font-size: 0.85rem;
  color: var(--luna-pink);
  text-decoration: none;
}

.section-header .section-action:hover {
  text-decoration: underline;
}

/* =====================================
   UTILITIES
   ===================================== */
.hidden { display: none !important; }

/* Modal (commissioning review, etc.) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
}
.modal-overlay.hidden { display: none !important; }
.modal-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color, #eee);
}
.modal-title { margin: 0; font-size: 1.25rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted, #666);
  padding: 0;
  width: 2rem;
  height: 2rem;
}
.modal-close:hover { color: var(--text, #111); }
.modal-body { padding: var(--space-lg); }

/* Modal with LUNA gradient (Founder record sale, etc.) */
.modal-card--brand {
  position: relative;
  overflow: hidden;
  border-top: none;
}
.modal-card--brand::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #ff69b4, #7ad7f0);
  border-radius: var(--radius-lg, 8px) var(--radius-lg, 8px) 0 0;
}
.modal-card--brand .modal-header {
  padding-top: calc(var(--space-md) + 2px);
}

/* Full-width input inside modal or form-group */
.form-input-full {
  width: 100%;
  max-width: none;
  min-height: var(--touch-target);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg-content-lighter-light);
  color: var(--text-primary-dark);
}
.form-input-full:focus {
  outline: none;
  border-color: var(--luna-pink);
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

/* Founder: client/sale cards in card view – match project card style */
.founder-sale-card {
  border-top: 1px solid var(--border-color-light);
}
.founder-sale-card:nth-child(3n+1) { border-top: 4px solid #ff69b4; }
.founder-sale-card:nth-child(3n+2) {
  position: relative;
  border-top: none;
  overflow: hidden;
}
.founder-sale-card:nth-child(3n+2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff69b4, #7ad7f0);
}
.founder-sale-card:nth-child(3n+3) { border-top: 4px solid #7ad7f0; }

/* =====================================
   PWA SPLASH – Branded loading (pink→blue gradient, logo, pulse)
   Centred on all viewports; safe-area aware on mobile (notch, home bar).
   ===================================== */
.luna-splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.45s ease-out;
  pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}
.luna-splash-out {
  opacity: 0;
  pointer-events: none;
}
.luna-splash-bg {
  position: absolute;
  inset: 0;
  background: var(--luna-gradient);
  background-size: 200% 200%;
  animation: luna-splash-gradient 4s ease-in-out infinite;
}
.luna-splash-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: luna-splash-shine 2.5s ease-in-out infinite;
  pointer-events: none;
}
.luna-splash-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
}
.luna-splash-logo {
  display: block;
  width: 140px;
  height: 140px;
  max-width: min(140px, 35vw);
  max-height: min(140px, 35vw);
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  animation: luna-splash-pulse 2s ease-in-out infinite;
}
.luna-splash-text {
  display: block;
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
@keyframes luna-splash-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes luna-splash-shine {
  0%, 100% { background-position: -100% 0; }
  50% { background-position: 200% 0; }
}
@keyframes luna-splash-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.92; transform: scale(1.06); }
}

/* Commissioning timeline – horizontal, branded (same 3-step style as dashboard) */
.commissioning-progress-bar-wrap {
  height: 10px;
  background: var(--bg-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.commissioning-progress-bar {
  height: 100%;
  background: var(--luna-gradient);
  border-radius: var(--radius);
  transition: width 0.3s ease;
}
.timeline-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.timeline-steps--horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-lg);
}
.timeline-steps--horizontal .timeline-step {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
}
.timeline-step-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.timeline-step > div { text-align: center; }
.timeline-step--branded.timeline-step--1 .timeline-step-icon { background: #ff69b4; }
.timeline-step--branded.timeline-step--2 .timeline-step-icon { background: linear-gradient(135deg, #ff69b4, #7ad7f0); }
.timeline-step--branded.timeline-step--3 .timeline-step-icon { background: #7ad7f0; }
.timeline-step.done .timeline-step-icon { background: var(--success, #22c55e) !important; }
.review-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}
.review-cards-grid .document-card,
.review-cards-grid .review-card-clickable {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color-light);
  border-top: none;
  position: relative;
  padding-top: calc(4px + var(--space-md));
  text-align: center;
}
/* Gradient card: strip 5px so it matches visual weight of 4px solid borders */
.review-cards-grid .document-card:nth-child(3n+2),
.review-cards-grid .review-card-clickable:nth-child(3n+2) {
  padding-top: calc(5px + var(--space-md));
}
.review-cards-grid .document-card .doc-icon,
.review-cards-grid .review-card-clickable .doc-icon { margin-left: auto; margin-right: auto; }
.review-cards-grid .document-card::before,
.review-cards-grid .review-card-clickable::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.review-cards-grid .document-card:nth-child(3n+1)::before,
.review-cards-grid .review-card-clickable:nth-child(3n+1)::before { background: var(--luna-pink); }
.review-cards-grid .document-card:nth-child(3n+2)::before,
.review-cards-grid .review-card-clickable:nth-child(3n+2)::before {
  background: var(--luna-gradient);
  height: 5px;
}
.review-cards-grid .document-card:nth-child(3n+3)::before,
.review-cards-grid .review-card-clickable:nth-child(3n+3)::before { background: var(--luna-blue); }
.review-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.review-card-clickable:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.review-card-clickable .doc-icon { font-size: 1.5rem; }
.review-card-clickable .doc-title,
.review-card-clickable .doc-meta,
.review-card-clickable p { color: #1e293b; }
.review-card-comment { color: var(--text-secondary-dark); font-style: italic; }
.review-status-badge { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.review-status-badge.Pending { background: #fef3c7; color: #92400e; }
.review-status-badge.Approved { background: #d1fae5; color: #065f46; }
.review-status-badge.Needs_Changes { background: #fee2e2; color: #991b1b; }

/* LA/QA document review by category – expand each category to see documents */
.review-category-block { border: 1px solid var(--border-color-light); border-radius: var(--radius); overflow: hidden; }
.review-category-details { padding: 0; }
.review-category-summary {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.review-category-summary::-webkit-details-marker { display: none; }
.review-category-summary::before { content: '▶'; font-size: 0.75rem; transition: transform 0.2s ease; }
.review-category-details[open] .review-category-summary::before { transform: rotate(90deg); }
.review-category-count { font-weight: 400; color: var(--text-secondary-dark); font-size: 0.9rem; }
.review-category-details .review-cards-grid { padding: var(--space-md); }

.btn-gradient { background: var(--button-gradient); color: #fff; border: none; border-radius: var(--radius); }
.section-header--center { justify-content: center !important; text-align: center; }
.section-header--center h2 { margin-left: auto; margin-right: auto; text-align: center; }
/* Stacked section header: title and subtitle centred on their own lines (e.g. Audit Log + Last 20 entries) */
.commissioning-section.section-header.section-header--stack,
.section-header.section-header--stack {
  flex-direction: column !important;
  gap: var(--space-xs);
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
}
.section-header--stack h2 { text-align: center !important; width: 100%; }
.section-header--stack .text-muted { text-align: center; display: block; }

/* QA schedule row (LA/QA) */
.qa-schedule-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}
.qa-schedule-row--center,
.qa-visits-card--center .qa-schedule-row {
  justify-content: center;
}
.qa-visits-card--center {
  text-align: center;
}
.qa-schedule-row input[type="date"],
.qa-schedule-row input[type="text"] { max-width: 12rem; }
.centre-qa-response-card { padding: var(--space-md); text-align: center; }
.centre-qa-response-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}
.centre-qa-response-actions .reschedule-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}
.centre-qa-response-actions .btn-accept { background: var(--rag-green, #16a34a); color: #fff; border: none; border-radius: var(--radius); }
.centre-qa-response-actions .btn-reject { background: var(--rag-red, #dc2626); color: #fff; border: none; border-radius: var(--radius); }
.centre-qa-response-actions .btn-reschedule { background: var(--luna-blue); color: #fff; border: none; border-radius: var(--radius); }
.section-header--center h2 { margin-left: auto; margin-right: auto; }
.mr-2 { margin-right: var(--space-sm); }

/* Centred CTAs (Export pack, sign-off Save, etc.) – force centre alignment */
.card-actions--center,
.card.card-actions--center,
.luna-card.card-actions--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card-actions--center p,
.card.card-actions--center p,
.luna-card.card-actions--center p {
  text-align: center;
  max-width: 100%;
}
.card-actions--center .cta-wrap,
.card.card-actions--center .cta-wrap,
.luna-card.card-actions--center .cta-wrap,
.cta-wrap {
  text-align: center;
  margin-top: var(--space-md);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  width: 100%;
}
.cta-wrap .btn { flex-shrink: 0; }

/* Equal-sized CTA pairs (e.g. Export buttons) */
.cta-wrap--equal .btn {
  margin: 0 !important;
  min-width: 240px;
}

@media (max-width: 520px) {
  /* Mobile: prevent fixed-width CTAs from causing horizontal scroll */
  .cta-wrap--equal .btn {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Brand-coloured inline links (Shortcuts, etc.) */
.luna-link { font-weight: 600; text-decoration: none; }
.luna-link:hover { text-decoration: underline; }
.luna-link--pink { color: var(--luna-pink, #ff69b4) !important; }
.luna-link--blue { color: var(--luna-blue, #7ad7f0) !important; }
.luna-link--gradient {
  background: var(--luna-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.luna-link--gradient:hover { opacity: 0.9; }

/* Commissioning pack: centred sections (QA, Audit log, Export pack) */
.commissioning-section { text-align: center; }
.commissioning-section .card { margin-left: auto; margin-right: auto; }
.card-actions--center .table-wrap--center { width: 100%; }
.card-actions--center .table-wrap--center table { margin-left: auto; margin-right: auto; }

/* Card with centred form fields + CTA (sign-off, etc.) – aligned and neat */
.card-form--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card-form--center .section-header,
.card-form--center p { text-align: center; }
.card-form--center .signoff-fields,
.card-form--center .form-fields--center {
  width: 100%;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.card-form--center .signoff-fields .form-group,
.card-form--center .form-fields--center .form-group {
  max-width: 100%;
}
.card-form--center .cta-wrap {
  margin-top: var(--space-md);
}
.card-form--center .form-inline-block--center,
.card-form--center .form-inline-block {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 520px) {
  /* Mobile: inline forms should stack cleanly */
  .form-inline-block,
  .card-form--center .form-inline-block--center,
  .card-form--center .form-inline-block {
    flex-direction: column;
    align-items: stretch;
  }
  .form-inline-block .form-group,
  .card-form--center .form-inline-block .form-group {
    width: 100%;
    max-width: 100%;
  }
  .form-inline-block input,
  .form-inline-block select,
  .form-inline-block textarea {
    width: 100%;
    max-width: 100%;
  }
}
.card-form--center #comm-docs-list {
  text-align: center;
}
.qa-visits-card { padding: var(--space-sm) var(--space-md); }
.qa-visits-list { margin-top: var(--space-sm); font-size: 0.875rem; }
.qa-visits-list .table { margin-bottom: 0; }
.qa-schedule-row input[type="time"] { max-width: 6rem; }

/* QA visit calendar (commissioning pack) */
.qa-schedule-panel { text-align: center; max-width: 420px; margin: 0 auto var(--space-md); }
.qa-visit-selected-label { font-weight: 600; color: var(--text-primary-dark); }
.qa-visit-calendar-wrap { margin-bottom: var(--space-md); }
.qa-visit-cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.qa-visit-cal-month { font-weight: 600; min-width: 10rem; }
.qa-visit-cal-today { margin-bottom: var(--space-sm); }
.qa-visit-cal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
}
.qa-visit-cal-table th {
  padding: var(--space-xs);
  font-size: 0.8rem;
  color: var(--text-secondary-dark);
  font-weight: 600;
}
.qa-visit-cal-cell {
  padding: var(--space-xs);
  min-width: 2.25rem;
  min-height: 2.25rem;
  cursor: pointer;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  text-align: center;
  vertical-align: middle;
}
.qa-visit-cal-cell:hover:not(.is-disabled) { background: var(--bg-light); }
.qa-visit-cal-cell.is-today {
  outline: 2px solid rgba(255, 105, 180, 0.45);
  outline-offset: -2px;
}
.qa-visit-cal-cell.is-selected {
  background: rgba(122, 215, 240, 0.25);
  border-color: var(--luna-blue);
  font-weight: 700;
}
.qa-visit-cal-cell.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.qa-visit-cal-cell-empty { background: var(--bg-light); border: none; }
.qa-time-panel { margin-bottom: var(--space-md); }
.qa-time-panel-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-secondary-dark);
}
.qa-time-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}
.qa-time-slot {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.8rem;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}
.qa-time-slot.is-active {
  background: var(--luna-blue);
  color: #fff;
  border-color: var(--luna-blue);
}
.qa-visit-time-custom { max-width: 8rem; margin: 0 auto; }
.qa-visit-summary-input { max-width: 100%; margin-bottom: var(--space-sm); }
.centre-qa-reschedule-panel {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color-light);
}
.centre-qa-reschedule-panel .qa-visit-calendar-wrap { max-width: 360px; margin-left: auto; margin-right: auto; }
.commissioning-live-toast {
  position: relative;
  padding-right: 2.5rem;
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--luna-blue);
}
.commissioning-live-toast .commissioning-toast-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary-dark);
}

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.pt-2 { padding-top: var(--space-md); }
.pb-2 { padding-bottom: var(--space-md); }
.list-unstyled { list-style: none; padding: 0; }
.centre-name-value { font-size: 1.1rem; font-weight: 500; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* Canonical LUNA text: same as footer (login-footer-line2 luna-text-gradient). Size by context. */
.luna-text-gradient {
  color: #ff69b4;
  display: inline-block;
  font-weight: 800;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.5px;
  background-image: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 1;
  filter: none;
  mix-blend-mode: normal;
  text-shadow: none;
}

/* Page headers: gradient + Luna display weight; fit-content so short titles get full pink→blue */
.main h1.page-title.luna-text-gradient,
h1.page-title.luna-text-gradient,
.main h1.page-title.brand-luna,
h1.page-title.brand-luna {
  background-image: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%) !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.main h1.page-title.brand-luna.luna-text-gradient,
h1.page-title.brand-luna.luna-text-gradient {
  font-size: clamp(1.55rem, 2.8vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* Login / auth screens: short “LUNA” H1 – gradient on letters, not full row */
.brand-hierarchy-login h1.luna-text-gradient,
.login-box h1.luna-text-gradient,
.demo-login h1.luna-text-gradient {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Auth sub-headings (e.g. Reset password) – same fit-content gradient */
h2.page-title.luna-text-gradient {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  background-image: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%) !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* Policies: category hub grid + drill-in view */
.luna-policy-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 1120px;
  margin: var(--space-md) auto 0;
}

@media (min-width: 560px) {
  .luna-policy-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .luna-policy-hub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .luna-policy-hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.luna-policy-hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 1.35rem 1rem 1.15rem;
  min-height: 9.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.luna-policy-hub-card:hover,
.luna-policy-hub-card:focus {
  text-decoration: none;
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.12);
}

.luna-policy-hub-card__icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.luna-policy-hub-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.luna-policy-hub-card__count {
  margin: 0;
  font-size: 0.88rem;
}

.luna-policy-drill {
  max-width: 920px;
  margin: var(--space-md) auto 0;
}

.luna-policy-drill-nav {
  margin-bottom: var(--space-md);
}

.luna-policy-drill-panel {
  text-align: left;
  overflow: hidden;
}

.luna-policy-drill-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.luna-policy-drill-icon {
  font-size: 2.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.luna-policy-drill-title {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
}

.luna-policy-drill-meta {
  font-size: 0.92rem;
}

.luna-policy-drill-body {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.luna-policy-drill-body .luna-policy-doc-block,
.luna-policy-drill-body .luna-policy-version-item {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius, 8px);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  list-style: none;
}

.luna-policy-drill-body .luna-policy-version-list {
  margin: 0;
  padding: 0;
}

.luna-policy-category-hint {
  font-size: 0.95rem;
}

.luna-policy-category-list {
  display: none;
}

.luna-policy-staff-dbs-block,
.luna-policy-staff-member-block {
  margin-top: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius, 8px);
  overflow: hidden;
}

.luna-policy-staff-dbs-summary,
.luna-policy-staff-member-summary {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  background: rgba(248, 250, 252, 0.9);
}

.luna-policy-staff-dbs-summary::-webkit-details-marker,
.luna-policy-staff-member-summary::-webkit-details-marker { display: none; }

.luna-policy-staff-dbs-summary::before,
.luna-policy-staff-member-summary::before {
  content: '▶';
  font-size: 0.7rem;
  margin-right: 0.35rem;
  color: var(--luna-pink, #ec4899);
  transition: transform 0.2s ease;
}

.luna-policy-staff-dbs-block[open] > .luna-policy-staff-dbs-summary::before,
.luna-policy-staff-member-block[open] > .luna-policy-staff-member-summary::before {
  transform: rotate(90deg);
}

.luna-policy-staff-dbs-inner {
  padding: 0.5rem 0.75rem 0.75rem;
}

.luna-policy-staff-member-block {
  margin-left: 0.35rem;
}

.luna-policy-staff-member-body {
  padding: 0 0.75rem 0.75rem;
}

.luna-policy-staff-profile-link {
  margin: 0.35rem 0 0.65rem;
}

.luna-policy-scr-other {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.luna-policy-scr-other-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.luna-policy-category-card > p,
.luna-policy-category-card > details {
  text-align: left;
}

.luna-policy-doc-block {
  margin-top: 0.35rem;
}
.luna-policy-doc-title {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
  line-height: 1.35;
}
.luna-policy-doc-empty {
  margin: 0.35rem 0 0 0;
}
.luna-policy-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.luna-policy-card-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.luna-policy-card-buttons-primary {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-width: 0;
}
.luna-policy-card-buttons-primary .btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}
.luna-policy-multi-list .luna-policy-card-buttons-primary .btn {
  font-size: 0.78rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}
.luna-policy-review-status {
  width: 100%;
  margin-top: 0;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.luna-policy-la-note {
  background: #f8fafc;
  border-left: 3px solid var(--luna-blue, #3b82f6);
  padding: 0.35rem 0.5rem;
  border-radius: 0 4px 4px 0;
}
.luna-policy-multi-list .luna-policy-review-status {
  margin-top: 0.5rem;
}
.luna-policy-hs-stack {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(236, 72, 153, 0.25);
}
.review-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.15rem 0;
}
.review-thread--compact {
  gap: 0.65rem;
}
.review-thread--compact .review-thread-bubble {
  max-width: 92%;
}
.review-thread-msg {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}
.review-thread-msg--centre {
  align-items: flex-start;
}
.review-thread-msg--la {
  align-items: flex-end;
}
.review-thread-bubble {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  word-break: break-word;
}
.review-thread-msg--centre .review-thread-bubble {
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.14) 0%, rgba(122, 215, 240, 0.18) 100%);
  border: 1px solid rgba(255, 105, 180, 0.22);
  border-bottom-left-radius: 0.35rem;
}
.review-thread-msg--la .review-thread-bubble {
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-bottom-right-radius: 0.35rem;
}
.review-thread-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin: 0.25rem 0 0 0;
  padding: 0 0.35rem;
  line-height: 1.35;
}
.review-thread-msg--la .review-thread-meta {
  text-align: right;
}
.review-thread-body {
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--text-header-dark, #1e293b);
}
.review-thread-empty {
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
  margin: 0.5rem 0 0.35rem;
}
.review-chat-scroll {
  max-height: min(340px, 42vh);
  overflow-y: auto;
  padding: 0.35rem 0.15rem 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: #f8fafc;
}
.review-chat-composer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.review-chat-composer-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-header-dark, #1e293b);
  margin-bottom: 0.35rem;
  text-align: center;
}
.review-chat-input {
  min-height: 4.5rem;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(122, 215, 240, 0.45);
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.45;
  width: 100%;
  box-sizing: border-box;
}
.review-chat-input:focus {
  outline: none;
  border-color: var(--luna-pink, #ff69b4);
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.12);
}
.review-chat-send-wrap {
  margin-top: 0.65rem;
}

/* Policy document split view (View & discuss page) */
.policy-document-page .page-title-tight {
  margin-bottom: 0.35rem;
}
.policy-document-layout {
  display: grid;
  grid-template-columns: 1fr min(420px, 38vw);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) {
  .policy-document-layout {
    grid-template-columns: 1fr;
  }
}
.policy-document-panel-title {
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
}
.policy-preview-wrap {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  min-height: 480px;
}
.policy-preview-frame {
  width: 100%;
  height: min(72vh, 720px);
  border: 0;
  display: block;
  background: #fff;
}
.policy-document-actions {
  margin-top: 0.75rem;
}
.policy-document-actions.cta-wrap {
  justify-content: center;
}
.policy-document-sidebar {
  display: flex;
  flex-direction: column;
}
.policy-audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.8125rem;
}
.policy-audit-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.policy-audit-when {
  color: #64748b;
  margin-right: 0.35rem;
}

.luna-policy-versions {
  margin-top: 0.75rem;
}
.luna-policy-version-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  list-style: disc;
}
.luna-policy-version-item {
  margin-bottom: 0.65rem;
}
.luna-policy-version-item .luna-policy-card-actions {
  margin-top: 0.35rem;
}
.luna-policy-version-manage {
  margin-top: 0.35rem;
}

/* Settings: centre team / DSL role table */
.centre-team-list-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.5rem;
}
.centre-team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}
.centre-team-table th,
.centre-team-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border-color-light, #eee);
  vertical-align: middle;
}
.centre-team-table th {
  font-weight: 600;
  color: var(--text-muted, #666);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.centre-team-table select {
  max-width: 100%;
  min-width: 10rem;
}


/* Header brand 'LUNA' text – keep gradient on hover (avoid solid pink override) */
.brand-luna.luna-text-gradient,
.brand-luna.luna-text-gradient:hover {
  background-image: var(--luna-gradient) !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* =====================================
   LUNA HEADER – HTML/browser mode (no bottom nav)
   Full-width layout: brand (left) | nav (centre) | actions (right).
   No clipping – options stay visible; nav can wrap if needed.
   ===================================== */
#app-header,
header#app-header {
  display: block !important;
  min-height: var(--header-h);
  visibility: visible !important;
}

.app-header.app-header-luna {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  color: var(--text-header-dark);
  border-bottom: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-soft);
  min-height: var(--header-h);
  height: auto;
  padding: 0;
  align-items: stretch;
  overflow: visible;
}
/* Single row: logo | nav | hamburger (when narrow) | actions */
.app-header-luna .header-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: var(--header-h);
}
.app-header-luna .header-container .header-brand { flex-shrink: 0; }
.app-header-luna .header-container .header-app-menu { flex-shrink: 0; }
/* App menu: single "Menu" dropdown (Learners, Dashboard, etc.) */
.app-header-luna .header-app-menu {
  position: relative;
  flex-shrink: 0;
}
.app-header-luna .header-app-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-header-dark);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}
.app-header-luna .header-app-trigger:hover {
  background: var(--bg-light);
  border-color: var(--luna-pink);
  color: var(--luna-pink);
}
.app-header-luna .header-app-trigger-hamburger {
  flex-direction: column;
  padding: var(--space-sm) var(--space-md);
  gap: 4px;
}
.app-header-luna .header-app-trigger-hamburger .hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: var(--transition-fast);
}
.app-header-luna .header-app-trigger[aria-expanded="true"].header-app-trigger-hamburger .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.app-header-luna .header-app-trigger[aria-expanded="true"].header-app-trigger-hamburger .hamburger-line:nth-child(2) {
  opacity: 0;
}
.app-header-luna .header-app-trigger[aria-expanded="true"].header-app-trigger-hamburger .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.app-header-luna .header-app-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 4px;
  min-width: 220px;
  padding: var(--space-sm) 0;
  background: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  z-index: 100;
  max-height: 70vh;
  overflow-y: auto;
}
.app-header-luna .header-app-dropdown[hidden] {
  display: none;
}
.app-header-luna .header-app-group {
  padding: 0 var(--space-md);
  margin-bottom: var(--space-sm);
}
.app-header-luna .header-app-group:last-child {
  margin-bottom: 0;
}
.app-header-luna .header-app-group-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary-dark);
  margin-bottom: var(--space-xs);
  padding: var(--space-xs) 0 0;
  border-top: 1px solid var(--border-color-light);
}
.app-header-luna .header-app-group:first-child .header-app-group-label {
  border-top: none;
  padding-top: 0;
}
.app-header-luna .header-app-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  color: var(--text-header-dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}
.app-header-luna .header-app-link:hover {
  background: var(--luna-gradient-soft);
  color: var(--luna-pink);
}
.app-header-luna .header-app-link.active {
  background: rgba(255,105,180,0.12);
  color: var(--luna-pink);
  font-weight: 600;
}
.app-header-luna button.header-app-link-switch {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
/* Hamburger: hidden (legacy; nav now uses app menu) */
.app-header-luna .header-nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.app-header-luna .header-nav-toggle .hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-header-dark);
  border-radius: 1px;
}
.app-header-luna .header-nav-toggle:hover {
  background: var(--bg-light);
}
/* Nav menu overlay (slide-in panel, not a second row) when hamburger open */
.app-header-luna .header-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-lg);
  padding-top: calc(var(--header-h) + var(--space-md));
  z-index: 999;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  visibility: hidden;
}
.app-header-luna .header-nav-drawer[aria-hidden="false"],
body.header-nav-open .app-header-luna .header-nav-drawer {
  transform: translateX(0);
  visibility: visible;
}
body.header-nav-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 998;
}
.app-header-luna .header-nav-drawer .nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-header-luna .header-nav-drawer .nav a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
}
.app-header-luna .header-nav-drawer .nav-switch {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color-light);
  border-left: none;
  padding-left: 0;
  margin-left: 0;
}
.app-header-luna {
  position: relative;
}
@media (max-width: 1280px) {
  .app-header-luna .header-nav-wrap {
    display: none !important;
  }
  .app-header-luna .header-nav-toggle {
    display: flex;
  }
}
@media (min-width: 1281px) {
  .app-header-luna .header-nav-drawer {
    display: none !important;
  }
  body.header-nav-open::before {
    display: none;
  }
}
/* Left: logo + name (link, flex-shrink-0) */
.app-header-luna .header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  min-width: 0;
  max-width: 200px;
  padding-left: 0;
  text-decoration: none;
  color: inherit;
}
.app-header-luna .header-brand:hover {
  color: inherit;
  opacity: 0.9;
}
.app-header-luna .header-brand img,
.app-header-luna .header-brand .header-logo,
.app-header-luna .header-brand .tenant-logo {
  display: block;
  height: 40px;
  width: 40px;
  max-height: 40px;
  max-width: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.app-header-luna .brand-luna {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.app-header-luna .brand-apo {
  font-size: inherit;
  font-weight: 600;
  color: var(--text-header-dark);
  white-space: nowrap;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0.95;
}
@media (min-width: 1024px) {
  .app-header-luna .header-brand { max-width: 260px; }
  .app-header-luna .header-brand img,
  .app-header-luna .header-brand .header-logo,
  .app-header-luna .header-brand .tenant-logo { max-width: 48px; max-height: 40px; width: auto; }
  .app-header-luna .brand-luna,
  .app-header-luna .brand-apo { font-size: 1.25rem; }
}
/* Centre: nav (takes remaining space, can wrap so right isn’t cut off) */
.app-header-luna .header-nav-wrap {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
  gap: var(--space-xs);
  min-width: 0;
}
.app-header-luna .header-nav-wrap .nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}
/* Right: menu, search, export, notifications, sign out, avatar – order fixed; wraps on narrow screens */
.app-header-luna .header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  flex-shrink: 1;
  min-width: 0;
  padding-right: 0;
  margin-left: auto;
  justify-content: flex-end;
}
.app-header-luna .nav a {
  color: var(--text-secondary-dark);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-decoration: none;
}
.app-header-luna .nav a:hover {
  background: var(--bg-light);
  color: var(--text-header-dark);
}
.app-header-luna .nav a.active {
  background: linear-gradient(135deg, rgba(255,105,180,0.15), rgba(122,215,240,0.15));
  color: var(--text-header-dark);
  font-weight: 500;
}
.app-header-luna .nav-switch {
  margin-left: var(--space-sm);
  padding-left: var(--space-sm);
  border-left: 1px solid var(--border-color-light);
}
.app-header-luna .nav-link-founder,
.app-header-luna .nav-link-admin {
  color: var(--luna-pink) !important;
  font-size: 0.85rem !important;
}
.app-header-luna .search-wrap {
  position: relative;
  flex: 0 1 200px;
  min-width: 120px;
}
.app-header-luna .search-wrap input {
  width: 100%;
  min-width: 100px;
  max-width: 220px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--bg-content-lighter-light);
  color: var(--text-primary-dark);
  box-sizing: border-box;
}
.app-header-luna .search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  z-index: 101;
  padding: var(--space-xs);
}
.app-header-luna .search-results-dropdown[hidden] { display: none; }
.app-header-luna .search-results-group {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-color-light);
}
.app-header-luna .search-results-group:last-child { border-bottom: none; }
.app-header-luna .search-results-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary-dark);
  padding: var(--space-xs) var(--space-sm);
}
.app-header-luna .search-result-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  color: var(--text-header-dark);
  text-decoration: none;
  font-size: 0.9rem;
}
.app-header-luna .search-result-link:hover {
  background: var(--luna-gradient-soft);
  color: var(--luna-pink);
}
.app-header-luna .search-results-empty {
  padding: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary-dark);
}
@media (max-width: 1023px) {
  .app-header-luna .search-wrap input { max-width: 160px; }
}
.app-header-luna .quick-export {
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, #ff69b4, #7ad7f0);
  color: white !important;
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-decoration: none;
}
.app-header-luna .role-badge {
  font-size: 0.75rem;
  background: var(--bg-light);
  color: var(--text-secondary-dark);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
}
.app-header-luna .logout-btn {
  background: transparent;
  border: 1px solid var(--border-color-light);
  color: var(--text-primary-dark);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}
.app-header-luna .logout-btn:hover {
  background: var(--bg-light);
  border-color: var(--luna-pink);
  color: var(--luna-pink);
}
.app-header-luna .header-signout {
  background: transparent;
  border: 1px solid var(--border-color-light);
  color: var(--text-primary-dark);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}
.app-header-luna .header-signout:hover {
  background: var(--bg-light);
  border-color: var(--luna-pink);
  color: var(--luna-pink);
}
.app-header-luna .header-app-signout:hover { color: var(--luna-pink); background: var(--luna-gradient-soft); }

/* User dropdown – HTML shell */
.app-header-luna .user-menu-wrap {
  position: relative;
}
.app-header-luna .user-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0;
  background: transparent;
  border: 2px solid var(--border-color-light);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary-dark);
  min-width: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.app-header-luna .user-menu-trigger:hover {
  background: var(--bg-light);
  border-color: var(--luna-pink);
  box-shadow: 0 0 0 1px var(--luna-pink);
}
.app-header-luna .user-menu-trigger .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--luna-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  flex-shrink: 0;
}
.app-header-luna .user-menu-trigger-avatar-only {
  padding: 0;
  width: 40px;
  height: 40px;
}
.app-header-luna .user-menu-trigger-avatar-only .user-avatar {
  width: 100%;
  height: 100%;
}
.app-header-luna .user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.app-header-luna .user-menu-label,
.app-header-luna .user-menu-chevron { display: none; }
.app-header-luna .user-menu-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1023px) {
  .app-header-luna .user-menu-label { max-width: 90px; }
}
.app-header-luna .notifications-wrap {
  display: flex;
  align-items: center;
}
.app-header-luna .notifications-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-sm);
  border-radius: var(--radius);
  color: var(--text-header-dark);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.app-header-luna .bell-icon-svg { width: 18px; height: 18px; display: block; }
.app-header-luna .notifications-bell:hover {
  background: var(--bg-light);
  color: var(--luna-pink);
}
.app-header-luna .notifications-bell .notifications-count {
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 18px;
  padding: 2px 4px;
  border-radius: 10px;
  background: var(--luna-pink);
  color: #fff;
  text-align: center;
}
.app-header-luna .notifications-bell .notifications-count.hidden { display: none; }
.app-header-luna .user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 16px));
  max-height: min(70vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-xs);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-header-luna .user-menu-dropdown[hidden] { display: none; }
.app-header-luna .user-dropdown-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary-dark);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
}
.app-header-luna .user-dropdown-link:hover {
  background: var(--bg-light);
  color: var(--luna-pink);
}
.app-header-luna .user-dropdown-signout {
  margin-top: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border-color-light);
  color: var(--text-secondary-dark);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}
.app-header-luna .user-dropdown-signout:hover {
  background: var(--bg-light);
  color: var(--text-header-dark);
}
.user-dropdown-hint {
  margin: var(--space-sm) var(--space-md) 0;
  padding-top: var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary-dark);
  border-top: 1px solid var(--border-color-light);
}
.app-header-minimal .user-dropdown-hint {
  margin: var(--space-sm) var(--space-sm) 0;
  padding: var(--space-sm) var(--space-sm) 0;
}

/* PWA minimal header – notifications bell */
.app-header-minimal .minimal-bell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.5rem;
  color: var(--text-primary-dark);
  text-decoration: none;
  margin-right: var(--space-sm);
}
.app-header-minimal .bell-icon-svg { width: 18px; height: 18px; display: block; }
.app-header-minimal .header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  color: var(--text-primary-dark);
  text-decoration: none;
  flex-shrink: 0;
}
.app-header-minimal .header-icon-btn:hover { background: var(--bg-light); color: var(--text-header-dark); }
.app-header-minimal .search-icon-svg { width: 18px; height: 18px; display: block; }
.app-header-minimal .minimal-bell .notifications-count {
  font-size: 0.7rem;
  background: var(--luna-pink);
  color: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: 10px;
}
.app-header-minimal .minimal-bell.hidden .notifications-count { display: none; }

/* Centre CTA rows inside cards by default */
.card-actions--center .cta-wrap,
.card.card-actions--center .cta-wrap,
.luna-card.card-actions--center .cta-wrap {
  justify-content: center;
}

/* Legacy dark header fallback */
.app-header:not(.app-header-luna) {
  background: var(--text-header-dark);
  color: var(--bg-content-lighter-light);
}
.app-header:not(.app-header-luna) .role-badge { background: var(--border-color-light); color: var(--text-primary-dark); }
.app-header:not(.app-header-luna) .nav a { color: var(--bg-content-lighter-light); }
.app-header:not(.app-header-luna) .nav a.active { background: var(--secondary); color: var(--text-header-dark); }
.app-header:not(.app-header-luna) .logout-btn { border-color: var(--border-color-light); color: var(--bg-content-lighter-light); }
.app-header:not(.app-header-luna) .logout-btn:hover { background: var(--border-color-light); color: var(--text-primary-dark); }

/* =====================================
   TODAY VIEW – Dashboard hero section
   ===================================== */
.today-hero {
  background: #ffffff;
  border-radius: var(--card-radius);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.today-hero .greeting {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-header-dark);
  margin: 0 0 var(--space-xs) 0;
}

.today-hero .date {
  font-size: 0.95rem;
  color: var(--text-secondary-dark);
  margin: 0;
}

/* Status row - compact metrics */
.status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.status-row .card-status {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--border-color-light);
  transition: box-shadow var(--transition-normal);
}

.status-row .card-status:nth-child(3n+1) { border-top: 4px solid #ff69b4; }
.status-row .card-status:nth-child(3n+2) {
  position: relative;
  border-top: none;
  overflow: hidden;
  padding-top: calc(4px + var(--space-md));
}
.status-row .card-status:nth-child(3n+2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #ff69b4, #7ad7f0);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 0;
}
.status-row .card-status:nth-child(3n+3) { border-top: 4px solid #7ad7f0; }

/* Quick actions grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #ffffff;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary-dark);
  transition: box-shadow var(--transition-normal), outline var(--transition-normal);
  min-height: 80px;
  outline: 2px solid transparent;
  outline-offset: -1px;
}

.quick-actions .quick-action:nth-child(3n+1) { border-top: 4px solid #ff69b4; }
.quick-actions .quick-action:nth-child(3n+2) { position: relative; border-top: none; overflow: hidden; }
.quick-actions .quick-action:nth-child(3n+2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #ff69b4, #7ad7f0);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.quick-actions .quick-action:nth-child(3n+3) { border-top: 4px solid #7ad7f0; }

.quick-action:hover {
  box-shadow: 0 4px 20px rgba(255, 105, 180, 0.12);
  outline-color: rgba(255, 105, 180, 0.3);
}

.quick-action .action-icon {
  font-size: 1.5rem;
}

.quick-action .action-label {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* Dashboard sections – aligned with .card h2 and project spacing; section titles centred */
.dashboard-main .dashboard-section:first-of-type { margin-top: 0; }
.dashboard-section { margin-bottom: var(--space-xl); }
.dashboard-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 var(--space-sm) 0;
  color: var(--text-header-dark);
  text-align: center;
  width: 100%;
}

/* =====================================
   CENTRE DASHBOARD LAYOUT – Clear structure (Lauren/Allissa)
   ===================================== */
.dashboard-layout {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

/* =====================================
   DASHBOARD SHELL – unified structure for Centre/Support/Founder dashboards
   (based on Food Pantry admin shell: sticky header + padded scroll area)
   ===================================== */
.dashboard-shell {
  background: var(--bg-secondary, var(--luna-bg-secondary, #f7f7fb));
  width: 100%;
}

.dashboard-shell__scroll {
  width: 100%;
  max-width: 90rem;
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-xl) var(--space-lg);
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .dashboard-shell__scroll {
    padding: 2rem 2.25rem 2.5rem;
  }
}

.dashboard-shell__page {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  width: 100%;
}

@media (min-width: 1024px) {
  .dashboard-shell__page {
    gap: 2rem;
  }
}

/* Apply shell rhythm to existing dashboard sections without changing content */
.dashboard-shell .dashboard-section {
  margin-bottom: 0;
}

/* =====================================
   CENTRE DASHBOARD – LUNA SEN Food Pantry–style overview
   (welcome strip + 4-up KPI row + bottom panels; Luna APOS tokens)
   ===================================== */
.luna-pantry-dash {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

@media (min-width: 1024px) {
  .luna-pantry-dash {
    gap: 2rem;
  }
}

.luna-pantry-dash__welcome {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border-color-light);
  box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.luna-pantry-dash__welcome-accent {
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 42%;
  max-width: 22rem;
  transform: translateX(-1.25rem) skewX(-18deg);
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.14) 0%, rgba(122, 215, 240, 0.1) 100%);
  opacity: 0.95;
}

.luna-pantry-dash__welcome-inner {
  position: relative;
  z-index: 1;
  padding: 1.75rem 1.5rem 2rem;
}

@media (min-width: 768px) {
  .luna-pantry-dash__welcome-inner {
    padding: 2rem 2.25rem 2.25rem;
  }
}

.luna-pantry-dash__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary-dark);
}

.luna-pantry-dash__display {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-header-dark);
}

.luna-pantry-dash__display-muted {
  color: var(--text-header-dark);
  font-weight: 900;
}

.luna-pantry-dash__display-gradient {
  background-image: var(--luna-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

.luna-pantry-dash__greeting {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-header-dark);
}

.luna-pantry-dash__date {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary-dark);
}

.luna-pantry-dash__kpi-grid {
  display: grid;
  width: 100%;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .luna-pantry-dash__kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .luna-pantry-dash__kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }
}

.luna-pantry-dash__kpi-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  min-height: 14rem;
  height: 100%;
  padding: 1.5rem 1.25rem 1.75rem;
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border-color-light);
  box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.luna-pantry-dash__kpi-card:hover {
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.luna-pantry-dash__kpi-card--pink {
  border-top: 6px solid var(--luna-pink);
}

.luna-pantry-dash__kpi-card--blue {
  border-top: 6px solid var(--luna-blue);
}

.luna-pantry-dash__kpi-card--neutral {
  border-top: 6px solid var(--border-color-light);
}

.luna-pantry-dash__kpi-card--gradient {
  position: relative;
  border-top: 6px solid transparent;
}

.luna-pantry-dash__kpi-card--gradient::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 6px;
  width: 100%;
  background: var(--luna-gradient);
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  pointer-events: none;
}

.luna-pantry-dash__kpi-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.luna-pantry-dash__kpi-label--muted {
  color: var(--text-secondary-dark);
}

.luna-pantry-dash__kpi-body {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-header-dark);
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.luna-pantry-dash__kpi-metric {
  font-size: 2.25rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.luna-pantry-dash__kpi-caption {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.6875rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary-dark) !important;
}

.luna-pantry-dash__bottom-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .luna-pantry-dash__bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

.luna-pantry-dash__panel {
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid var(--border-color-light);
  box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.08);
  padding: 1.25rem 1.25rem 1.5rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .luna-pantry-dash__panel {
    padding: 1.5rem 1.5rem 1.75rem;
  }
}

.luna-pantry-dash__panel .dashboard-section-title {
  margin-top: 0;
}

.luna-pantry-dash__panel .section-subtitle {
  margin-bottom: var(--space-md);
}

.luna-pantry-dash__panel .quick-actions {
  margin-bottom: 0;
}

@media (max-width: 1023px) {
  .luna-pantry-dash__panel .quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

.dashboard-welcome {
  margin-bottom: var(--space-xl);
}
.dashboard-welcome-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-header-dark);
  margin: 0 0 var(--space-md) 0;
  text-align: center;
}
.dashboard-welcome .today-hero {
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: 0;
}
.dashboard-welcome .greeting { font-size: 1.35rem; margin: 0 0 var(--space-xs) 0; }
.dashboard-welcome .date { font-size: 0.95rem; margin: 0; color: var(--text-secondary-dark); }

/* At a glance – one row: commissioning + 3 stats */
.dashboard-at-a-glance .dashboard-section-title { margin-bottom: var(--space-md); }
.at-a-glance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 640px) {
  .at-a-glance-grid {
    grid-template-columns: 1.2fr repeat(3, 1fr);
  }
}
.at-a-glance-commissioning {
  padding: var(--space-md) var(--space-lg);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}
.at-a-glance-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary-dark);
  margin-bottom: var(--space-xs);
}
.at-a-glance-value { font-size: 0.95rem; margin: 0; font-weight: 500; }
.at-a-glance-stat {
  padding: var(--space-md);
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.at-a-glance-stat .status-value { font-size: 1.75rem; margin-bottom: var(--space-xs); }
.at-a-glance-stat .status-label { font-size: 0.8rem; margin: 0; }
/* Commissioning card edge is status-driven (set by JS on #commissioning-status-card) */
.at-a-glance-grid .at-a-glance-commissioning { border-top: 4px solid var(--border-color-light) !important; }
.at-a-glance-grid .at-a-glance-stat:nth-child(2) { border-top: 4px solid var(--luna-pink); }
.at-a-glance-grid .at-a-glance-stat:nth-child(3) {
  position: relative;
  border-top: none;
  overflow: hidden;
  padding-top: calc(4px + var(--space-md));
}
.at-a-glance-grid .at-a-glance-stat:nth-child(3)::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--luna-gradient);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.at-a-glance-grid .at-a-glance-stat:nth-child(4) { border-top: 4px solid var(--luna-blue); }

/* Main areas – clear card grid */
.dashboard-areas .section-subtitle { margin-bottom: var(--space-md); }
.dashboard-areas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 640px) {
  .dashboard-areas-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .dashboard-areas-grid { grid-template-columns: repeat(3, 1fr); }
}
.dashboard-areas-grid .area-card {
  padding: var(--space-lg);
  min-height: 0;
  text-decoration: none;
}
.dashboard-areas-grid .area-card h3 { font-size: 1.05rem; margin-bottom: var(--space-xs); }
.dashboard-areas-grid .area-card p {
  font-size: 0.875rem;
  margin: 0;
  text-align: center;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity var(--transition-normal), max-height var(--transition-slow);
}
.dashboard-areas-grid .area-card:hover,
.dashboard-areas-grid .area-card:focus,
.dashboard-areas-grid .area-card:focus-within { text-decoration: none; }
.dashboard-areas-grid .area-card:hover h3,
.dashboard-areas-grid .area-card:focus-within h3 { text-decoration: none; }

/* Main areas: every 2nd card in each row (3n+2) gets pink→blue gradient title on hover */
.dashboard-areas-grid .area-card:nth-child(3n+2):hover h3,
.dashboard-areas-grid .area-card:nth-child(3n+2):focus-within h3 {
  background-image: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.dashboard-areas-grid .area-card:hover p,
.dashboard-areas-grid .area-card:focus-within p {
  opacity: 1;
  max-height: 6em;
}

/* Section subtitles */
.dashboard-section .section-subtitle {
  text-align: center;
  margin-bottom: var(--space-md);
  font-size: 0.9rem;
}

/* Dashboard only: center card body text for a cleaner look */
.dashboard-main .card p,
.dashboard-main .card-plain p,
.dashboard-main .card-status { text-align: center; }

/* Dashboard: keep action buttons readable */
.dashboard-main .task-done-btn.btn,
.dashboard-main .flag-resolve-btn.btn { color: inherit; }

/* Commissioning KPI on centre dashboard (pantry-style card; 6px status stripe) */
.luna-pantry-dash #commissioning-status-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}
.luna-pantry-dash #commissioning-status-card {
  border-top-width: 6px !important;
  border-top-style: solid !important;
  border-top-color: var(--border-color-light) !important;
  margin-bottom: 0;
}
.luna-pantry-dash #commissioning-status-card.commissioning-card--approved {
  border-top-color: var(--rag-green) !important;
  border-color: rgba(22, 163, 74, 0.45) !important;
}
.luna-pantry-dash #commissioning-status-card.commissioning-card--awaiting {
  border-top-color: #f59e0b !important;
  border-color: #f59e0b !important;
}
.luna-pantry-dash #commissioning-status-card.commissioning-card--not-submitted {
  border-top-color: #cbd5e1 !important;
  border-color: var(--border-color-light) !important;
}
.luna-pantry-dash #commissioning-status-card:hover {
  box-shadow: 0 8px 28px -12px rgba(0, 0, 0, 0.12);
}
#attention-section .dashboard-section-title { margin-bottom: var(--space-xs); }
#attention-section .section-subtitle { margin-bottom: var(--space-sm); font-size: 0.875rem; }
#flags-container .card { padding: var(--space-md) var(--space-lg); }
.tasks-list .tasks-list-items { margin: 0; padding: 0; list-style: none; }
.tasks-list .task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  margin-bottom: var(--space-xs);
  background: var(--bg-light);
  border: 1px solid var(--border-color-light);
}
.tasks-list .task-item .task-content { flex: 1; min-width: 0; }
.tasks-list .task-item .task-title { font-size: 0.9rem; }
.tasks-empty { margin: 0; padding: var(--space-sm); font-size: 0.9rem; color: var(--text-secondary-dark); }

.rag-counts { display: flex; gap: var(--space-lg); margin-bottom: var(--space-md); flex-wrap: wrap; }
.rag-count { font-size: 0.9rem; }
.rag-count-red { color: var(--rag-red); font-weight: 600; }
.rag-count-red strong { font-size: 1.1em; }
.rag-count-amber { color: var(--rag-amber); }
.rag-count-green { color: var(--rag-green); }
.rag-filters { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.rag-filter-red { color: var(--rag-red); border-color: var(--rag-red); }
.rag-filter-amber { color: var(--rag-amber); border-color: var(--rag-amber); }
.rag-filter-green { color: var(--rag-green); border-color: var(--rag-green); }

/* =====================================
   READ-ONLY STATE – Commissioner/QA
   ===================================== */
.read-only-banner {
  background: var(--bg-light);
  border: 1px solid var(--border-color-light);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-secondary-dark);
}

.read-only-banner .icon {
  font-size: 1.1rem;
}

/* Change-password reminder (first-time / temp password) */
.change-password-banner {
  background: var(--bg-light);
  border: 1px solid var(--border-color-light);
  border-left: 4px solid var(--luna-pink);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-secondary-dark);
}
.change-password-banner a {
  color: var(--luna-pink);
  font-weight: 500;
  text-decoration: none;
}
.change-password-banner a:hover {
  text-decoration: underline;
}

/* Document-focused layout for commissioners */
.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}

.document-card {
  background: #ffffff;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: box-shadow var(--transition-normal), outline var(--transition-normal);
  outline: 2px solid transparent;
  outline-offset: -1px;
}

.document-grid .document-card:nth-child(3n+1) { border-top: 4px solid var(--luna-pink); }
.document-grid .document-card:nth-child(3n+1) .doc-icon { color: var(--luna-pink); }
.document-grid .document-card:nth-child(3n+2) { position: relative; border-top: none; overflow: hidden; padding-top: calc(5px + var(--space-lg)); }
.document-grid .document-card:nth-child(3n+2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--luna-gradient);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.document-grid .document-card:nth-child(3n+2) .doc-icon { opacity: 1; }
.document-grid .document-card:nth-child(3n+3) { border-top: 4px solid var(--luna-blue); }
.document-grid .document-card:nth-child(3n+3) .doc-icon { color: var(--luna-blue); }

.document-card:hover {
  box-shadow: 0 4px 20px rgba(255, 105, 180, 0.1);
  outline-color: rgba(255, 105, 180, 0.25);
}

.document-card .doc-icon {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
  display: block;
  line-height: 1;
  display: block;
}

.document-card .doc-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 var(--space-xs) 0;
}

.document-card .doc-meta {
  font-size: 0.85rem;
  color: #1e293b;
}

/* Audit standard detail card – all text black; RAG status stays red/amber/green */
#standard-detail,
#standard-detail h2,
#standard-detail p,
#standard-detail label,
#standard-detail .text-muted { color: #1e293b; }
#standard-detail .rag-red,
#standard-detail .rag-amber,
#standard-detail .rag-green { color: inherit; font-weight: 600; }
#standard-detail .rag-red { color: var(--rag-red); }
#standard-detail .rag-amber { color: var(--rag-amber); }
#standard-detail .rag-green { color: var(--rag-green); }

/* =====================================
   METRIC CARDS – Founder/Executive
   ===================================== */
.metric-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-color-light);
  transition: box-shadow var(--transition-normal);
}

.card-grid .metric-card:nth-child(3n+1) { border-top: 4px solid #ff69b4; }
.card-grid .metric-card:nth-child(3n+2) { position: relative; border-top: none; }
.card-grid .metric-card:nth-child(3n+2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #ff69b4, #7ad7f0);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-grid .metric-card:nth-child(3n+3) { border-top: 4px solid #7ad7f0; }

.metric-card .metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary-dark);
  margin-bottom: var(--space-xs);
}

.metric-card .metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-header-dark);
  line-height: 1;
}

.metric-card .metric-trend {
  font-size: 0.85rem;
  margin-top: var(--space-sm);
}

.metric-card .metric-trend.positive { color: #10b981; }
.metric-card .metric-trend.negative { color: #ef4444; }

/* =====================================
   ATTENDANCE REGISTER
   ===================================== */
.attendance-toolbar { flex-wrap: wrap; gap: var(--space-sm); }
.attendance-nav { display: flex; align-items: center; gap: var(--space-sm); }
.attendance-month-label { font-weight: 600; font-size: 1.1rem; min-width: 140px; text-align: center; }
.attendance-today {
  color: var(--text-secondary-dark);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  padding: 0 var(--space-sm);
}
.attendance-summary-cards { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.attendance-summary-card { padding: var(--space-md); min-width: 100px; }
.attendance-summary-label { display: block; font-size: 0.85rem; color: var(--text-secondary-dark); }
.attendance-summary-value { font-size: 1.5rem; font-weight: 700; }
.attendance-calendar { padding: var(--space-md); overflow-x: auto; }
/* Centre the month grid within the card (even when it becomes horizontally scrollable) */
.attendance-calendar {
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.attendance-cal-table {
  width: 100%;
  border-collapse: collapse;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 520px) {
  .attendance-cal-table { display: inline-table; width: auto; }
}
.attendance-cal-table th { padding: var(--space-sm); font-size: 0.85rem; color: var(--text-secondary-dark); text-align: center; }
.attendance-cal-cell { padding: var(--space-sm); min-height: 48px; cursor: pointer; border: 1px solid var(--border-color-light); border-radius: var(--radius); text-align: center; vertical-align: top; }
.attendance-cal-cell:hover { background: var(--bg-light); }
.attendance-cal-cell.is-today {
  outline: 2px solid rgba(255,105,180,0.55);
  outline-offset: -2px;
  background: rgba(255,105,180,0.06);
}
.attendance-cal-cell.status-green { border-left: 4px solid var(--rag-green); }
.attendance-cal-cell.status-amber { border-left: 4px solid var(--rag-amber); }
.attendance-cal-cell.status-red { border-left: 4px solid var(--rag-red); }
.attendance-cal-cell-empty { background: var(--bg-light); }

@media (max-width: 560px) {
  .attendance-toolbar { justify-content: center; }
  .attendance-nav { justify-content: center; flex-wrap: wrap; }
  .attendance-month-label { min-width: 0; }
}
.cal-day-num { display: block; font-weight: 600; }
.cal-day-count { font-size: 0.75rem; color: var(--text-secondary-dark); }
.day-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: var(--space-md); }
.day-modal.hidden { display: none; }
.day-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.3); }
.day-modal-content { position: relative; max-width: 500px; width: 100%; max-height: 80vh; overflow-y: auto; }
.day-learner-row { display: flex; align-items: center; justify-content: space-between; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border-color-light); gap: var(--space-md); }
.day-learner-row:last-child { border-bottom: none; }
.day-status-select { min-width: 160px; padding: var(--space-xs) var(--space-sm); }
.invite-link-input { flex: 1; padding: var(--space-sm); font-size: 0.9rem; }
.demo-request-form .form-group { margin-bottom: var(--space-sm); }
.demo-request-form input { width: 100%; max-width: 320px; }

/* =====================================
   RESPONSIVE UTILITIES
   ===================================== */
@media (max-width: 768px) {
  .main {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  
  .today-hero {
    padding: var(--space-lg);
  }
  
  .today-hero .greeting {
    font-size: 1.25rem;
  }
  
  .card {
    padding: var(--space-md);
  }
  
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bottom-nav {
    max-width: 500px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 1px solid var(--border-color-light);
    border-right: 1px solid var(--border-color-light);
  }
}

/* Touch-friendly spacing */
@media (pointer: coarse) {
  .btn {
    min-height: 48px;
  }
  
  .bottom-nav .nav-item {
    min-height: 48px;
  }
}

/* Enrollment wizard */
.wizard-steps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.wizard-step { padding: 0.35rem 0.75rem; border-radius: var(--radius); background: var(--bg-light); color: var(--text-secondary-dark); font-size: 0.9rem; }
.wizard-step.active { background: var(--luna-gradient); color: #fff; font-weight: 600; }
.wizard-panel.hidden { display: none !important; }

/* Enrollment status badges */
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-proposed { background: #e0e7ff; color: #3730a3; }
.badge-suspended { background: #fef3c7; color: #92400e; }
.badge-ended { background: #f1f5f9; color: #475569; }
.btn-xs { padding: 0.15rem 0.35rem; font-size: 0.75rem; }
.status-btns { display: inline-flex; gap: 2px; margin-left: 0.25rem; }

/* =====================================
   DASHBOARD – CALM, TASK-DRIVEN
   ===================================== */

/* Commissioning status (correct RAG use) */
.commissioning-approved { 
  color: var(--rag-green); 
  font-weight: 600; 
}
.commissioning-pending { 
  color: var(--text-primary-dark); 
  font-weight: 500; 
}

/* Tasks list – neutral, not punitive */
.tasks-list-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.task-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color-light);
}
.task-item:last-child {
  border-bottom: none;
}
.task-content {
  flex: 1;
  min-width: 0;
}
.task-title {
  display: block;
  font-weight: 500;
  color: var(--text-primary-dark);
  text-decoration: none;
  margin-bottom: var(--space-xs);
}
.task-title:hover {
  text-decoration: underline;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.85rem;
}
.task-priority {
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.task-priority--critical {
  background: #fef2f2;
  color: #991b1b;
}
.task-priority--high {
  background: #fef3c7;
  color: #92400e;
}
.task-priority--low {
  background: #f1f5f9;
  color: #64748b;
}
.task-due {
  color: var(--text-secondary-dark);
}
.task-due--past {
  color: #92400e;
  font-weight: 500;
}
.task-done-btn {
  flex-shrink: 0;
}
.tasks-empty {
  color: var(--text-secondary-dark);
  padding: var(--space-md);
  text-align: center;
}

/* Section subtitle */
.section-subtitle {
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: var(--space-md);
}

/* =====================================
   SETTINGS PAGE ONLY – sidebar + main content (account settings layout)
   Scoped to .settings-main so no impact on dashboard, learners, PWA, etc.
   ===================================== */
.settings-main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}
.settings-page-layout {
  display: flex;
  flex-direction: row;
  gap: var(--space-xl);
  width: 100%;
  align-items: flex-start;
  box-sizing: border-box;
}
/* Settings rail (React-style: user at top + section links with label + desc) */
.settings-rail {
  width: 280px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: calc(var(--header-h) + var(--space-md));
}
.settings-rail-user {
  text-align: center;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color-light);
}
.settings-rail-user .settings-user-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ff69b4, #7ad7f0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto var(--space-sm) auto;
}
.settings-rail-user .settings-user-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 var(--space-xs) 0;
  color: var(--text-header-dark);
}
.settings-rail-user .settings-user-email,
.settings-rail-user .settings-user-role {
  font-size: 0.8rem;
  margin: 0;
  color: var(--text-secondary-dark);
}
.settings-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-rail-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  color: var(--text-secondary-dark);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.settings-rail-link:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-header-dark);
}
.settings-rail-link.active {
  background: #ffffff;
  color: var(--text-header-dark);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.settings-rail-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.settings-rail-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 0;
}
.settings-rail-label {
  display: block;
  font-weight: 600;
  line-height: 1.2;
  font-size: 0.8rem;
}
.settings-rail-desc {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary-dark);
  margin-top: 1px;
}
.settings-rail-link.active .settings-rail-desc {
  color: var(--text-secondary-dark);
}

.settings-content {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}
.settings-content-head {
  margin-bottom: var(--space-xl);
}
.settings-page-heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-header-dark);
  margin: 0 0 var(--space-xs) 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.settings-page-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary-dark);
  margin: 0;
}
.settings-card {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}
.settings-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-header-dark);
  margin: 0 0 var(--space-sm) 0;
}
.settings-card-desc,
.settings-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary-dark);
  margin: 0 0 var(--space-md) 0;
}
.settings-card-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-md);
}
/* LUNA 3-card accents (like React reference) */
.luna-card-pink {
  border-top: 4px solid var(--luna-pink) !important;
}
.luna-card-blue {
  border-top: 4px solid var(--secondary) !important;
}
.luna-card-gradient {
  position: relative;
  border-top: 4px solid transparent !important;
}
.luna-card-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--luna-pink), var(--secondary));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.settings-main .input-field {
  width: 100%;
  background: var(--bg-light);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary-dark);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}
.settings-main .input-field:focus {
  border-color: var(--luna-pink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.12);
}
.settings-main .btn-primary {
  background: linear-gradient(135deg, var(--luna-pink), var(--secondary));
  color: #fff !important;
  border: none;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.25);
}
.settings-main .btn-primary:hover {
  opacity: 0.95;
  box-shadow: 0 4px 16px rgba(255, 105, 180, 0.3);
}
.settings-section {
  scroll-margin-top: 5rem;
}
@media (max-width: 768px) {
  .settings-page-layout {
    flex-direction: column;
  }
  .settings-rail {
    width: 100%;
    position: static;
  }
  .settings-rail-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-align: left;
  }
  .settings-rail-user .settings-user-avatar {
    margin: 0;
  }
}

/* Staff HR & recruitment (staff-hr.html, training-scr.html) */
.staff-hr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-md);
}
.staff-hr-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.staff-hr-card--ended {
  opacity: 0.85;
  border-top-color: var(--text-muted) !important;
}
.staff-hr-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}
.staff-hr-card-name {
  font-size: 1.125rem;
  margin: 0 0 0.25rem;
}
.staff-hr-fields,
.staff-hr-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.staff-hr-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: var(--space-sm) 0 0;
  color: var(--text-primary-dark);
}
.staff-hr-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-sm);
}
.staff-hr-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color-light);
}
.staff-doc-upload-form,
.emergency-contact-form {
  max-width: 36rem;
}
.learner-contacts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.learner-contact-item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color-light);
}
.learner-contact-item:last-child {
  border-bottom: none;
}
@media (max-width: 640px) {
  .staff-hr-card-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.staff-hr-qual-section {
  margin-top: var(--space-md);
}
.staff-hr-qual-courses {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.staff-hr-qual-course {
  padding: var(--space-sm);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  background: var(--surface-muted, #fafafa);
}
.staff-hr-qual-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
}

.staff-profile-docs__header {
  margin-bottom: var(--space-md);
  text-align: center;
}
.staff-profile-docs__name {
  margin: 0 0 0.25rem;
}
.staff-profile-docs__section {
  margin-top: var(--space-lg);
}
.staff-profile-docs__section-title {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
}
.staff-profile-qual-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.staff-profile-qual-card {
  padding: var(--space-md);
}
.staff-profile-qual-card__title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}
.staff-profile-qual-list {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
}
.staff-profile-qual-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--border-color-light);
}
.staff-profile-qual-item:first-child {
  border-top: none;
  padding-top: 0;
}
.staff-profile-qual-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.luna-forms-hub-grid {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.luna-forms-hub-card {
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 11rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.luna-forms-hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.luna-forms-hub-card__icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.luna-forms-hub-card h3 {
  margin: 0 0 0.35rem;
}
.luna-forms-hub-card__count {
  margin: auto 0 0;
  color: var(--text-secondary-dark, #64748b);
  font-weight: 600;
}
.luna-forms-category-panel {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ——— Forms Library (stacked sections + jump nav) ——— */
.luna-forms-jump-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border-color-light, #e5e7eb);
}
.luna-forms-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary-dark, #334155);
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.luna-forms-jump-link:hover {
  border-color: var(--luna-blue, #3b82f6);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}
.luna-forms-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  text-align: left;
}
.luna-forms-section__head {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.luna-forms-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}
.luna-forms-section__desc {
  margin: 0;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}
.luna-forms-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.luna-forms-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.luna-forms-list-item__main {
  flex: 1 1 220px;
  min-width: 0;
}
.luna-forms-list-item__title {
  margin: 0 0 0.15rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary-dark, #1e293b);
}
.luna-forms-list-item__subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: var(--luna-blue, #3b82f6);
  font-weight: 600;
}
.luna-forms-list-item__desc {
  margin: 0 0 0.35rem;
}
.luna-forms-list-item__meta {
  margin: 0;
}
.luna-forms-ref-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.12), rgba(59, 130, 246, 0.12));
  font-weight: 600;
  font-size: 0.78rem;
}
.luna-forms-list-item__actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
  min-width: 140px;
}
.luna-forms-list-item__actions .btn {
  width: 100%;
  text-align: center;
}
@media (min-width: 640px) {
  .luna-forms-list-item__actions {
    flex-direction: row;
    min-width: auto;
  }
  .luna-forms-list-item__actions .btn {
    width: auto;
    white-space: nowrap;
  }
}

/* ——— Forms Library (branded templates) ——— */
.luna-forms-library-grid {
  margin-top: 0.5rem;
}
.form-template-main {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.luna-form-toolbar {
  margin-bottom: 1.25rem;
  position: sticky;
  top: 0.5rem;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.luna-form-doc {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color-light, #e5e7eb);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
}
.luna-form-doc__brand-bar {
  height: 6px;
  background: linear-gradient(90deg, var(--luna-pink, #ec4899) 0%, var(--luna-blue, #3b82f6) 100%);
}
.luna-form-doc__header-inner {
  padding: 1.25rem 1.5rem 1rem;
  text-align: center;
}
.luna-form-doc__legal-line {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary-dark, #64748b);
  margin: 0 0 0.5rem;
  line-height: 1.45;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}
.luna-form-doc__company {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary-dark, #64748b);
  margin: 0 0 0.25rem;
}
.luna-form-doc__trading {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary-dark, #64748b);
  margin: 0 0 0.35rem;
}
.luna-form-doc__centre {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text-primary-dark, #1e293b);
}
.luna-form-doc__header-inner .luna-form-doc__legal-line .luna-text-gradient,
.luna-form-doc__header-inner .luna-form-doc__legal-line .brand-luna.luna-text-gradient,
.luna-form-doc__header-inner .luna-form-doc__trading .luna-text-gradient,
.luna-form-doc__header-inner .luna-form-doc__trading .brand-luna.luna-text-gradient {
  font-weight: 800;
}
.luna-form-doc__title {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  font-weight: 700;
}
.luna-form-doc__meta-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary-dark, #64748b);
}
.luna-form-doc__body {
  padding: 0 1.5rem 1.5rem;
}
.luna-form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.luna-form-section:last-child {
  border-bottom: none;
}
.luna-form-section h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--luna-blue, #3b82f6);
  text-align: center;
}
.luna-form-field {
  margin-bottom: 0.85rem;
}
.luna-form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary-dark, #334155);
}
.luna-form-field__line {
  border-bottom: 1px solid #cbd5e1;
  min-height: 1.5rem;
  margin-bottom: 0.35rem;
}
.luna-form-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0.2rem;
  color: var(--text-primary-dark, #1e293b);
  border-radius: 0;
}
.luna-form-input:focus {
  outline: none;
  border-bottom-color: var(--luna-blue, #3b82f6);
  background: rgba(59, 130, 246, 0.06);
}
.luna-form-textarea {
  resize: vertical;
  min-height: 4.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  line-height: 1.45;
}
.luna-form-textarea:focus {
  border-color: var(--luna-blue, #3b82f6);
}
.luna-form-input--inline {
  display: inline-block;
  width: auto;
  min-width: 9rem;
  vertical-align: baseline;
}
.luna-form-meta-date {
  font-size: 0.8rem;
  color: var(--text-secondary-dark, #64748b);
}
.luna-form-input--cell {
  width: 100%;
  min-width: 0;
  border: none;
  border-bottom: none;
  background: transparent;
  padding: 0.2rem 0.15rem;
  font-size: 0.85rem;
}
.luna-form-input--cell:focus {
  background: rgba(59, 130, 246, 0.06);
  border-radius: 4px;
}
.luna-form-field--wide .luna-form-field__line {
  min-height: 1.35rem;
}
.luna-form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.luna-form-check__input {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.12rem;
  accent-color: var(--luna-pink, #ec4899);
  cursor: pointer;
}
.luna-form-check label {
  font-weight: 400;
  cursor: pointer;
  line-height: 1.4;
}
.luna-form-check__box {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--luna-pink, #ec4899);
  border-radius: 3px;
  margin-top: 0.15rem;
}
.luna-form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.luna-form-table th,
.luna-form-table td {
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.5rem;
  text-align: left;
}
.luna-form-table th {
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.08), rgba(59, 130, 246, 0.08));
  font-weight: 600;
}
.luna-form-table--register td {
  min-height: 2rem;
  height: 2rem;
}
.luna-form-doc__footer {
  padding: 1rem 1.5rem 1.25rem;
  background: linear-gradient(180deg, rgba(255, 105, 180, 0.04) 0%, rgba(122, 215, 240, 0.06) 100%);
  border-top: 1px solid rgba(236, 72, 153, 0.15);
  text-align: center;
}
.luna-form-doc__footer-note {
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
  color: var(--text-primary-dark, #334155);
}
.luna-form-doc__policy-links {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
}
.luna-form-doc__policy-link {
  text-decoration: none;
  color: var(--text-primary-dark, #334155);
  font-weight: 600;
}
.luna-form-doc__policy-link:hover {
  opacity: 0.92;
}
.luna-form-doc__footer .luna-text-gradient,
.luna-form-doc__footer .brand-luna.luna-text-gradient,
.luna-form-doc__footer a.luna-form-doc__policy-link .luna-text-gradient,
.luna-form-doc__footer a.luna-form-doc__policy-link:hover .luna-text-gradient,
.luna-form-doc__legal-line .luna-text-gradient,
.luna-form-doc__legal-line .brand-luna.luna-text-gradient,
.luna-form-doc__company .luna-text-gradient,
.luna-form-doc__company .brand-luna.luna-text-gradient,
.luna-form-doc__trading .luna-text-gradient,
.luna-form-doc__trading .brand-luna.luna-text-gradient {
  background-image: linear-gradient(135deg, #ff69b4 0%, #7ad7f0 100%) !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}
.luna-form-doc__footer .brand-apo {
  font-weight: 600;
  color: var(--text-primary-dark, #334155);
}
.luna-form-doc__legal {
  margin: 0;
}
@media print {
  #app-header,
  #app-footer,
  .luna-form-toolbar,
  .app-footer {
    display: none !important;
  }
  .form-template-main {
    max-width: none;
    padding: 0;
  }
  .luna-form-doc {
    box-shadow: none;
    border: none;
  }
  .luna-form-input,
  .luna-form-textarea,
  .luna-form-input--cell {
    background: transparent !important;
    border-color: #94a3b8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .luna-form-check__input {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
