/* ── LOGO LOADER ANIMATION ───────────────────────────────────────────────────── */
@keyframes vl-ecg {
  0%   { stroke-dashoffset: 122; }
  65%  { stroke-dashoffset: -122; }
  100% { stroke-dashoffset: -122; }
}

@keyframes vl-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.8; }
  45%       { transform: scale(1.07); opacity: 1;   }
}

.vl-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: .03em;
}

.vl-loader-sm { padding: 18px 12px; }

.vl-loading-svg {
  display: block;
  transform-origin: 50% 50%;
  animation: vl-pulse 1.5s ease-in-out infinite;
}

.vl-ecg-line {
  stroke-dasharray: 122;
  animation: vl-ecg 1.5s ease-in-out infinite;
}

/* ============================================================
   PILOT PLAN BANNER
   ============================================================ */
.pilot-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  background: var(--brand-jet);
  color: #f3f4f6;
  font-size: 12.5px;
  font-weight: 500;
  border-bottom: 1px solid var(--brand);
  flex-shrink: 0;
}

.pilot-banner-icon {
  color: var(--brand);
  font-size: 9px;
}

.pilot-banner-link {
  margin-left: auto;
  color: var(--brand-light);
  text-decoration: underline;
  cursor: pointer;
  font-size: 11.5px;
  opacity: 0.85;
}

.pilot-banner-link:hover {
  opacity: 1;
}

.pilot-banner.pilot-warning {
  background: #fef3c7;
  color: #92400e;
  border-bottom-color: var(--orange);
}

.pilot-banner.pilot-warning .pilot-banner-icon { color: var(--orange); }
.pilot-banner.pilot-warning .pilot-banner-link { color: #92400e; }

.pilot-banner.pilot-expired {
  background: #fee2e2;
  color: #991b1b;
  border-bottom-color: #DC2626;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── VitalLens Sport Brand ── */
  --brand:          #E60000;
  --brand-dark:     #C90000;
  --brand-light:    rgba(230,0,0,0.07);
  --brand-jet:      #0A0A0C;
  --brand-charcoal: #1C1C1E;
  --brand-slate:    #636366;

  /* ── Status palette ── */
  --green:          #34C759;
  --green-light:    rgba(52,199,89,0.10);
  --orange:         #FF9500;
  --orange-light:   rgba(255,149,0,0.10);
  --red:            #FF3B30;
  --red-light:      rgba(255,59,48,0.10);

  /* ── Gray scale — Apple System ── */
  --gray-50:        #F9F9F9;
  --gray-100:       #F2F2F7;
  --gray-200:       #E5E5EA;
  --gray-300:       #C7C7CC;
  --gray-400:       #AEAEB2;
  --gray-500:       #8E8E93;
  --gray-600:       #636366;
  --gray-700:       #48484A;
  --gray-800:       #3A3A3C;
  --gray-900:       #1C1C1E;

  /* ── Semantic tokens ── */
  --bg:             #F5F5F7;
  --surface:        #FFFFFF;
  --surface-raised: #FAFAFA;
  --card-bg:        #FFFFFF;
  --white:          #FFFFFF;
  --border:         rgba(0,0,0,0.08);
  --border-strong:  rgba(0,0,0,0.14);
  --text:           #1C1C1E;
  --text-muted:     #636366;
  --text-secondary: #AEAEB2;
  --accent:         #0A84FF;
  --primary:        #E60000;

  /* ── Button tokens ── */
  --btn-primary-bg:    #E60000;
  --btn-primary-hover: #C90000;
  --btn-primary-text:  #FFFFFF;

  /* ── Sidebar ── */
  --sidebar-active-bg:     rgba(230,0,0,0.07);
  --sidebar-active-text:   #E60000;
  --sidebar-active-border: #E60000;

  /* ── Status badges ── */
  --badge-success-bg:   rgba(52,199,89,0.12);
  --badge-success-text: #248A3D;
  --badge-warning-bg:   rgba(255,149,0,0.12);
  --badge-warning-text: #C93400;
  --badge-risk-bg:      rgba(255,59,48,0.12);
  --badge-risk-text:    #C60B00;
  --badge-neutral-bg:   rgba(0,0,0,0.06);
  --badge-neutral-text: #48484A;

  /* ── Layout ── */
  --sidebar-w:      268px;
  --header-h:       60px;
  --pilot-banner-h: 34px;

  /* ── Radius — Apple-calibrated ── */
  --radius:         12px;
  --radius-lg:      18px;
  --radius-xl:      26px;
  --radius-pill:    999px;

  /* ── Elevation — atmospheric, not heavy ── */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 8px 28px rgba(0,0,0,0.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.10), 0 24px 56px rgba(0,0,0,0.06);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.12), 0 48px 96px rgba(0,0,0,0.08);

  /* ── Motion ── */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur:        0.15s;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
  color: var(--gray-900);
}

button, .btn, .nav-btn, .tab-btn, input, select, textarea, label, .badge, .stat-label, .section-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  flex-shrink: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 200;
  gap: 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius);
  transition: opacity var(--dur);
}
.header-brand:hover { opacity: 0.75; }
.header-brand:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }

.header-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}

.header-logo-mark {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.header-wordmark {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.header-wordmark-name {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #0D0D0F;
  line-height: 1;
}

.header-wordmark-sub {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--brand);
  text-transform: uppercase;
  line-height: 1;
}

.header-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.01em;
  border-left: 1px solid rgba(0,0,0,0.10);
  padding-left: 12px;
  white-space: nowrap;
}

.header-title:empty {
  display: none;
}

.header-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--gray-800);
}

.nav-btn.active {
  background: rgba(230,0,0,0.09);
  color: var(--brand);
  font-weight: 600;
}

/* ── Brand icon utility (currentColor via CSS mask) ── */
.nav-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.tab-group-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  opacity: 0.75;
}

/* ============================================================
   APP SHELL — SIDEBAR + MAIN
   ============================================================ */
.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.26s var(--ease-out), min-width 0.26s var(--ease-out);
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
}

/* ── Sidebar rail — always-visible collapse handle ── */
.sidebar-rail {
  width: 18px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  cursor: pointer;
  color: var(--gray-300);
  transition: background 0.15s, color 0.15s, width 0.18s;
  position: relative;
  z-index: 1;
}

.sidebar-rail:hover {
  background: var(--brand-light);
  color: var(--brand);
  width: 26px;
}

.sidebar-rail-chevron {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  transition: transform 0.26s var(--ease-out);
}

/* Chevron flips to ‹ when sidebar is expanded */
#sidebar:not(.collapsed) ~ #sidebarToggle .sidebar-rail-chevron {
  transform: rotate(180deg);
}

.sidebar-search {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: var(--radius-pill);
  font-size: 13px;
  outline: none;
  background: rgba(0,0,0,0.04);
  color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}

.sidebar-search input::placeholder { color: var(--gray-400); }

.sidebar-search input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(230,0,0,0.10);
}

.sidebar-filters {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.sidebar-filters select {
  flex: 1;
  padding: 5px 6px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 11px;
  color: var(--gray-600);
  background: var(--gray-50);
  outline: none;
  cursor: pointer;
}

.sidebar-filters select:focus { border-color: var(--brand); }

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.client-item {
  padding: 10px 16px 10px 19px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--dur), border-color var(--dur);
}

.client-item:hover {
  background: rgba(0,0,0,0.03);
}

.client-item.active {
  background: rgba(230,0,0,0.07);
  border-left-color: var(--brand);
}

.client-item-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.client-item-meta {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 1px;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.sidebar-loading {
  padding: 20px 16px;
  color: var(--gray-400);
  font-size: 13px;
}

/* ============================================================
   MAIN AREA & VIEWS
   ============================================================ */
.main-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px 64px;
  scroll-behavior: smooth;
}

.view { display: none; }
.view.active { display: block; }

.welcome-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  color: var(--gray-400);
  text-align: center;
}

.welcome-panel h2 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--gray-600);
}

/* ============================================================
   PROFILE HEADER
   ============================================================ */
.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.profile-identity h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.035em;
  font-family: 'Manrope', sans-serif;
  line-height: 1.2;
}

.profile-actions {
  display: flex;
  gap: 10px;
}

/* ============================================================
   TABS
   ============================================================ */
.tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 1.5px solid rgba(0,0,0,0.08);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

/* Tab groups — visual separation between sections */
.tab-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-right: 2px;
  border-right: 1px solid var(--gray-200);
  margin-right: 4px;
}

.tab-group:last-child {
  border-right: none;
  margin-right: 0;
}

.tab-group-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary);
  padding: 0 14px 3px;
  white-space: nowrap;
}

.tab-group-intelligence .tab-group-label {
  color: var(--brand-slate);
}

.tab-group-intelligence .tab-btn.active {
  color: var(--brand-jet);
  border-bottom-color: var(--brand-jet);
}

/* Tab buttons inside groups */
.tab-group .tab-btn {
  padding: 7px 14px;
}

.tab-btn {
  padding: 9px 15px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Intelligence tab styling ── */
.tab-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--brand-jet);
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 4px;
}

/* ── AI disclaimer note ── */
.ai-disclaimer-note {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 12px;
  line-height: 1.5;
}

/* ── Report templates ── */
.report-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.report-tpl-btn {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
  white-space: nowrap;
}

.report-tpl-btn:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
}

/* ── btn-primary-outline ── */
.btn-primary-outline {
  background: transparent;
  border: 1.5px solid var(--brand);
  color: var(--brand);
  font-weight: 600;
  box-shadow: none;
}

.btn-primary-outline:hover {
  background: rgba(230,0,0,0.06);
  box-shadow: none;
}

/* ── btn-intelligence (AI trigger) ── */
.btn-intelligence {
  background: var(--brand-jet);
  color: #fff;
  border: 1.5px solid var(--brand-jet);
  font-weight: 600;
}

.btn-intelligence:hover {
  background: #1f2937;
  border-color: #1f2937;
}

/* ── Sidebar active state using brand tokens ── */
.sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left: 3px solid var(--sidebar-active-border);
}

/* ============================================================
   HEALTH OVERVIEW TILES
   ============================================================ */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.health-tile {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.health-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gray-200);
}

.health-tile.green::before  { background: linear-gradient(90deg, var(--green), #22c55e); }
.health-tile.orange::before { background: linear-gradient(90deg, var(--orange), #f59e0b); }
.health-tile.red::before    { background: linear-gradient(90deg, var(--red), #ef4444); }

.health-tile:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tile-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.tile-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-family: 'Manrope', sans-serif;
}

.health-tile.green .tile-value  { color: #15803D; }
.health-tile.orange .tile-value { color: #B45309; }
.health-tile.red .tile-value    { color: #B91C1C; }

.tile-sub {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 5px;
  line-height: 1.4;
}

.tile-status-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-green  { background: rgba(52,199,89,0.12);  color: #15803D; }
.badge-orange { background: rgba(255,149,0,0.12);  color: #B45309; }
.badge-red    { background: rgba(255,59,48,0.12);  color: #B91C1C; }
.badge-gray   { background: rgba(0,0,0,0.06);      color: var(--gray-600); }

/* ============================================================
   HEALTH JOURNEY TIMELINE
   ============================================================ */
.journey-header {
  display: grid;
  grid-template-columns: 120px repeat(7, 1fr);
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
}

.journey-row {
  display: grid;
  grid-template-columns: 120px repeat(7, 1fr);
  gap: 4px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

.journey-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}

.journey-cell {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.journey-val { font-weight: 500; }

.trend-up   { color: var(--red);    font-size: 14px; }
.trend-down { color: var(--green);  font-size: 14px; }
.trend-stable { color: var(--gray-400); font-size: 14px; }

/* ============================================================
   INJURIES
   ============================================================ */
.tab-split {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
}

.tab-split-left {
  min-height: 200px;
}

.injury-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.07);
  border-top: 3px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.injury-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.injury-card.severity-1 { border-top-color: #22c55e; }
.injury-card.severity-2 { border-top-color: #f59e0b; }
.injury-card.severity-3 { border-top-color: #f97316; }
.injury-card.severity-4 { border-top-color: #ef4444; }
.injury-card.severity-5 { border-top-color: #a855f7; }

.injury-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.injury-meta {
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.injury-status-select {
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* SEVERITY SLIDER */
.severity-slider {
  width: 100%;
  margin: 8px 0 4px;
  accent-color: var(--brand);
}

.severity-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--gray-400);
}

/* BODY DIAGRAM */
/* Silhouette stroke — very subtle, barely visible on dark stage */
.body-sil ellipse,
.body-sil rect,
.body-sil path {
  stroke: rgba(120, 130, 165, 0.4);
  stroke-width: 0.5;
}

/* ============================================================
   POSTURE
   ============================================================ */
.posture-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.07);
  border-top: 3px solid #6366f1;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.posture-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

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

.posture-finding-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.posture-finding-chip.sev-1 { background: #eafaf1; color: #27ae60; }
.posture-finding-chip.sev-2 { background: #fef5e7; color: #e67e22; }
.posture-finding-chip.sev-3 { background: var(--red-light); color: var(--red); }

.posture-notes {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 8px;
  line-height: 1.5;
  border-top: 1px solid var(--gray-100);
  padding-top: 8px;
}

/* Posture form findings checklist */
.posture-findings {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.posture-region {
  background: rgba(0,0,0,0.025);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.posture-region-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.posture-finding-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-800);
  flex-wrap: wrap;
}

.posture-finding-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--brand);
}

.posture-finding-row span { flex: 1; min-width: 140px; }

.posture-sev, .posture-side {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.posture-sev:disabled, .posture-side:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Posture Photo Section ──────────────────────────────────────────────────── */
.posture-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.posture-photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.posture-view-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  align-self: flex-start;
  padding-left: 2px;
}
.posture-guide-svg {
  width: 72px;
  height: 160px;
}
.posture-ghost {
  fill: var(--gray-200);
  stroke: var(--gray-300);
  stroke-width: 1;
}
.posture-guide-center {
  stroke: var(--brand);
  stroke-width: 0.8;
  stroke-dasharray: 3 2;
  opacity: 0.6;
}
.posture-guide-h {
  stroke: var(--gray-400);
  stroke-width: 0.6;
  stroke-dasharray: 2 2;
}
.posture-guide-label {
  font-size: 6px;
  fill: var(--gray-500);
  font-family: 'Inter', sans-serif;
}
.posture-photo-area {
  width: 100%;
  min-height: 160px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s;
}
.posture-photo-area:hover {
  border-color: var(--brand);
}
.posture-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  padding: 16px;
  cursor: pointer;
  color: var(--gray-400);
}
.posture-cam-icon {
  width: 36px;
  height: 36px;
  opacity: 0.5;
}
.posture-photo-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}
.posture-photo-hint {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
}
.posture-photo-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: #000;
}
.posture-photo-preview img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
}
.posture-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.posture-ol-center {
  stroke: rgba(230,0,0,0.55);
  stroke-width: 0.6;
  stroke-dasharray: 3 2;
}
.posture-ol-h {
  stroke: rgba(255,255,255,0.45);
  stroke-width: 0.5;
  stroke-dasharray: 2 2;
}
.posture-dev-marker {
  fill: rgba(230,0,0,0.0);
  stroke: rgba(230,0,0,0.0);
}
.posture-photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(13,13,15,0.55);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}
.posture-photo-remove:hover {
  background: var(--brand);
}

.posture-cb {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================
   INJURY NOTES
   ============================================================ */
.injury-note {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 6px;
  line-height: 1.5;
  font-style: italic;
}

.injury-add-note-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
  display: block;
  text-align: left;
}

.injury-add-note-btn:hover { text-decoration: underline; }

.injury-note-editor { margin-top: 8px; }

.injury-note-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 12px;
  resize: vertical;
  outline: none;
  background: var(--gray-50);
}

.injury-note-input:focus { border-color: var(--brand); background: #fff; }

/* ============================================================
   SIDEBAR — sport line
   ============================================================ */
.client-item-sport {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   ASSESSMENTS & DOCUMENTS
   ============================================================ */
.assessment-card,
.document-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.07);
  border-top: 3px solid var(--brand);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.assessment-card:hover,
.document-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.assessment-title {
  font-weight: 600;
  font-size: 14px;
}

.assessment-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.assessment-metrics {
  margin-top: 10px;
  font-size: 12px;
}

.metrics-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}

.metrics-table th,
.metrics-table td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  text-align: left;
  font-size: 12.5px;
}

.metrics-table tr:last-child td { border-bottom: none; }

.metrics-table th {
  background: rgba(0,0,0,0.03);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-panel {
  max-width: 640px;
}

.settings-panel h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 28px 0;
}

.logo-preview-wrap {
  margin-bottom: 14px;
}

.logo-preview-img {
  height: 70px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
  padding: 4px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.06);
}

.form-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gray-400);
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-family: 'Inter', sans-serif;
}

.form-section-title:first-child { margin-top: 0; }

.form-row {
  display: flex;
  gap: 16px;
}

.form-group {
  flex: 1;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.form-group-check {
  justify-content: flex-end;
  padding-bottom: 4px;
}

.form-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--gray-400);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(230,0,0,0.12);
  outline: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 400 !important;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

.upload-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.form-status {
  font-size: 13px;
  color: var(--gray-400);
}

.form-status.success { color: var(--green); }
.form-status.error   { color: var(--red); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:disabled { opacity: 0.40; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(230,0,0,0.28), 0 1px 2px rgba(230,0,0,0.18);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  box-shadow: 0 4px 16px rgba(230,0,0,0.36), 0 2px 4px rgba(230,0,0,0.24);
}

.btn-secondary {
  background: var(--surface);
  color: var(--gray-700);
  border: 1.5px solid rgba(0,0,0,0.12);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: rgba(0,0,0,0.16);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.btn-full { width: 100%; }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: modal-fade-in 0.16s var(--ease-out);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: rgba(255,255,255,0.97);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.10);
  border: 1px solid rgba(255,255,255,0.6);
  width: 540px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-slide-up 0.24s var(--ease-out);
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.07);
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur), color var(--dur);
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(0,0,0,0.12);
  color: var(--gray-800);
}

.modal-box .form-panel {
  box-shadow: none;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
}

/* ============================================================
   TAB SECTION HELPERS
   ============================================================ */
.tab-section {
  margin-bottom: 22px;
}

.mt-16 { margin-top: 16px; }
.mb-20 { margin-bottom: 20px; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-muted { color: var(--gray-400); font-size: 13px; }
.text-error  { color: var(--red); font-size: 13px; }
.text-success { color: var(--green); font-size: 13px; }

.section-empty {
  padding: 48px 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(0,0,0,0.10);
}

.section-empty-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-msg {
  display: block;
  color: var(--gray-400);
  font-size: 13px;
}

.empty-cta-btn {
  display: inline-block;
  padding: 7px 16px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .02em;
  transition: opacity 0.15s;
}
.empty-cta-btn:hover { opacity: 0.85; }

/* Scrollbars — ultra-thin, premium */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.12) transparent; }

/* ── Premium focus ring ── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Subtle selection color ── */
::selection {
  background: rgba(230,0,0,0.15);
  color: inherit;
}

/* ============================================================
   DELETE / DANGER BUTTONS
   ============================================================ */
.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger-outline:hover { background: var(--red-light); }

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.12s;
}
.btn-icon-danger { color: var(--gray-400); }
.btn-icon-danger:hover { color: var(--red); background: var(--red-light); }

/* ============================================================
   JOURNEY TABLE — delete column
   ============================================================ */
.journey-header,
.journey-row {
  grid-template-columns: 110px repeat(8, 1fr) 32px !important;
}

/* ============================================================
   OVERVIEW — SPARKLINES
   ============================================================ */
.spark-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  margin: 22px 0 10px;
}

.sparkline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sparkline-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.sparkline-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.sparkline-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-600);
}

/* ============================================================
   PATIENT STORY TIMELINE
   ============================================================ */
.patient-timeline {
  position: relative;
}

.story-timeline {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--gray-200);
}

.story-event {
  position: relative;
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.story-dot {
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--gray-200);
  flex-shrink: 0;
}

.story-content {
  flex: 1;
}

.story-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.story-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.story-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.story-resolved {
  display: inline-block;
  font-size: 11px;
  color: var(--gray-400);
  margin-left: 8px;
}

.story-desc {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 4px;
  line-height: 1.5;
}

/* ============================================================
   INJURY CARD — top row with delete
   ============================================================ */
.injury-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

/* ============================================================
   ASSESSMENT / DOCUMENT CARD — top row with delete
   ============================================================ */
.assessment-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

/* ============================================================
   AI INSIGHTS
   ============================================================ */
.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px;
}

.insight-payload {
  margin-top: 10px;
  font-size: 11px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 8px 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============================================================
   INTEGRATIONS
   ============================================================ */
.integration-banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.banner-green { background: var(--green-light); color: var(--green); }
.banner-gray  { background: var(--gray-100);    color: var(--gray-600); }

.endpoint-display {
  display: block;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 10px 14px;
  color: var(--gray-800);
  word-break: break-all;
}

/* ── AI consent banner ─────────────────────────────────────────────────────── */
.consent-banner {
  background: var(--orange-light);
  color: var(--orange);
  border: 1px solid #f0c080;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
}

/* ── AI insight text card ──────────────────────────────────────────────────── */
.insight-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-800);
  margin-top: 8px;
  white-space: pre-wrap;
}

/* ── Integration status card ──────────────────────────────────────────────── */
.integration-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-green   { background: var(--green); }
.status-dot-yellow  { background: var(--orange); }
.status-dot-gray    { background: var(--gray-400); }
.status-dot-unknown { background: var(--gray-200); }

/* ── Appointments ─────────────────────────────────────────────────────────── */
.appt-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.appt-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.appt-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.appt-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.appt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.appt-type-chip {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--gray-700);
}
.appt-status {
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}
.appt-notes {
  font-size: 12px;
  color: var(--gray-600);
  margin: 6px 0 0;
}
.appt-status-select {
  font-size: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 3px 8px;
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
}

/* ── Benchmarks ───────────────────────────────────────────────────────────── */
.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.bench-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.bench-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.bench-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bench-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.bench-unit {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-500);
}
.bench-rank {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}
.bench-bar-track {
  height: 4px;
  background: var(--gray-100);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.bench-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Teams ────────────────────────────────────────────────────────────────── */
.teams-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 10px;
}
.teams-header h2 {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 20px 24px;
}
.team-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur), border-color var(--dur);
}
.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(230,0,0,0.3);
}
.team-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.team-card-sport {
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 6px;
}
.team-card-count {
  font-size: 12px;
  color: var(--gray-500);
}
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 20px 24px;
}
.roster-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.roster-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.roster-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}
.roster-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.roster-position {
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 4px;
}
.roster-id {
  font-size: 11px;
  color: var(--gray-400);
  font-family: monospace;
}
.add-member-list {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}
.add-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.12s;
}
.add-member-row:last-child { border-bottom: none; }
.add-member-row:hover { background: var(--brand-light); }
.add-member-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
}
.add-member-id {
  font-size: 11px;
  color: var(--gray-400);
  font-family: monospace;
}
/* ── Protocols ────────────────────────────────────────────────────────────── */
.protocols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 0 24px 24px;
}
.protocol-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.protocol-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.protocol-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.protocol-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.protocol-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0;
}
.proto-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.proto-chip {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--gray-700);
}
.proto-goals .proto-goal-chip {
  background: #e8f4fd;
  border: 1px solid #bee3f8;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  color: #2980b9;
}
.proto-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.assignment-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.assignment-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.assignment-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.assignment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-500);
}
.assignment-progress {
  margin-top: 10px;
}
.assignment-progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.assignment-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.assignment-progress-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
  display: block;
}

/* ── Muscular body diagram ────────────────────────────────────────────────── */
.body-muscle-lines path {
  stroke: rgba(130, 138, 165, 0.50);
  stroke-width: 0.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Skinfold / Body Comp ─────────────────────────────────────────────────── */
.skinfold-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gray-200);
}
.skinfold-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.skinfold-result-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.skinfold-result-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.skinfold-result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.skinfold-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}
.skinfold-result-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}
.skinfold-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.skinfold-stat {
  text-align: center;
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 8px 4px;
}
.skinfold-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.2;
}
.skinfold-stat-label {
  font-size: 10px;
  color: var(--gray-500);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.skinfold-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.skinfold-site-chip {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--gray-600);
}
.bf-gauge-wrap {
  margin-top: 10px;
}
.bf-gauge-track {
  height: 8px;
  background: linear-gradient(to right, #27ae60 0%, #27ae60 15%, #2980b9 15%, #2980b9 25%, #f39c12 25%, #f39c12 35%, #e67e22 35%, #e67e22 50%, #DC2626 50%);
  border-radius: 4px;
  position: relative;
}
.bf-gauge-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  background: var(--gray-900);
  border-radius: 2px;
  transform: translateX(-50%);
}
.bf-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--gray-500);
  margin-top: 3px;
}

/* ── Data gap upgrade notice banner ── */
.data-gap-banner {
  background: #fff8e1;
  border-left: 4px solid #f59e0b;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--gray-800);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.data-gap-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.data-gap-icon {
  font-size: 16px;
  color: #b45309;
  flex-shrink: 0;
}
.data-gap-msg {
  flex: 1;
  min-width: 180px;
  font-weight: 500;
}
.data-gap-toggle {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.data-gap-toggle:hover { background: var(--orange); }
.data-gap-dismiss {
  background: none;
  border: none;
  font-size: 15px;
  color: var(--gray-500);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.data-gap-dismiss:hover { background: var(--gray-100); color: var(--gray-800); }
.data-gap-list {
  border-top: 1px solid #fde68a;
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.data-gap-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
}
.data-gap-name {
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
  min-width: 140px;
}
.data-gap-name:hover { text-decoration: underline; }
.data-gap-fields {
  font-size: 12px;
  color: var(--gray-600);
}

/* ── Report section selector modal ── */
.report-section-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.report-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
  cursor: pointer;
  transition: background 0.15s;
}
.report-check-row:hover {
  background: var(--brand-light);
  border-color: var(--brand);
}
.report-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.report-check-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  flex: 1;
}

/* ── PDF-to-CSV import result cards ── */
.pdf-table-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.pdf-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.pdf-table-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.pdf-table-preview {
  overflow-x: auto;
  padding: 10px 14px;
}
.csv-preview-table {
  border-collapse: collapse;
  font-size: 11px;
  width: 100%;
  color: var(--gray-700);
}
.csv-preview-table th,
.csv-preview-table td {
  border: 1px solid var(--gray-200);
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
}
.csv-preview-table th {
  background: var(--gray-100);
  font-weight: 600;
}
.pdf-more-rows {
  font-size: 11px;
  color: var(--gray-500);
  padding: 4px 0;
  font-style: italic;
}

/* ── Medical History Card ─────────────────────────────────────────────────── */
.med-history-card {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 24px;
}
.med-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.med-history-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.med-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.med-row:last-child { border-bottom: none; }
.med-label {
  width: 140px;
  flex-shrink: 0;
  color: var(--gray-500);
  font-weight: 500;
}
.med-value { color: var(--gray-800); flex: 1; }
.med-alert { color: var(--red); font-weight: 600; }

/* ── Modal Section Divider ───────────────────────────────────────────────── */
.modal-section-divider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
  margin: 18px 0 14px;
  padding-top: 14px;
}

/* ── Trend Charts ─────────────────────────────────────────────────────────── */
.trend-charts-section { margin-bottom: 8px; }
.trend-charts-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 14px;
}
.trend-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.trend-chart-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 14px 16px 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.trend-chart-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.trend-chart-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.trend-chart-svg { display: block; }

/* ── Journey toolbar ──────────────────────────────────────────────────────── */
.journey-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 12px;
}

/* ── Practice Dashboard ───────────────────────────────────────────────────── */
.dashboard-wrap { padding: 32px 36px; max-width: 1160px; }
.dashboard-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.dashboard-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  margin: 0;
  font-family: 'Manrope', sans-serif;
}
.dashboard-date  {
  font-size: 13.5px;
  color: var(--gray-400);
  font-weight: 400;
}

.dash-stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 18px 22px 16px;
  min-width: 110px;
  flex: 1;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.dash-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dash-stat-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.04em;
  color: var(--gray-900);
}
.dash-stat-label {
  font-size: 10.5px;
  color: var(--gray-400);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
}

.dash-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.dash-panel {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.dash-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-400);
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dash-panel-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--gray-400); }
.dash-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--dur);
}
.dash-list-row:last-child { border-bottom: none; }
.dash-list-row:hover { background: rgba(0,0,0,0.025); }
.dash-time  { width: 44px; flex-shrink: 0; color: var(--gray-400); font-size: 12px; font-variant-numeric: tabular-nums; }
.dash-name  { flex: 1; font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.dash-chip  { font-size: 11px; background: rgba(0,0,0,0.05); color: var(--gray-600); padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.dash-status { font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.dash-meta  { font-size: 11px; color: var(--gray-400); white-space: nowrap; }
.dash-dot   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dash-empty { padding: 20px 18px; font-size: 13px; color: var(--gray-400); text-align: center; }

/* ── PHASE 2: WELLNESS ──────────────────────────────────────────────────────── */
.wellness-list { display: flex; flex-direction: column; gap: 0.75rem; }

.wellness-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.wellness-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.wellness-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.wellness-date { font-size: 13px; color: var(--gray-600); flex: 1; }

.wellness-overall {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
}

.wellness-scores-row {
  display: flex;
  gap: 0.6rem;
  text-align: center;
}

.wellness-scores-row > span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.wellness-scores-row small { font-size: 10px; color: var(--gray-500); }

.wellness-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.wellness-dot-empty {
  background: var(--gray-200);
  color: var(--gray-400);
}

.wellness-notes {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 0.4rem;
  font-style: italic;
}

.wellness-score-grid { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.75rem; }

.wellness-score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wellness-score-row > label {
  font-size: 13px;
  color: var(--gray-700);
  width: 130px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.score-picker { display: flex; gap: 4px; }

.score-btn {
  width: 32px;
  height: 32px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-btn:hover { border-color: var(--accent); color: var(--accent); }

.score-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── PHASE 2: TRAINING LOAD ─────────────────────────────────────────────────── */
.acwr-panel {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.acwr-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.acwr-stat {
  flex: 1;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.6rem 0.5rem;
}

.acwr-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1;
}

.acwr-stat-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}

.acwr-ratio.acwr-ok .acwr-stat-val  { color: #22c55e; }
.acwr-ratio.acwr-low .acwr-stat-val { color: #3b82f6; }
.acwr-ratio.acwr-warning .acwr-stat-val { color: #f59e0b; }
.acwr-ratio.acwr-danger .acwr-stat-val  { color: #ef4444; }

.week-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
}

.week-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.week-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  opacity: 0.7;
}

.week-bar-label {
  font-size: 9px;
  color: var(--gray-500);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
}

.training-session-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.training-session-row:last-child { border-bottom: none; }

.ts-date { color: var(--gray-500); width: 80px; flex-shrink: 0; }
.ts-type { flex: 1; }
.ts-rpe, .ts-dur, .ts-load { color: var(--gray-700); white-space: nowrap; }
.ts-load { font-weight: 600; }

/* ── PHASE 2: RETURN TO PLAY ─────────────────────────────────────────────────── */
.rtp-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.rtp-stages { display: flex; flex-direction: column; gap: 0.6rem; }

.rtp-stage {
  border: 1px solid rgba(0,0,0,0.07);
  border-top: 3px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-top-color var(--dur) var(--ease), background var(--dur);
}

.rtp-completed    { border-top-color: #22c55e; background: rgba(34,197,94,0.05); }
.rtp-in_progress  { border-top-color: #f59e0b; background: rgba(245,158,11,0.05); }
.rtp-failed       { border-top-color: #ef4444; background: rgba(239,68,68,0.05); }
.rtp-pending      { border-top-color: var(--gray-200); }

.rtp-stage-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rtp-icon { font-size: 16px; width: 20px; text-align: center; }
.rtp-stage-num { font-size: 11px; color: var(--gray-500); white-space: nowrap; }
.rtp-stage-name { font-weight: 600; font-size: 14px; flex: 1; color: var(--gray-800); }

.rtp-stage-controls { margin-left: auto; }

.rtp-status-select {
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
}

.rtp-criteria {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 0.35rem;
  margin-left: 26px;
}

.rtp-completed-date {
  font-size: 11px;
  color: #22c55e;
  margin-top: 0.25rem;
  margin-left: 26px;
}

.rtp-notes {
  font-size: 12px;
  color: var(--gray-500);
  font-style: italic;
  margin-top: 0.25rem;
  margin-left: 26px;
}

/* ── PHASE 2: CLIENT NOTES ───────────────────────────────────────────────────── */
.notes-list { display: flex; flex-direction: column; gap: 0.75rem; }

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  transition: box-shadow var(--dur) var(--ease);
}
.note-card:hover { box-shadow: var(--shadow-sm); }

.note-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.note-type-badge {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
}

.note-date {
  font-size: 12px;
  color: var(--gray-500);
  flex: 1;
}

.note-content {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ── PHASE 3: CALENDAR ───────────────────────────────────────────────────────── */
.calendar-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  padding: 1.5rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.calendar-header h2 { flex: 1; margin: 0; font-size: 1.3rem; }

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.calendar-grid-header > div {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  flex: 1;
}

.cal-cell {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 6px;
  min-height: 90px;
  padding: 4px 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-cell-empty { background: transparent; border-color: transparent; }

.cal-today {
  background: #eff6ff;
  border-color: var(--accent);
}

.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  align-self: flex-start;
  line-height: 1;
  margin-bottom: 2px;
}

.cal-today .cal-day-num {
  background: var(--accent);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.cal-appts { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }

.cal-appt {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-appt:hover { opacity: 0.85; }

.cal-appt-time { opacity: 0.8; flex-shrink: 0; }
.cal-appt-name { overflow: hidden; text-overflow: ellipsis; }

.cal-more {
  font-size: 10px;
  color: var(--gray-400);
  padding-left: 5px;
}

/* ── PHASE 3: PHOTOS ─────────────────────────────────────────────────────────── */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.photo-card {
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur);
}
.photo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.photo-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--gray-100);
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.photo-thumb:hover { transform: scale(1.04); }

.photo-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}

.photo-type-badge {
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}

.photo-date {
  font-size: 10px;
  color: var(--gray-500);
  flex: 1;
}

.photo-caption {
  font-size: 11px;
  color: var(--gray-600);
  padding: 0 6px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── PHASE 3: ZIA ────────────────────────────────────────────────────────────── */
.btn-zia {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-zia:hover { opacity: 0.88; }

.zia-status-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1rem;
}

.zia-status-indicator { display: flex; align-items: center; gap: 0.5rem; }

.zia-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zia-connection-detail {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--gray-100);
  font-size: 12.5px;
  color: var(--text-muted);
}

.zia-sync-info {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.zia-sync-info .mb-8 { margin-bottom: 8px; }

.status-dot-ok { background: #22c55e; }
.status-dot-error { background: #ef4444; }

/* ── PHASE 4: DASHBOARD APPOINTMENT QUICK-ACTIONS ───────────────────────────── */
.dash-appt-btn {
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.dash-appt-btn:hover { opacity: 0.75; }
.dash-appt-attended { background: #dcfce7; color: #16a34a; }
.dash-appt-noshow   { background: #fee2e2; color: #dc2626; }

/* ── PHASE 4: SETTINGS — FORM HINT ──────────────────────────────────────────── */
.form-hint {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
  display: block;
}

/* ── PHASE 5: TEAM ANALYTICS PANEL ──────────────────────────────────────────── */
.squad-analytics {
  margin-top: 1.5rem;
}

.squad-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.squad-stat {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.squad-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.02em;
}

.squad-stat-label {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.squad-stat-sub {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

.squad-table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}

.squad-table-header {
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.squad-table-inner {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.squad-table-inner th {
  padding: 0.5rem 0.75rem;
  background: var(--gray-50);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.squad-member-row td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
}

.squad-member-row:last-child td { border-bottom: none; }

.squad-member-row:hover td { background: var(--gray-50); }

.squad-ready-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.squad-ready     { background: #dcfce7; color: #16a34a; }
.squad-not-ready { background: #fee2e2; color: #dc2626; }
.squad-pos { color: var(--gray-400); font-size: 12px; }

.squad-no-data {
  padding: 2rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}

/* ============================================================
   PHASE 3 — TEAM INTELLIGENCE DASHBOARD
   ============================================================ */

/* Tab bar */
.team-dashboard { display: flex; flex-direction: column; gap: 0; }

.team-dash-tabs {
  display: flex;
  gap: 2px;
  padding: 16px 20px 0;
  border-bottom: 1px solid var(--gray-200);
  background: var(--surface);
}

.team-dash-tab {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 8px 16px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}

.team-dash-tab:hover { color: var(--brand); }
.team-dash-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.team-dash-body { padding: 20px; }

.team-dash-panel { display: none; }
.team-dash-panel.active { display: block; }

/* Wellness sparkline */
.team-trend-wrap {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 14px 16px 10px;
  box-shadow: var(--shadow-sm);
}
.team-trend-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.team-sparkline {
  width: 100%;
  height: 44px;
  display: block;
}

/* ── Availability Grid ── */
.avail-summary-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.avail-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid transparent;
}

.avail-chip.avail-green { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.avail-chip.avail-amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.avail-chip.avail-red   { background: #fff1f2; color: #dc2626; border-color: #fecaca; }

.avail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.avail-card {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}

.avail-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }

.avail-green { border-left-color: #16a34a; }
.avail-amber { border-left-color: #d97706; }
.avail-red   { border-left-color: #dc2626; }

.avail-card-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
  color: var(--gray-500);
}
.avail-green .avail-card-status { color: #16a34a; }
.avail-amber .avail-card-status { color: #b45309; }
.avail-red   .avail-card-status { color: #dc2626; }

.avail-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.avail-card-pos {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 2px;
}

.avail-card-meta {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 6px;
  border-top: 1px solid var(--gray-100);
  padding-top: 5px;
}

/* ── Load Chart ── */
.load-header-row {
  display: grid;
  grid-template-columns: 180px 1fr 70px;
  gap: 12px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 4px;
}

.load-chart { display: flex; flex-direction: column; gap: 4px; }

.load-row {
  display: grid;
  grid-template-columns: 180px 1fr 70px;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.load-row:hover { background: var(--gray-50); }

.load-player { display: flex; flex-direction: column; gap: 1px; }
.load-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.load-pos  { font-size: 11px; color: var(--gray-400); }

.load-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border-radius: 6px;
  height: 18px;
  overflow: visible;
  position: relative;
}

.load-bar {
  height: 100%;
  background: var(--brand);
  border-radius: 6px;
  min-width: 4px;
  transition: width .3s ease;
  opacity: 0.8;
}

.load-val {
  font-size: 11.5px;
  color: var(--gray-500);
  white-space: nowrap;
  position: absolute;
  right: -50px;
}

.acwr-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-align: center;
  white-space: nowrap;
}
.acwr-ok   { background: #f0fdf4; color: #16a34a; }
.acwr-med  { background: #fffbeb; color: #b45309; }
.acwr-high { background: #fff1f2; color: #dc2626; }

.load-legend {
  margin-top: 16px;
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Injury Heatmap + List ── */
.inj-heatmap {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.inj-heatmap-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.inj-area-row {
  display: grid;
  grid-template-columns: 140px 1fr 32px;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.inj-area-label {
  font-size: 12.5px;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inj-area-bar-wrap {
  background: var(--gray-100);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.inj-area-bar {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  opacity: 0.75;
  min-width: 6px;
  transition: width .3s ease;
}

.inj-area-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  text-align: right;
}

.inj-list-wrap {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.inj-list-title {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.inj-list-header {
  display: grid;
  grid-template-columns: 1fr 1fr 100px 80px;
  gap: 8px;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.inj-list-row {
  display: grid;
  grid-template-columns: 1fr 1fr 100px 80px;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .12s;
  align-items: center;
}
.inj-list-row:last-child { border-bottom: none; }
.inj-list-row:hover { background: var(--gray-50); }

.inj-list-name { font-weight: 500; color: var(--text-primary); }
.inj-list-area { color: var(--gray-600); }
.inj-list-date { color: var(--gray-400); font-size: 12px; }

/* ── PHASE 5: ALERT BELL + DROPDOWN ─────────────────────────────────────────── */
.header-alerts {
  position: relative;
  display: flex;
  align-items: center;
}

.alert-bell {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  transition: background var(--dur);
}

.alert-bell:hover { background: rgba(0,0,0,0.06); }

.alert-bell-icon { font-size: 1.2rem; vertical-align: middle; }

.alert-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.alert-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 440px;
  overflow-y: auto;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.alert-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  position: sticky;
  top: 0;
  background: var(--white);
}

.alert-dismiss-all {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
}

.alert-dismiss-all:hover { color: var(--gray-700); }

.alert-item {
  border-left: 3px solid transparent;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.alert-item:last-child { border-bottom: none; }

.alert-warning { border-left-color: #f59e0b; }
.alert-danger  { border-left-color: #ef4444; }

.alert-item-body { display: flex; flex-direction: column; gap: 2px; }

.alert-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

.alert-item-msg {
  font-size: 12px;
  color: var(--gray-500);
}

.alert-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.alert-goto {
  font-size: 11px;
  color: var(--brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.alert-goto:hover { text-decoration: underline; }

.alert-dismiss {
  font-size: 11px;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.alert-dismiss:hover { color: var(--gray-700); }

.alert-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}

/* ── PHASE 7: CLIENT STATUS BAR ─────────────────────────────────────────────── */
.client-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.status-chip-icon { font-size: 14px; }

.status-chip-green  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.status-chip-orange { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-chip-red    { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.status-chip-muted  { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-200); }

/* ── PHASE 7: WELLNESS TREND PANEL ──────────────────────────────────────────── */
.wellness-trend-panel {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.wellness-trend-main {
  margin-bottom: 0.75rem;
}

.wellness-spark-wide {
  width: 100%;
}

.wellness-spark-wide-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.wellness-trend-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.wellness-spark-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.wellness-spark-label {
  font-size: 10px;
  color: var(--gray-400);
  margin-bottom: 2px;
}

/* ── PHASE 7: PROTOCOL GOAL VS ACTUALS TABLE ─────────────────────────────────── */
.goal-table-wrap {
  margin-top: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.goal-table-title {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.goal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.goal-table th {
  padding: 4px 8px;
  background: var(--gray-100);
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.goal-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.goal-table tr:last-child td { border-bottom: none; }

.goal-label-cell  { font-weight: 500; color: var(--gray-700); }
.goal-target-cell { color: var(--gray-500); }
.goal-current-cell { font-weight: 600; }

.goal-diff {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.goal-diff-ok    { background: #dcfce7; color: #16a34a; }
.goal-diff-over  { background: #fee2e2; color: #dc2626; }
.goal-diff-under { background: #fef3c7; color: #92400e; }

/* ── PHASE 8: DASHBOARD PANEL ADD BUTTON ─────────────────────────────────────── */
.dash-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-panel-add-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  margin-left: 8px;
  transition: opacity 0.15s;
}

.dash-panel-add-btn:hover { opacity: 0.8; }

/* ── PHASE 9: SKINFOLD TREND PANEL ───────────────────────────────────────────── */
.skinfold-trend-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.skinfold-trend-panel h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 10px;
}

.skinfold-trend-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skinfold-trend-col {
  flex: 1 1 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.skinfold-trend-col .sf-site {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.skinfold-trend-col .sf-vals {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}

.skinfold-trend-col .sf-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.skinfold-trend-col .sf-delta.down { color: #16a34a; }
.skinfold-trend-col .sf-delta.up   { color: #dc2626; }
.skinfold-trend-col .sf-delta.flat { color: var(--text-muted); }

/* ── BENCHMARK RANK HISTORY ───────────────────────────────────────────────────── */
.bench-history-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
}

.bench-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bench-history-table th,
.bench-history-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.bench-history-table thead th {
  background: var(--surface);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.bench-history-table tbody tr:last-child td { border-bottom: none; }
.bench-history-table tbody tr:hover { background: var(--bg); }

.bench-rank-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── CHART HOVER TOOLTIP ─────────────────────────────────────────────────────── */
.chart-tooltip {
  position: fixed;
  background: #1a1a1a;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  z-index: 99998;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  display: none;
}

.chart-dot {
  cursor: crosshair;
  transition: r 0.1s;
}

/* ── TOAST NOTIFICATIONS ──────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 500;
  max-width: 380px;
  background: rgba(28,28,30,0.92);
  color: #fff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.14);
  border: 1px solid rgba(255,255,255,0.10);
  pointer-events: all;
  transform: translateY(calc(100% + 16px));
  opacity: 0;
  transition: transform 0.28s var(--ease-out), opacity 0.28s var(--ease-out);
}

.toast.toast-show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { background: rgba(21,128,61,0.92); }
.toast-error   { background: rgba(185,28,28,0.92); }
.toast-warning { background: rgba(180,92,0,0.92); }
.toast-info    { background: rgba(28,28,30,0.92); }

.toast-msg { flex: 1; line-height: 1.4; }

.toast-close {
  background: rgba(255,255,255,0.15);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--dur);
}
.toast-close:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* ── CONFIRM DIALOG ───────────────────────────────────────────────────────────── */
.confirm-message {
  margin: 4px 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* ── PHOTO LIGHTBOX ───────────────────────────────────────────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.18s var(--ease-out);
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: modal-slide-up 0.22s var(--ease-out);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease);
  line-height: 1;
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 48px;
  height: 72px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease);
  z-index: 1;
  line-height: 1;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  background: rgba(0,0,0,0.5);
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── DOCUMENT PREVIEW ─────────────────────────────────────────────────────────── */
.doc-preview-img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.doc-preview-iframe {
  width: 100%;
  height: 70vh;
  border: none;
  display: block;
}

/* ══ BODY MAP MODAL ══════════════════════════════════════════════════════════ */

/* Trigger button in the injury form */
.body-map-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
  text-align: left;
}
.body-map-trigger:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(230,0,0,.07);
  color: var(--gray-700);
}
.body-map-trigger.has-selection {
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.body-map-trigger-ico {
  width: 18px;
  height: 38px;
  flex-shrink: 0;
  color: var(--gray-300);
  transition: color 0.15s;
}
.body-map-trigger.has-selection .body-map-trigger-ico { color: var(--brand); }
.body-map-trigger-chevron {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--gray-300);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BODY MAP MODAL — Premium rebuild
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay */
/* ═══════════════════════════════════════════════════════════════════════════
   BODY MAP MODAL — Apple-style design
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}
.bm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

/* ── Box ─────────────────────────────────────────────────────────────────── */
.bm-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  max-height: 86vh;
  min-height: 520px;
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.06),
    0 8px 28px rgba(0,0,0,0.10),
    0 24px 72px rgba(0,0,0,0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: bm-enter 0.30s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes bm-enter {
  from { opacity: 0; transform: scale(0.93) translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.bm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid #F0F0F5;
  flex-shrink: 0;
  background: #FFFFFF;
}
.bm-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.bm-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(230,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand);
}
.bm-header-icon svg { width: 15px; height: 15px; }
.bm-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1D1D1F;
  margin: 0;
  white-space: nowrap;
}
.bm-subtitle {
  font-size: 11.5px;
  color: #8E8E93;
  margin: 0;
  white-space: nowrap;
}
.bm-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.bm-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.bm-search-ico {
  position: absolute;
  left: 9px;
  width: 13px;
  height: 13px;
  color: #8E8E93;
  pointer-events: none;
}
.bm-search {
  width: 176px;
  height: 32px;
  padding: 0 12px 0 28px;
  background: rgba(116,116,128,0.12);
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: #1D1D1F;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.bm-search::placeholder { color: #8E8E93; }
.bm-search:focus {
  border-color: rgba(230,0,0,0.35);
  background: rgba(116,116,128,0.08);
}
.bm-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(116,116,128,0.12);
  color: #6E6E73;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.13s, color 0.13s;
  flex-shrink: 0;
}
.bm-close svg { width: 12px; height: 12px; }
.bm-close:hover { background: rgba(116,116,128,0.22); color: #1D1D1F; }

/* ── Body: 3-column ──────────────────────────────────────────────────────── */
.bm-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.bm-nav {
  width: 144px;
  flex-shrink: 0;
  border-right: 1px solid #F0F0F5;
  padding: 12px 0;
  overflow-y: auto;
  background: #FAFAFA;
  scrollbar-width: thin;
  scrollbar-color: #D1D1D6 transparent;
}
.bm-nav-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #AEAEB2;
  padding: 0 12px 8px;
  margin: 0;
}
.bm-region-list {
  display: flex;
  flex-direction: column;
}
.bm-region-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  border: none;
  border-left: 2.5px solid transparent;
  background: transparent;
  color: #3C3C43;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.3;
}
.bm-region-btn:hover {
  background: rgba(230,0,0,0.05);
  color: #E60000;
  border-left-color: rgba(230,0,0,0.28);
}
.bm-region-btn.active {
  background: rgba(230,0,0,0.07);
  color: #E60000;
  font-weight: 600;
  border-left-color: #E60000;
}
.bm-region-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #C7C7CC;
  flex-shrink: 0;
  transition: background 0.12s;
}
.bm-region-btn.active .bm-region-dot,
.bm-region-btn:hover .bm-region-dot { background: #E60000; }
.bm-region-btn.bm-hidden { display: none; }

/* ── Stage ───────────────────────────────────────────────────────────────── */
.bm-stage {
  flex: 1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 28px 24px;
}
.bm-figures {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
}
.bm-fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.bm-fig-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #AEAEB2;
  font-family: inherit;
}
.bm-svg {
  width: 185px;
  display: block;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.09)) drop-shadow(0 6px 28px rgba(0,0,0,0.06));
}
.bm-svg--lg { width: 202px; }

/* ── Zone interaction ────────────────────────────────────────────────────── */
.bm-svg .body-zone {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
  transition: fill 0.14s ease, stroke 0.14s ease;
}
.bm-svg .body-zone:hover {
  fill: rgba(220,0,0,0.22);
  stroke: rgba(190,0,0,0.30);
  stroke-width: 1;
}
.bm-svg .body-zone.selected {
  fill: rgba(218,0,0,0.42);
  stroke: rgba(180,0,0,0.55);
  stroke-width: 1.2;
}
.bm-svg .body-zone.region-hi {
  fill: rgba(220,0,0,0.07);
  stroke: rgba(220,0,0,0.12);
  stroke-width: 0.8;
}
.bm-svg .body-zone.bm-zone-dimmed {
  fill: rgba(0,0,0,0.06);
  opacity: 0.45;
  cursor: default;
}

/* ── Detail panel ─────────────────────────────────────────────────────────── */
.bm-detail {
  width: 252px;
  flex-shrink: 0;
  border-left: 1px solid #F0F0F5;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bm-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}
.bm-detail-empty-icon {
  width: 52px;
  height: 52px;
  color: #C7C7CC;
  margin-bottom: 16px;
}
.bm-detail-empty-icon svg { width: 100%; height: 100%; }
.bm-detail-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #3C3C43;
  margin: 0 0 7px;
}
.bm-detail-empty-sub {
  font-size: 12px;
  line-height: 1.55;
  color: #8E8E93;
  margin: 0;
}
.bm-detail-filled {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  animation: bm-detail-in 0.24s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes bm-detail-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: none; }
}
.bm-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}
.bm-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
}
.bm-tag--region {
  color: #6E6E73;
  border-color: rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.04);
}
.bm-tag--left {
  color: #007AFF;
  border-color: rgba(0,122,255,0.18);
  background: rgba(0,122,255,0.07);
}
.bm-tag--right {
  color: #FF9500;
  border-color: rgba(255,149,0,0.20);
  background: rgba(255,149,0,0.07);
}
.bm-tag--centre {
  color: #8E8E93;
  border-color: rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
}
.bm-detail-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1D1D1F;
  margin: 0 0 4px;
  line-height: 1.15;
}
.bm-detail-muscle {
  font-size: 12.5px;
  color: #8E8E93;
  margin: 0;
  font-style: italic;
}
.bm-detail-rule {
  height: 1px;
  background: #F0F0F5;
  margin: 16px 0;
}
.bm-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 20px;
}
.bm-meta-item {
  background: #F9F9FB;
  border: 1px solid #EBEBEF;
  border-radius: 10px;
  padding: 10px 12px 8px;
}
.bm-meta-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #AEAEB2;
  display: block;
  margin-bottom: 4px;
}
.bm-meta-value {
  font-size: 12px;
  font-weight: 600;
  color: #1D1D1F;
  text-transform: capitalize;
}
.bm-detail-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bm-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: #E60000;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(230,0,0,0.28), 0 1px 3px rgba(230,0,0,0.18);
  transition: background 0.13s, box-shadow 0.13s, transform 0.10s;
}
.bm-confirm svg { width: 14px; height: 14px; }
.bm-confirm:hover {
  background: #CC0000;
  box-shadow: 0 4px 18px rgba(230,0,0,0.36);
  transform: translateY(-1px);
}
.bm-confirm:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(230,0,0,0.20); }
.bm-cancel {
  width: 100%;
  height: 40px;
  background: transparent;
  border: none;
  color: #E60000;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s;
}
.bm-cancel:hover { background: rgba(230,0,0,0.05); }

/* ── Floating tooltip ────────────────────────────────────────────────────── */
.bm-tooltip {
  position: absolute;
  pointer-events: none;
  padding: 5px 10px;
  background: rgba(28,28,30,0.90);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: #FFFFFF;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transform: translate(-50%, -140%);
  font-family: inherit;
}
.bm-tooltip.visible { opacity: 1; }

/* ── Injury Dots on Body Map ─────────────────────────────────────────────── */
.injury-dot-outer {
  animation: injury-pulse 2.2s ease-in-out infinite;
}
@keyframes injury-pulse {
  0%, 100% { opacity: 0.18; r: 18; }
  50%       { opacity: 0.10; r: 22; }
}

/* ── Dashboard Trends Section ────────────────────────────────────────────── */
.dash-trends-section {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 18px 20px 14px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.dash-trends-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.dash-trends-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-600);
}
.dash-trends-sub {
  font-size: 11px;
  color: var(--gray-400);
}

/* ── Dashboard Config ────────────────────────────────────────────────────── */
.dash-config-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--gray-200);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 14px;
  transition: color .15s, border-color .15s, background .15s;
}
.dash-config-btn:hover,
.dash-config-btn.active {
  color: var(--brand);
  border-color: var(--brand);
  background: #fff0f0;
}
.dash-config-bar {
  display: none;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.dash-config-bar.open { display: flex; }
.dash-config-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  margin-right: 4px;
  white-space: nowrap;
}
.dash-config-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.dash-config-chip input[type="checkbox"] { display: none; }
.dash-config-chip.checked {
  border-color: var(--brand);
  background: #fff0f0;
  color: var(--brand);
}

/* ── Admin panel ─────────────────────────────────────────────────────────── */
.admin-stats-grid {
  margin-bottom: 8px;
}

.admin-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.admin-recent-logins {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-recent-title {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.admin-login-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.admin-login-row:last-child { border-bottom: none; }
.admin-login-name { flex: 1; font-weight: 500; }
.admin-login-time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

/* ── Posture responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .posture-photos-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   AUTH OVERLAY
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #0A0A0C;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 44px 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.auth-logo-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.auth-wordmark {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.auth-wordmark-name {
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.auth-wordmark-sub {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-panel { display: flex; flex-direction: column; }

.auth-heading {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

.auth-subheading {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: -0.01em;
}

.auth-field input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}

.auth-field input::placeholder { color: rgba(255,255,255,0.25); }
.auth-field input:focus {
  border-color: var(--brand);
  background: rgba(255,255,255,0.08);
}

.auth-error {
  font-size: 12.5px;
  color: #ff6b6b;
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 14px;
}

.auth-success {
  color: #1a7a3d;
  background: rgba(52,199,89,0.10);
  border-color: rgba(52,199,89,0.30);
}

.auth-footer-link {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { opacity: 0.75; }

.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
}

/* ── Header user badge + logout ── */
.header-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
  padding: 4px 6px 4px 10px;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: 20px;
  flex-shrink: 0;
}

.header-user-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-800);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-role {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--gray-600);
  text-transform: capitalize;
  background: var(--gray-200);
  padding: 2px 7px;
  border-radius: 10px;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  line-height: 1;
}

.btn-logout:hover {
  color: var(--brand);
  background: rgba(230,0,0,0.1);
}

/* ── User management table ── */
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.user-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-200);
}

.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  vertical-align: middle;
  color: var(--text-primary);
}

.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: rgba(0,0,0,0.02); }

.user-role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: capitalize;
  background: var(--gray-100);
  color: var(--gray-600);
}

.user-role-badge.role-admin { background: rgba(230,0,0,0.1); color: var(--brand); }
.user-role-badge.role-clinician { background: rgba(59,130,246,0.1); color: #2563eb; }
.user-role-badge.role-performance { background: rgba(16,185,129,0.1); color: #059669; }
.user-role-badge.role-coach { background: rgba(245,158,11,0.1); color: #b45309; }

.user-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 5px;
}
.user-status-dot.inactive { background: var(--gray-300); }

/* ── Report section defaults grid (settings panel) ── */
.report-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.report-section-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  background: var(--gray-50);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.report-section-check:hover {
  background: var(--brand-light);
  border-color: var(--brand);
}

.report-section-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Read-only mode ────────────────────────────────────────────────────────── */
body.read-only-mode .btn-primary,
body.read-only-mode .btn-secondary,
body.read-only-mode .btn-danger,
body.read-only-mode .btn-danger-outline {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}
/* Always allow login/settings buttons in read-only */
body.read-only-mode .btn-read-only-exempt {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

/* ── POPIA consent badges ─────────────────────────────────────────────────── */
.consent-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-left: 8px;
  vertical-align: middle;
}
.consent-ok {
  background: rgba(16,185,129,0.12);
  color: #065f46;
}
.consent-missing {
  background: rgba(220,38,38,0.1);
  color: #991b1b;
}
.consent-label {
  align-items: flex-start;
  gap: 10px;
}
.consent-required-field {
  background: rgba(var(--brand-rgb, 79,70,229), 0.05);
  border: 1px solid rgba(var(--brand-rgb, 79,70,229), 0.2);
  border-radius: 8px;
  padding: 10px 12px;
}

/* ── Organisation profile card ───────────────────────────────────────────── */
.org-profile-card {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  max-width: 560px;
}
.org-profile-grid { display: flex; flex-direction: column; gap: 8px; }
.org-profile-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}
.org-profile-label {
  min-width: 160px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.org-profile-value { font-weight: 500; }

/* ============================================================
   POLISH — skeleton loading, view transitions, micro-details
   ============================================================ */

/* ── Skeleton shimmer ── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-text  { height: 14px; border-radius: 4px; }
.skeleton-title { height: 20px; border-radius: 6px; }
.skeleton-card  { border-radius: var(--radius); min-height: 80px; }
.skeleton-circle{ border-radius: 50%; }
.skeleton-avatar{ width: 40px; height: 40px; border-radius: 50%; }

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.skeleton-row:last-child { border-bottom: none; }

/* Sidebar client list skeleton */
.sidebar-skeleton {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-skeleton-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
}

/* ── View fade transitions ── */
.view {
  animation: view-fade-in 0.22s var(--ease-out);
}
@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Tab panel transition ── */
.tab-panel.active {
  animation: tab-in 0.18s var(--ease-out);
}
@keyframes tab-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card hover lift — subtle, consistent ── */
.stat-card,
.card,
.overview-card {
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.stat-card:hover,
.card:hover,
.overview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ── Input focus — sharper ring ── */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: transparent !important;
}

/* ── Button active state ── */
.btn:active,
button:not(.nav-btn):not(.tab-btn):active {
  transform: scale(0.97);
}

/* ── Toast — polished backdrop blur ── */
.toast {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ── Sidebar loading state — replace plain text ── */
.sidebar-loading {
  padding: 20px 16px;
}
.sidebar-loading::after {
  content: '';
  display: block;
}

/* ── Empty state icon pulse ── */
.empty-state-icon {
  animation: empty-float 3s ease-in-out infinite;
}
@keyframes empty-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ── Scroll area smooth ── */
.tab-content,
.main-content,
.view-content {
  scroll-behavior: smooth;
}

/* ── Badge shimmer on active injury ── */
.injury-active-badge {
  position: relative;
  overflow: hidden;
}
.injury-active-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: badge-shimmer 2.4s ease-in-out infinite;
}
@keyframes badge-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Profile header smooth load ── */
.profile-header {
  transition: opacity 0.2s var(--ease);
}
.profile-header.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Consent badge pulse if missing ── */
.consent-badge.consent-missing {
  animation: consent-warn 3s ease-in-out infinite;
}
@keyframes consent-warn {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── Nav button active indicator ── */
.nav-btn.active::after {
  transition: transform 0.2s var(--ease-spring);
}

/* ── Modal backdrop blur ── */
.modal-overlay,
.bm-modal {
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
}

/* ============================================================
   RESPONSIVE — Tablet (≤900px) and Mobile (≤600px)
   ============================================================ */

/* ── Sidebar overlay backdrop ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.32);
  z-index: 98;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-backdrop.visible { display: block; }

/* ── Tablet ≤ 900px ── */
@media (max-width: 900px) {
  :root { --header-h: 56px; }

  .app-header {
    padding: 0 16px;
    gap: 10px;
  }

  /* Show mobile hamburger inside header */
  .sidebar-rail { display: none; }

  .header-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
    order: -1;
  }
  .header-mobile-toggle:hover { background: var(--gray-100); }
  .header-mobile-toggle svg { width: 20px; height: 20px; }

  /* Sidebar becomes overlay drawer */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 99;
    width: 280px !important;
    min-width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s;
    box-shadow: none;
    border-right: none;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* Main content full width when sidebar is overlay */
  .main-content {
    width: 100%;
    min-width: 0;
  }

  /* Tab bar scrollable */
  .tab-bar {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    gap: 0;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Profile header compact */
  .profile-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
  }
  .profile-actions { flex-wrap: wrap; gap: 6px; }

  /* Dashboard grid stacks */
  .dash-grid,
  .overview-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Body map modal full width */
  .bm-box {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    flex-direction: column !important;
  }

  .bm-stage {
    flex-direction: column !important;
    gap: 16px;
  }

  .bm-figures {
    flex-direction: row !important;
    justify-content: center;
  }

  .bm-svg--lg { width: 120px; height: auto; }
  .bm-svg    { width: 100px; height: auto; }

  /* Settings two-col becomes single */
  .settings-section { max-width: 100% !important; }

  /* Nav compact */
  .header-nav { display: none; }
  .header-nav.mobile-nav-visible {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    z-index: 97;
    box-shadow: var(--shadow-md);
  }
}

/* ── Mobile ≤ 600px ── */
@media (max-width: 600px) {
  :root { --header-h: 52px; }

  .app-header { padding: 0 12px; }

  /* Hide wordmark on small screens, keep logo mark */
  .header-wordmark { display: none; }
  .header-title { font-size: 13px; }

  /* User badge minimal */
  .header-user-name { display: none; }
  .header-user-role { display: none; }

  .main-content { padding: 0; }

  .tab-content,
  .tab-panel.active {
    padding: 12px !important;
  }

  /* Modals full screen */
  .modal-box {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Cards stack */
  .card-grid,
  .metric-grid {
    grid-template-columns: 1fr !important;
  }

  /* Auth card full width */
  .auth-card {
    width: 100vw;
    min-height: 100dvh;
    border-radius: 0;
    padding: 32px 24px;
    justify-content: flex-start;
    padding-top: 48px;
  }
}

/* Hide mobile toggle on desktop */
@media (min-width: 901px) {
  .header-mobile-toggle { display: none; }
  .sidebar-backdrop { display: none !important; }
}

/* Tablets in landscape (e.g. 1024 px iPads): full nav plus the signed-in user
   badge and alerts bell don't fit, which made the whole page scroll sideways */
@media (min-width: 901px) and (max-width: 1180px) {
  .app-header { padding: 0 16px; gap: 12px; }
  .nav-btn { padding: 6px 9px; }
  .header-title { display: none; }
  .header-user-role { display: none; }
  .header-user-name { max-width: 90px; }
}
