:root {
  --color-navy: #0f172a;
  --color-sidebar: #0b1120;
  --color-sidebar-soft: #111827;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-accent: #00c2b8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-soft: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --muted: #64748b;
  --line: #e5eaf2;
  --border: #e2e8f0;
  --navy: #07133f;
  --primary: #4f46e5;
  --accent: #0b6fea;
  --accent-dark: #0758bf;
  --turquoise: #00c2b8;
  --progress: #00d47e;
  --warning: #b7791f;
  --danger: #dc2626;
  --info: #0b6fea;
  --ok: #008f58;
  --sidebar: #07133f;
  --sidebar-muted: #b9c6d8;
  --shadow: 0 14px 36px rgba(7, 19, 63, 0.08);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 30px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --page-bg: #f5f7fb;
  --surface-muted: #f1f5f9;
  --surface-elevated: #ffffff;
  --text-strong: #0f172a;
  --border-soft: #d7dee9;
  --focus-ring: rgba(37, 99, 235, 0.18);
  --sidebar-bg: #071826;
  --sidebar-bg-strong: #0b1120;
  --sidebar-border: rgba(148, 163, 184, 0.18);
  --status-success-bg: #ecfdf5;
  --status-success-text: #047857;
  --status-warning-bg: #fffbeb;
  --status-warning-text: #92400e;
  --status-danger-bg: #fef2f2;
  --status-danger-text: #991b1b;
  color-scheme: light;
}

[data-theme="dark"] {
  --color-navy: #e5edf7;
  --color-sidebar: #07111f;
  --color-sidebar-soft: #0d1b2c;
  --color-primary: #7aa7ff;
  --color-primary-hover: #9bbdff;
  --color-accent: #2dd4bf;
  --color-bg: #0c111b;
  --color-surface: #121a28;
  --color-border: #263346;
  --color-text: #e5edf7;
  --color-muted: #9aa8bd;
  --bg: #0c111b;
  --surface: #121a28;
  --surface-2: #182235;
  --surface-soft: #182235;
  --text: #e5edf7;
  --text-muted: #9aa8bd;
  --muted: #9aa8bd;
  --line: #263346;
  --border: #263346;
  --navy: #e5edf7;
  --primary: #7aa7ff;
  --accent: #7aa7ff;
  --accent-dark: #9bbdff;
  --turquoise: #2dd4bf;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #7aa7ff;
  --ok: #34d399;
  --sidebar: #07111f;
  --sidebar-muted: #9aa8bd;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.24), 0 14px 36px rgba(0, 0, 0, 0.34);
  --page-bg: #0c111b;
  --surface-muted: #182235;
  --surface-elevated: #172133;
  --text-strong: #f8fbff;
  --border-soft: #2f3d52;
  --focus-ring: rgba(122, 167, 255, 0.26);
  --sidebar-bg: #07111f;
  --sidebar-bg-strong: #0a1625;
  --sidebar-border: rgba(122, 167, 255, 0.18);
  --status-success-bg: rgba(16, 185, 129, 0.16);
  --status-success-text: #7ee7bd;
  --status-warning-bg: rgba(251, 191, 36, 0.16);
  --status-warning-text: #fcd77a;
  --status-danger-bg: rgba(248, 113, 113, 0.16);
  --status-danger-text: #fca5a5;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

.fittiar-landing-body {
  min-width: 320px;
  overflow-x: hidden;
  background: #f8fafc;
  color: #0f172a;
  font-family: Arial, Helvetica, sans-serif;
}

.landing-symbols {
  display: none;
}

.fittiar-landing-body svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.landing-container {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
}

.landing-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(14px);
}

.landing-header-inner {
  width: min(100% - 48px, 1280px);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 auto;
}

.landing-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 132px;
  color: #0f172a;
}

.landing-brand img {
  width: auto;
  height: 42px;
  max-width: 136px;
  object-fit: contain;
}

.landing-nav,
.landing-header-actions {
  display: flex;
  align-items: center;
}

.landing-nav {
  gap: 28px;
}

.landing-nav a,
.landing-login-link {
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  transition: color 0.18s ease;
}

.landing-nav a:hover,
.landing-login-link:hover {
  color: #4338ca;
}

.landing-header-actions {
  gap: 16px;
}

.landing-header-cta,
.landing-mobile-primary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #4338ca;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 18px;
  box-shadow: 0 12px 24px rgba(67, 56, 202, 0.20);
}

.landing-header-cta:hover,
.landing-mobile-primary:hover {
  background: #3730a3;
}

.landing-mobile-menu {
  display: none;
  position: relative;
}

.landing-mobile-menu summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}

.landing-mobile-menu summary::-webkit-details-marker {
  display: none;
}

.landing-mobile-menu summary span {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: #475569;
}

.landing-mobile-panel {
  position: absolute;
  top: 54px;
  right: 0;
  width: min(280px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 46px rgba(15, 23, 42, 0.18);
  padding: 14px;
}

.landing-mobile-panel a {
  border-radius: 8px;
  color: #334155;
  font-weight: 800;
  padding: 10px 12px;
}

.landing-mobile-panel a:hover {
  background: #f8fafc;
  color: #4338ca;
}

.landing-mobile-separator {
  height: 1px;
  margin: 4px 0;
  background: #e2e8f0;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 148px 0 112px;
  background:
    linear-gradient(140deg, rgba(224, 231, 255, 0.72), rgba(255, 255, 255, 0.88) 38%, rgba(204, 251, 241, 0.62)),
    #f8fafc;
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  align-items: center;
  gap: 64px;
}

.landing-hero-copy {
  max-width: 620px;
}

.landing-pill,
.landing-dark-pill {
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 24px;
  padding: 7px 12px;
}

.landing-pill span {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 999px;
  background: #4f46e5;
  box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.16);
}

.landing-hero h1 {
  max-width: 720px;
  margin: 0 0 22px;
  color: #0f172a;
  font-size: 64px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
}

.landing-hero h1 span {
  display: block;
  background: linear-gradient(135deg, #4338ca, #0d9488);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-hero-lead {
  max-width: 600px;
  margin: 0 0 16px;
  color: #334155;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.34;
}

.landing-hero-support {
  max-width: 560px;
  margin: 0 0 32px;
  color: #64748b;
  font-size: 18px;
  line-height: 1.65;
}

.landing-actions,
.landing-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.landing-btn,
.landing-cta-primary,
.landing-cta-secondary {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 850;
  padding: 14px 28px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.landing-btn:hover,
.landing-cta-primary:hover,
.landing-cta-secondary:hover {
  transform: translateY(-1px);
}

.landing-btn-primary {
  background: #4338ca;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(67, 56, 202, 0.22);
}

.landing-btn-primary:hover {
  background: #3730a3;
}

.landing-btn-secondary {
  border-color: #e2e8f0;
  background: #ffffff;
  color: #334155;
}

.landing-btn-secondary:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
  color: #3730a3;
}

.landing-dashboard-wrap {
  position: relative;
  min-height: 500px;
}

.landing-dashboard {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
  padding: 24px;
}

.landing-dashboard-top {
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.landing-dashboard-brandmark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #ffffff;
  font-weight: 900;
}

.landing-dashboard-top strong,
.landing-dashboard-top span {
  display: block;
}

.landing-dashboard-top strong {
  color: #0f172a;
  font-size: 14px;
}

.landing-dashboard-top span {
  color: #64748b;
  font-size: 12px;
}

.landing-dashboard-top i {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f1f5f9;
}

.landing-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.landing-dashboard-stats article,
.landing-agenda-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.landing-dashboard-stats article {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.landing-dashboard-stats span,
.landing-agenda-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.landing-dashboard-stats svg {
  color: #4f46e5;
}

.landing-dashboard-stats strong {
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.landing-agenda-card {
  padding: 16px;
}

.landing-agenda-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.landing-agenda-head strong {
  color: #0f172a;
  font-size: 14px;
}

.landing-agenda-head span {
  color: #4338ca;
  font-size: 12px;
}

.landing-agenda-card ul {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.landing-agenda-card li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
}

.landing-agenda-card li > i {
  width: 8px;
  height: 42px;
  border-radius: 999px;
}

.agenda-indigo {
  background: #6366f1;
}

.agenda-teal {
  background: #14b8a6;
}

.agenda-purple {
  background: #a855f7;
}

.landing-agenda-card li span,
.landing-agenda-card li strong,
.landing-agenda-card li small {
  display: block;
}

.landing-agenda-card li strong {
  color: #0f172a;
  font-size: 14px;
}

.landing-agenda-card li small {
  color: #64748b;
  font-size: 12px;
}

.landing-agenda-card em {
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 8px;
}

.landing-floating-status {
  position: absolute;
  z-index: 3;
  left: -28px;
  bottom: -28px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  padding: 14px 16px;
}

.landing-floating-status > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 24px;
}

.landing-floating-status strong,
.landing-floating-status small {
  display: block;
}

.landing-floating-status strong {
  color: #0f172a;
  font-size: 14px;
}

.landing-floating-status small {
  color: #64748b;
  font-size: 12px;
}

.landing-section {
  padding: 96px 0;
}

.landing-hero,
.landing-section,
.landing-portal,
.landing-cta,
.landing-footer {
  scroll-margin-top: 80px;
}

.landing-what {
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.landing-narrow {
  width: min(100% - 48px, 880px);
  margin: 0 auto;
  text-align: center;
}

.landing-narrow h2,
.landing-section-heading h2,
.landing-portal h2,
.landing-cta h2 {
  margin: 0;
  color: #0f172a;
  font-size: 48px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
}

.landing-narrow p {
  margin: 22px auto 0;
  color: #334155;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}

.landing-narrow p + p {
  color: #64748b;
  font-size: 18px;
  font-weight: 500;
}

.landing-system,
.landing-solutions {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.landing-section-heading {
  max-width: 800px;
  margin: 0 auto 58px;
  text-align: center;
}

.landing-section-heading p {
  margin: 16px 0 0;
  color: #64748b;
  font-size: 20px;
  line-height: 1.55;
}

.landing-system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.landing-large-card,
.landing-feature-grid article {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.landing-large-card {
  padding: 32px;
}

.landing-large-card:hover,
.landing-feature-grid article:hover {
  transform: translateY(-3px);
  border-color: #c7d2fe;
  box-shadow: 0 22px 44px rgba(67, 56, 202, 0.10);
}

.landing-card-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 28px;
  margin-bottom: 24px;
}

.landing-icon-indigo {
  background: #eef2ff;
  color: #4f46e5;
}

.landing-icon-teal {
  background: #ccfbf1;
  color: #0d9488;
}

.landing-icon-purple {
  background: #f3e8ff;
  color: #9333ea;
}

.landing-large-card h3,
.landing-feature-grid h3 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
}

.landing-large-card p,
.landing-feature-grid p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.landing-features {
  background: #ffffff;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.landing-feature-grid article {
  padding: 24px;
}

.landing-feature-grid article:hover {
  background: #f8fafc;
}

.landing-feature-grid article:hover .landing-card-icon {
  background: #4f46e5;
  color: #ffffff;
}

.landing-feature-grid h3 {
  font-size: 20px;
}

.landing-feature-grid p {
  font-size: 14px;
}

.landing-tabs {
  display: grid;
  grid-template-columns: minmax(240px, 0.38fr) minmax(0, 0.62fr);
  gap: 32px;
  margin-top: 48px;
}

.landing-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.landing-tab-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.landing-tab-list label {
  min-height: 58px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #475569;
  cursor: pointer;
  font-size: 18px;
  font-weight: 850;
  padding: 16px 22px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.landing-tab-list label:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.landing-tab-panels {
  min-height: 316px;
  position: relative;
}

.landing-solution-panel {
  min-height: 316px;
  display: none;
  align-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.10);
  padding: 46px;
}

.landing-solution-panel::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 210px;
  height: 210px;
  background: linear-gradient(135deg, rgba(204, 251, 241, 0.72), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.landing-solution-panel h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  color: #0f172a;
  font-size: 32px;
  line-height: 1.2;
}

.landing-solution-panel p {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 0 30px;
  color: #475569;
  font-size: 20px;
  line-height: 1.65;
}

.landing-solution-panel a {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4338ca;
  font-weight: 900;
}

#solution-gyms:checked ~ .landing-tab-list label[for="solution-gyms"],
#solution-boutique:checked ~ .landing-tab-list label[for="solution-boutique"],
#solution-centers:checked ~ .landing-tab-list label[for="solution-centers"],
#solution-pt:checked ~ .landing-tab-list label[for="solution-pt"],
#solution-trainers:checked ~ .landing-tab-list label[for="solution-trainers"],
#solution-members:checked ~ .landing-tab-list label[for="solution-members"] {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.22);
}

#solution-gyms:checked ~ .landing-tab-panels .panel-gyms,
#solution-boutique:checked ~ .landing-tab-panels .panel-boutique,
#solution-centers:checked ~ .landing-tab-panels .panel-centers,
#solution-pt:checked ~ .landing-tab-panels .panel-pt,
#solution-trainers:checked ~ .landing-tab-panels .panel-trainers,
#solution-members:checked ~ .landing-tab-panels .panel-members {
  display: grid;
}

.landing-portal {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 62%, rgba(13, 148, 136, 0.14) 0%, rgba(13, 148, 136, 0) 32%),
    linear-gradient(180deg, #0f172a 0%, #111827 52%, #161649 100%);
  color: #ffffff;
  padding-bottom: 68px;
}

.landing-portal::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 180px;
  background:
    radial-gradient(circle at 68% 92%, rgba(13, 148, 136, 0.18) 0%, rgba(13, 148, 136, 0) 36%),
    linear-gradient(180deg, rgba(22, 22, 73, 0) 0%, #161649 100%);
  pointer-events: none;
}

.landing-portal-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: 72px;
}

.landing-dark-pill {
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: #5eead4;
}

.landing-portal h2 {
  color: #ffffff;
}

.landing-portal-copy > p:not(.landing-dark-pill) {
  max-width: 640px;
  margin: 22px 0 34px;
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1.7;
}

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

.landing-check-grid span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  backdrop-filter: blur(10px);
}

.landing-check-grid svg {
  flex: 0 0 auto;
  color: #2dd4bf;
}

.landing-phone-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding: 18px 28px;
}

.landing-phone {
  position: relative;
  width: 300px;
  height: 600px;
  overflow: hidden;
  border: 8px solid #334155;
  border-radius: 40px;
  background: #1e293b;
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.38);
}

.landing-phone-notch {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  width: 130px;
  height: 24px;
  border-radius: 0 0 14px 14px;
  background: #334155;
  transform: translateX(-50%);
}

.landing-phone-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
}

.landing-phone-head {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 18px;
  border-radius: 0 0 28px 28px;
  background: #4f46e5;
  color: #ffffff;
  padding: 48px 22px 24px;
}

.landing-phone-head span,
.landing-phone-head strong {
  display: block;
}

.landing-phone-head span {
  color: #c7d2fe;
  font-size: 12px;
}

.landing-phone-head > div > strong {
  font-size: 18px;
}

.landing-phone-head i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-style: normal;
}

.landing-phone-account {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.10);
  padding: 14px;
}

.landing-phone-account strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 20px;
}

.landing-phone-account svg {
  color: #5eead4;
}

.landing-phone-content {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 22px;
}

.landing-phone-content > strong {
  color: #1e293b;
  font-size: 14px;
}

.landing-phone-content article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  padding: 14px;
}

.landing-phone-content article > span,
.landing-phone-badge span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #ccfbf1;
  color: #0d9488;
}

.landing-phone-content article strong,
.landing-phone-content article small {
  display: block;
}

.landing-phone-content article strong {
  color: #1e293b;
  font-size: 14px;
}

.landing-phone-content article small {
  color: #64748b;
  font-size: 12px;
}

.landing-phone-content article em {
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  padding: 6px 8px;
}

.landing-phone-alert {
  grid-template-columns: 42px 1fr !important;
  border-color: #fed7aa !important;
  background: #fff7ed !important;
}

.landing-phone-alert > span {
  background: #ffedd5 !important;
  color: #f97316 !important;
}

.landing-phone-alert strong {
  color: #9a3412 !important;
}

.landing-phone-alert small {
  color: #c2410c !important;
}

.landing-phone-badge {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.landing-phone-badge strong {
  white-space: nowrap;
  font-size: 14px;
}

.landing-phone-badge-left {
  top: 96px;
  left: 0;
}

.landing-phone-badge-right {
  right: 0;
  bottom: 140px;
}

.landing-phone-badge-right span {
  background: #f3e8ff;
  color: #9333ea;
}

.landing-cta {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-top: 0;
  background:
    radial-gradient(circle at 74% 20%, rgba(0, 194, 184, 0.22) 0%, rgba(0, 194, 184, 0) 36%),
    linear-gradient(180deg, #07133f 0%, #0b1120 62%, #07133f 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(0, 194, 184, 0.28);
  padding: 56px 0 116px;
}

.landing-cta-inner {
  position: relative;
  width: min(100% - 48px, 880px);
  margin: 0 auto;
  padding: 18px 0 0;
  text-align: center;
}

.landing-cta-inner::before {
  display: none;
}

.landing-cta-inner > * {
  position: relative;
  z-index: 1;
}

.landing-cta h2 {
  color: #ffffff;
  font-size: 58px;
}

.landing-cta p {
  max-width: 760px;
  margin: 24px auto 38px;
  color: #e2e8f0;
  font-size: 20px;
  line-height: 1.7;
}

.landing-cta-actions {
  justify-content: center;
}

.landing-cta-primary {
  border-color: #5eead4;
  background: #00c2b8;
  color: #04111f;
  box-shadow: 0 18px 38px rgba(0, 194, 184, 0.24);
}

.landing-cta-primary:hover {
  background: #5eead4;
  color: #04111f;
}

.landing-cta-secondary {
  border-color: rgba(226, 232, 240, 0.66);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
}

.landing-cta-secondary:hover {
  border-color: #00c2b8;
  background: rgba(0, 194, 184, 0.18);
}

.landing-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 32px;
}

.landing-footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding-bottom: 34px;
}

.landing-footer img {
  width: 150px;
  max-width: 100%;
  border-radius: 8px;
  background: #ffffff;
  padding: 5px 8px;
  margin-bottom: 16px;
}

.landing-footer p {
  max-width: 280px;
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
}

.landing-footer nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.landing-footer h2 {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 16px;
}

.landing-footer a {
  color: #94a3b8;
  font-size: 14px;
  transition: color 0.18s ease;
}

.landing-footer a:hover {
  color: #ffffff;
}

.landing-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 24px;
}

.landing-footer-bottom p,
.landing-footer-bottom span {
  color: #64748b;
  font-size: 14px;
}

.fittiar-landing-body a:focus-visible,
.fittiar-landing-body summary:focus-visible,
.landing-tab-list label:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.44);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .landing-nav,
  .landing-header-actions {
    display: none;
  }

  .landing-mobile-menu {
    display: block;
  }

  .landing-hero-grid,
  .landing-portal-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero-copy {
    max-width: 820px;
  }

  .landing-dashboard-wrap,
  .landing-phone-wrap {
    justify-self: center;
    width: min(100%, 660px);
  }

  .landing-system-grid,
  .landing-footer-grid {
    grid-template-columns: 1fr;
  }

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

  .landing-tabs {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .landing-container,
  .landing-header-inner,
  .landing-narrow,
  .landing-cta-inner {
    width: min(100% - 32px, 1280px);
  }

  .landing-header-inner {
    min-height: 70px;
  }

  .landing-brand img {
    height: 34px;
  }

  .landing-hero {
    padding: 118px 0 72px;
  }

  .landing-hero-grid {
    gap: 42px;
  }

  .landing-hero h1,
  .landing-cta h2 {
    font-size: 42px;
  }

  .landing-pill {
    width: 100%;
    align-items: flex-start;
  }

  .landing-pill span {
    flex: 0 0 auto;
    margin-top: 5px;
  }

  .landing-hero-lead,
  .landing-narrow p {
    font-size: 19px;
  }

  .landing-hero-support,
  .landing-section-heading p,
  .landing-solution-panel p,
  .landing-portal-copy > p:not(.landing-dark-pill),
  .landing-cta p {
    font-size: 16px;
  }

  .landing-actions,
  .landing-cta-actions {
    flex-direction: column;
  }

  .landing-btn,
  .landing-cta-primary,
  .landing-cta-secondary {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
    padding: 12px 18px;
  }

  .landing-dashboard-wrap {
    min-height: auto;
  }

  .landing-dashboard {
    padding: 16px;
  }

  .landing-dashboard-stats,
  .landing-check-grid,
  .landing-feature-grid,
  .landing-tab-list {
    grid-template-columns: 1fr;
  }

  .landing-agenda-card li {
    grid-template-columns: 7px minmax(0, 1fr);
  }

  .landing-agenda-card em {
    width: max-content;
    margin-left: 19px;
  }

  .landing-floating-status {
    position: static;
    margin-top: 16px;
  }

  .landing-section {
    padding: 72px 0;
  }

  .landing-portal {
    padding-bottom: 50px;
  }

  .landing-portal::after {
    height: 140px;
  }

  .landing-cta {
    margin-top: 0;
    padding: 34px 0 86px;
  }

  .landing-cta-inner {
    padding: 0;
  }

  .landing-narrow h2,
  .landing-section-heading h2,
  .landing-portal h2 {
    font-size: 34px;
  }

  .landing-section-heading {
    margin-bottom: 36px;
  }

  .landing-large-card,
  .landing-feature-grid article,
  .landing-solution-panel {
    padding: 24px;
  }

  .landing-solution-panel h3 {
    font-size: 27px;
  }

  .landing-phone-wrap {
    display: grid;
    justify-items: center;
    padding: 0;
  }

  .landing-phone {
    width: min(300px, 100%);
    height: 560px;
  }

  .landing-phone-badge {
    position: static;
    width: max-content;
    max-width: 100%;
    margin: 12px auto 0;
  }

  .landing-phone-content article {
    grid-template-columns: 42px 1fr;
  }

  .landing-phone-content article em {
    grid-column: 2;
    width: max-content;
  }

  .landing-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(11, 111, 234, 0.13), rgba(0, 194, 184, 0.11)),
    var(--bg);
}

.auth-panel {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-theme-action {
  position: fixed;
  z-index: 30;
  top: 18px;
  right: 18px;
}

.login-page {
  min-width: 320px;
  overflow-x: hidden;
  background: #f8fafc;
}

.auth-shell-split,
.auth-shell-login {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.78fr);
  place-items: stretch;
  align-items: stretch;
  padding: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.20), rgba(99, 102, 241, 0) 30%),
    radial-gradient(circle at 62% 78%, rgba(13, 148, 136, 0.18), rgba(13, 148, 136, 0) 34%),
    linear-gradient(140deg, rgba(224, 231, 255, 0.72), rgba(255, 255, 255, 0.92) 42%, rgba(204, 251, 241, 0.56)),
    #f8fafc;
}

.auth-shell-login::before {
  content: "";
  position: fixed;
  inset: auto -15% -28% 34%;
  z-index: -1;
  height: 420px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.16), rgba(13, 148, 136, 0) 62%);
  pointer-events: none;
}

.auth-shell-split .auth-panel,
.auth-shell-login .auth-panel {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 56px;
}

.auth-visual {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 56px;
  overflow: hidden;
  color: #0f172a;
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 34px 42px;
  border: 1px solid rgba(255, 255, 255, 0.70);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  right: 4%;
  bottom: 10%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.24), rgba(13, 148, 136, 0) 64%);
  pointer-events: none;
}

.login-brand-content,
.auth-visual-links {
  position: relative;
  z-index: 1;
}

.login-brand-content {
  max-width: 680px;
  padding: 22px;
}

.login-logo-link,
.login-form-logo-link {
  width: max-content;
  display: block;
}

.auth-visual-logo {
  width: auto;
  height: 44px;
  max-width: 144px;
  margin: 0 0 42px;
  object-fit: contain;
}

.auth-visual .section-kicker,
.public-landing .section-kicker {
  color: var(--color-accent);
}

.auth-shell-login .auth-visual h1,
.public-landing h1 {
  margin: 10px 0 14px;
  color: #0f172a;
  font-size: 64px;
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0;
}

.auth-shell-login .auth-visual h1 span {
  display: block;
  background: linear-gradient(135deg, #4338ca, #0d9488);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-visual p {
  max-width: 560px;
  margin: 0;
  color: #475569;
  font-size: 19px;
  line-height: 1.65;
}

.login-pill {
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: rgba(238, 242, 255, 0.88);
  color: #4338ca;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 24px;
  padding: 7px 12px;
}

.login-pill i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #4f46e5;
  box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.16);
}

.login-preview {
  max-width: 500px;
  display: grid;
  gap: 16px;
  margin-top: 38px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
  padding: 22px;
}

.login-preview-head {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 16px;
}

.login-preview-head strong,
.login-preview-head span,
.login-preview-stats strong,
.login-preview-stats span,
.login-preview-row strong,
.login-preview-row span {
  display: block;
}

.login-preview-head strong,
.login-preview-row strong {
  color: #0f172a;
}

.login-preview-head span,
.login-preview-row span {
  color: #64748b;
  font-size: 13px;
}

.login-preview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.login-preview-stats span {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  padding: 14px;
}

.login-preview-stats strong {
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}

.login-preview-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #ffffff;
  padding: 14px;
}

.login-preview-row i {
  width: 8px;
  height: 44px;
  border-radius: 999px;
  background: #14b8a6;
}

.login-preview-row em {
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 6px 9px;
}

.auth-visual-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-visual-links a {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  color: #334155;
  padding: 10px 14px;
  font-weight: 800;
}

.auth-visual-links a:hover {
  border-color: #c7d2fe;
  color: #3730a3;
}

.login-form-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.64);
}

.auth-shell-login .login-form-panel {
  justify-content: flex-start;
  padding-top: clamp(72px, 12vh, 112px);
}

.login-card {
  width: min(100%, 470px);
  border: 1px solid rgba(226, 232, 240, 0.90);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
  padding: 32px;
}

.login-form-heading {
  margin-bottom: 22px;
}

.login-form-logo {
  width: auto;
  height: 40px;
  max-width: 140px;
  margin-bottom: 20px;
  object-fit: contain;
}

.login-card .section-kicker {
  color: #4338ca;
}

.login-card .auth-form-heading h1 {
  margin: 4px 0 5px;
  color: #0f172a;
  font-size: 36px;
  font-weight: 900;
}

.login-card .auth-form-heading p {
  color: #64748b;
  font-size: 15px;
  line-height: 1.55;
}

.login-form {
  gap: 14px;
}

.login-field {
  gap: 8px;
}

.login-field label {
  color: #22304a;
  font-size: 14px;
  font-weight: 800;
}

.login-field input {
  min-height: 50px;
  border-color: #dbe3ef;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 16px;
  padding: 11px 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.login-card .login-field input {
  min-height: 50px;
  border-color: #dbe3ef;
  border-radius: 12px;
  padding: 11px 14px;
}

.login-field input:hover {
  border-color: #c7d2fe;
}

.login-field input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 4px rgba(204, 251, 241, 0.72);
  outline: 0;
}

.login-submit {
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  background: #4338ca;
  color: #ffffff;
  font-size: 17px;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(67, 56, 202, 0.22);
  margin-top: 4px;
  padding: 14px 28px;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.login-card .login-submit {
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  background: #4338ca;
  padding: 14px 28px;
}

.login-submit:hover {
  background: #3730a3;
  box-shadow: 0 18px 34px rgba(67, 56, 202, 0.26);
}

.login-card .login-submit:hover {
  background: #3730a3;
  box-shadow: 0 18px 34px rgba(67, 56, 202, 0.26);
}

.login-submit:active {
  transform: translateY(1px);
}

.login-card .login-submit:active {
  transform: translateY(1px);
}

.login-submit:focus-visible {
  outline: 3px solid rgba(204, 251, 241, 0.78);
  outline-offset: 3px;
}

.login-card .login-submit:focus-visible {
  outline: 3px solid rgba(204, 251, 241, 0.78);
  outline-offset: 3px;
}

.login-links {
  gap: 16px;
  margin-top: 18px;
}

.login-links a {
  color: #4338ca;
}

.login-links a:hover {
  color: #0d9488;
}

.login-card .flash {
  border-radius: 12px;
  font-weight: 700;
}

.auth-form-heading {
  margin-bottom: 24px;
}

.auth-form-heading h1 {
  margin: 6px 0 6px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-form-heading p,
.public-landing-copy p {
  margin: 0;
  color: var(--muted);
}

.auth-flashes {
  margin-bottom: 18px;
}

.public-landing-body {
  background: var(--bg);
}

.public-landing-header {
  width: min(1180px, calc(100% - 48px));
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 18px 0;
}

.public-landing-brand img {
  width: min(170px, 48vw);
}

.public-landing-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.public-landing-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  padding: 7px 10px;
}

.public-landing-nav a:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
}

.public-landing {
  width: min(1180px, calc(100% - 48px));
  display: grid;
  gap: 46px;
  margin: 0 auto;
  padding: 18px 0 56px;
}

.public-landing-hero {
  display: grid;
  gap: 26px;
  align-content: center;
  min-height: min(680px, calc(100vh - 110px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 111, 234, 0.12), rgba(0, 194, 184, 0.12)),
    #fff;
  box-shadow: var(--shadow-soft);
  padding: clamp(28px, 6vw, 68px);
}

.public-landing-logo {
  width: min(220px, 100%);
  margin-bottom: 26px;
}

.public-landing-copy {
  max-width: 780px;
}

.public-landing-copy p {
  max-width: 620px;
  font-size: 18px;
}

.public-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button.ghost {
  border-color: rgba(11, 111, 234, 0.18);
  background: transparent;
  color: var(--accent);
}

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

.public-landing-signals article,
.public-feature-card,
.public-audience-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.public-landing-signals span,
.public-feature-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.public-landing-signals strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
}

.public-landing-section {
  display: grid;
  gap: 20px;
}

.public-section-heading {
  max-width: 760px;
}

.public-section-heading h2,
.public-landing-final h2 {
  margin: 8px 0 8px;
  color: var(--text);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.public-section-heading p,
.public-feature-card p,
.public-audience-grid p,
.public-landing-final p {
  margin: 0;
  color: var(--muted);
}

.public-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.public-feature-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.public-feature-card h3,
.public-audience-grid strong {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.public-audience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.public-audience-grid article {
  display: grid;
  gap: 8px;
}

.public-landing-final {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07133f;
  color: #fff;
  padding: 28px;
}

.public-landing-final h2 {
  color: #fff;
}

.public-landing-final p {
  color: #dbeafe;
}

.public-landing-final .button.ghost {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.auth-links a {
  color: var(--color-primary);
  font-weight: 800;
  text-decoration: none;
}

.brand-logo {
  height: auto;
  object-fit: contain;
}

.brand-logo-login {
  width: min(220px, 100%);
}

.login-card .login-form-logo {
  width: auto;
  height: 40px;
  max-width: 140px;
}

.brand-logo-sidebar {
  width: min(150px, 100%);
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  padding: 3px 4px;
  box-shadow: 0 10px 24px rgba(11, 111, 234, 0.18);
}

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

.brand-row-logo {
  justify-content: flex-start;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.brand-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.sidebar-brand.brand-block {
  align-items: flex-start;
}

.brand-row h1,
.brand-row p {
  margin: 0;
}

.brand-row h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.brand-row p,
.muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .auth-shell-split,
  .auth-shell-login {
    grid-template-columns: 1fr;
  }

  .auth-shell-login .auth-visual {
    min-height: auto;
    padding: 28px 24px 24px;
  }

  .login-brand-panel::before {
    inset: 16px;
    border-radius: 18px;
  }

  .login-brand-content {
    max-width: 760px;
    padding: 8px;
  }

  .auth-shell-login .auth-visual-logo {
    width: auto;
    height: 38px;
    max-width: 132px;
    margin-bottom: 24px;
  }

  .auth-shell-login .auth-visual h1,
  .public-landing h1 {
    font-size: 42px;
  }

  .auth-shell-split .auth-panel,
  .auth-shell-login .auth-panel {
    min-height: auto;
    padding: 28px 24px 42px;
  }

  .login-form-panel {
    background: transparent;
  }

  .login-card {
    width: min(100%, 520px);
    margin: 0 auto;
  }

  .public-feature-grid,
  .public-audience-grid,
  .public-landing-signals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .auth-shell-login .auth-visual {
    padding: 20px 16px 10px;
  }

  .login-brand-panel::before,
  .login-brand-panel::after,
  .login-preview {
    display: none;
  }

  .login-brand-content {
    padding: 0;
  }

  .login-logo-link {
    margin-bottom: 18px;
  }

  .auth-shell-login .auth-visual-logo {
    margin-bottom: 0;
  }

  .login-pill {
    width: 100%;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .login-pill i {
    margin-top: 5px;
  }

  .auth-shell-login .auth-visual h1 {
    margin-bottom: 0;
    font-size: 30px;
  }

  .auth-visual p {
    display: none;
  }

  .auth-visual-links {
    display: none;
  }

  .auth-shell-login .auth-panel {
    padding: 18px 16px 36px;
  }

  .login-card {
    border-radius: 16px;
    padding: 26px 20px;
  }

  .login-form-logo {
    height: 36px;
    margin-bottom: 22px;
  }

  .login-card .auth-form-heading h1 {
    font-size: 32px;
  }

  .public-landing-header,
  .public-landing {
    width: min(100% - 32px, 1180px);
  }

  .public-landing-header,
  .public-landing-final {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-landing-hero {
    min-height: auto;
  }

  .public-feature-grid,
  .public-audience-grid,
  .public-landing-signals {
    grid-template-columns: 1fr;
  }

  .public-section-heading h2,
  .public-landing-final h2 {
    font-size: 26px;
  }
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 800;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: 0 0 auto;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
}

.sidebar-brand strong {
  display: block;
  font-size: 18px;
}

.sidebar-brand span,
.nav-section {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.space-card {
  border: 1px solid rgba(229, 234, 242, 0.16);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.space-card img,
.space-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.space-card-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.space-card strong {
  display: block;
  line-height: 1.2;
}

.space-card small {
  color: var(--sidebar-muted);
}

.space-card select {
  width: 100%;
  background: #0d1c50;
  color: #fff;
  border: 1px solid rgba(185, 198, 216, 0.28);
  border-radius: 8px;
  padding: 9px;
}

.context-role-switcher {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.context-role-switcher label {
  font-size: 12px;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.nav a,
.logout-button {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 12px;
  color: #edf5f0;
  background: transparent;
  border: 0;
  width: 100%;
  cursor: pointer;
}

.nav a:hover,
.nav a.active,
.logout-button:hover {
  background: rgba(11, 111, 234, 0.20);
}

.nav a.active {
  box-shadow: inset 3px 0 0 var(--turquoise);
}

.nav-icon {
  width: 22px;
  text-align: center;
  color: #d8e3f2;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar-meta {
  color: var(--muted);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.flash.success {
  border-color: rgba(0, 212, 126, 0.38);
  background: #ecfdf5;
  color: var(--ok);
}

.flash.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

.flash.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: var(--warning);
}

.flash.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--info);
}

.section {
  display: grid;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(7, 19, 63, 0.04);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: var(--navy);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.card,
.expandable-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card-body {
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-header h3,
.card-header p {
  margin: 0;
}

.card-header p {
  margin-top: 4px;
  color: var(--muted);
}

.expandable-card.is-collapsed,
[hidden] {
  display: none !important;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--surface-2);
}

tbody tr:hover {
  background: #fbfdff;
}

tr:last-child td {
  border-bottom: 0;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid transparent;
}

.badge.ok,
.badge.active {
  background: #ecfdf5;
  color: var(--ok);
  border-color: rgba(0, 212, 126, 0.28);
}

.badge.inactive {
  background: #f1f5f9;
  color: var(--muted);
  border-color: #dbe3ee;
}

.badge.archived,
.badge.deleted {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.badge.warning {
  background: #fffbeb;
  color: var(--warning);
  border-color: #fde68a;
}

.badge.info {
  background: #eff6ff;
  color: var(--info);
  border-color: #bfdbfe;
}

.badge.expired,
.badge.suspended,
.badge.error,
.badge.cancelled,
.badge.canceled {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

.badge.suspended {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.badge.expired {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-active,
.status-paid {
  background: #ecfdf5;
  color: var(--ok);
  border-color: rgba(0, 212, 126, 0.28);
}

.status-inactive {
  background: #f1f5f9;
  color: var(--muted);
  border-color: #dbe3ee;
}

.status-suspended,
.status-overdue {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

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

.button,
button.button,
.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(11, 111, 234, 0.16);
}

.button:hover {
  background: var(--accent-dark);
}

.button:focus-visible,
.field input:focus,
.field select:focus,
.field textarea:focus,
.space-card select:focus {
  outline: 3px solid rgba(0, 194, 184, 0.26);
  outline-offset: 2px;
  border-color: var(--accent);
}

.public-landing-nav a:focus-visible,
.public-landing-actions a:focus-visible,
.portal-nav a:focus-visible,
.portal-filter-tabs a:focus-visible,
.portal-quick-card:focus-visible,
.sidebar-toggle:focus-visible,
.logout-button:focus-visible,
.modal-close:focus-visible {
  outline: 3px solid rgba(0, 194, 184, 0.32);
  outline-offset: 2px;
}

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.button.secondary:hover {
  background: var(--surface-2);
}

.button.danger,
.btn-danger {
  background: var(--danger);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.14);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.button.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}

.filter-bar,
.form-grid {
  display: grid;
  gap: 12px;
}

.filter-bar {
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  align-items: end;
}

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

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

.form-wide {
  grid-column: 1 / -1;
}

.payment-edit-form {
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #22304a;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 19, 63, 0.48);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(7, 19, 63, 0.24);
  padding: 22px;
}

.modal-content h2 {
  margin: 10px 0 8px;
}

.modal-content p {
  color: var(--muted);
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.alert-success {
  border-color: rgba(0, 212, 126, 0.38);
  background: #ecfdf5;
  color: var(--ok);
}

.alert-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: var(--warning);
}

.alert-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

.profile-head {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.profile-photo {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

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

.definition {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

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

.definition strong {
  display: block;
  margin-top: 4px;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.cover-preview {
  width: 100%;
  height: 190px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.profile-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.profile-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.profile-block h3 {
  margin-top: 0;
}

.profile-block-wide {
  grid-column: 1 / -1;
}

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

.mobile-only {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .grid-2,
  .profile-grid,
  .form-grid.two,
  .form-grid.three,
  .filter-bar,
  .profile-head,
  .definition-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .content,
  .topbar,
  .sidebar {
    padding: 18px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-panel {
    padding: 24px;
  }
}

/* Fase 4.3: Perfil Persona, privacidad por gimnasio y vinculación de socios. */
.onboarding-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff 0%, #f5f7ff 100%);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.onboarding-profile-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #eef2ff;
  color: var(--color-primary);
}

.onboarding-profile-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding-profile-copy,
.onboarding-profile-copy p,
.onboarding-profile-heading h2 {
  margin: 0;
}

.onboarding-profile-copy {
  display: grid;
  gap: 8px;
}

.onboarding-profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.onboarding-profile-heading h2 {
  color: var(--color-navy);
  font-size: 21px;
}

.profile-privacy-summary {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.person-profile-hero {
  align-items: flex-end;
}

.person-profile-hero h2 {
  margin: 6px 0 4px;
  color: var(--color-navy);
  font-size: 28px;
  letter-spacing: 0;
}

.profile-back-link {
  display: block;
  width: max-content;
  margin-bottom: 14px;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.profile-back-link:hover {
  text-decoration: underline;
}

.privacy-notice {
  display: grid;
  gap: 4px;
  border: 1px solid #c7d2fe;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: #f5f7ff;
  color: var(--color-navy);
  padding: 13px 15px;
}

.privacy-notice strong,
.privacy-notice p {
  margin: 0;
}

.privacy-notice p {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.5;
}

.privacy-notice.is-warning {
  border-color: #fde68a;
  border-left-color: var(--color-warning);
  background: #fffbeb;
}

.privacy-notice.is-success {
  border-color: #a7f3d0;
  border-left-color: #059669;
  background: #ecfdf5;
}

.person-profile-form {
  display: grid;
  gap: 18px;
}

.profile-form-section {
  display: grid;
  gap: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.profile-form-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.profile-form-section-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-form-section-header h2,
.profile-form-section-header p {
  margin: 0;
}

.profile-form-section-header h2 {
  color: var(--color-navy);
  font-size: 19px;
}

.profile-form-section-header p {
  max-width: 480px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.profile-section-number {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #eef2ff;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 900;
}

.optional-label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
}

.field input[readonly] {
  background: #f8fafc;
  color: var(--color-muted);
}

[data-health-insurance-field] {
  transition: opacity 0.15s ease;
}

[data-health-insurance-field].is-disabled {
  opacity: 0.58;
}

.health-insurance-control {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 12px;
}

.profile-inline-help {
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-md);
  background: #f5f7ff;
  padding: 12px 14px;
}

.profile-inline-help strong,
.profile-inline-help p {
  margin: 0;
}

.profile-inline-help p {
  color: var(--color-muted);
  font-size: 13px;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 16px 20px;
}

.profile-form-actions p {
  margin: 0 auto 0 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-consents-section {
  display: grid;
  gap: 16px;
  padding-top: 8px;
}

.profile-consents-heading h2,
.profile-consents-heading p {
  margin: 0;
}

.profile-consents-heading h2 {
  margin-top: 6px;
  color: var(--color-navy);
  font-size: 24px;
}

.profile-consents-heading p {
  margin-top: 4px;
}

.profile-consents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.consent-gym-card {
  display: grid;
  align-content: start;
  gap: 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.consent-gym-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.consent-gym-header h3,
.consent-gym-header p {
  margin: 0;
}

.consent-gym-header h3 {
  color: var(--color-navy);
  font-size: 18px;
}

.consent-gym-header p {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.gym-requirements-summary {
  display: grid;
  gap: 8px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 12px;
}

.gym-requirements-summary > strong {
  color: var(--color-navy);
  font-size: 13px;
}

.requirement-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.requirement-chip {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: var(--color-muted);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
}

.requirement-chip.is-required {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.consent-form,
.consent-form fieldset {
  display: grid;
  gap: 10px;
}

.consent-form fieldset {
  margin: 0;
  border: 0;
  padding: 0;
}

.consent-form legend {
  margin-bottom: 2px;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 900;
}

.consent-option {
  display: grid;
  gap: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}

.consent-option > span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.consent-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: var(--color-primary);
}

.consent-option strong {
  color: var(--color-navy);
  font-size: 13px;
}

.consent-option small {
  padding-left: 26px;
  color: var(--color-muted);
  line-height: 1.35;
}

.consent-option.is-disabled {
  background: #f8fafc;
  cursor: not-allowed;
  opacity: 0.7;
}

.consent-scope-note {
  margin: 2px 0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.consent-required-action {
  display: grid;
  gap: 9px;
  justify-items: start;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  background: #fffbeb;
  padding: 11px 12px;
}

.consent-required-action.is-missing {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.consent-required-action p {
  margin: 0;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.gym-requirements-fields {
  display: grid;
  gap: 12px;
  margin: 4px 0;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-md);
  background: #f5f7ff;
  padding: 15px;
}

.gym-requirements-fields legend {
  color: var(--color-navy);
  font-size: 14px;
  font-weight: 900;
  padding: 0 6px;
}

.gym-requirement-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gym-requirement-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
  cursor: pointer;
}

.gym-requirement-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--color-primary);
}

.gym-requirement-option span {
  display: grid;
  gap: 3px;
}

.gym-requirement-option strong {
  color: var(--color-navy);
  font-size: 13px;
}

.gym-requirement-option small {
  color: var(--color-muted);
  line-height: 1.4;
}

.person-link-search {
  display: grid;
  gap: 13px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff 0%, #f5f7ff 100%);
  padding: 16px;
}

.person-link-search-heading h3,
.person-link-search-heading p {
  margin: 0;
}

.person-link-search-heading h3 {
  margin-top: 7px;
  color: var(--color-navy);
  font-size: 17px;
}

.person-link-search-heading p,
.person-search-privacy-note {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.45;
}

.person-search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.person-search-result {
  display: grid;
  gap: 7px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
}

.person-search-result[hidden] {
  display: none;
}

.person-search-result strong,
.person-search-result p {
  margin: 0;
}

.person-search-result p {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.4;
}

.person-search-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.person-search-result-note {
  font-weight: 700;
}

.person-search-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding-top: 3px;
}

.person-search-category {
  display: grid;
  gap: 2px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: #f8fafc;
  padding: 8px 9px;
}

.person-search-category span,
.person-search-category strong {
  font-size: 11px;
}

.person-search-category span {
  color: var(--color-muted);
}

.person-search-category strong.is-available {
  color: #047857;
}

.person-search-category strong.is-pending {
  color: #b45309;
}

.person-search-result.is-selected,
.person-link-search.has-selected-person {
  border-color: #a7f3d0;
}

.person-search-result.is-selected {
  border-left-color: #059669;
  background: #ecfdf5;
}

.person-search-result.is-error {
  border-color: #fecaca;
  border-left-color: var(--color-danger);
  background: #fef2f2;
}

.person-search-result.is-empty,
.person-search-result.is-manual {
  border-left-color: #64748b;
  background: #f8fafc;
}

.person-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 3px;
}

.member-billing-preview,
.billing-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.member-billing-preview strong,
.member-billing-preview p,
.billing-panel h3,
.billing-panel p {
  margin: 0;
}

.member-billing-preview p,
.billing-panel p {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.45;
}

.billing-operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.inline-generation-form {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto;
  gap: 10px;
  align-items: end;
}

.payment-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.payment-filter-tabs a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-muted);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
}

.payment-filter-tabs a.active,
.payment-filter-tabs a:hover {
  border-color: var(--color-primary);
  background: #eef2ff;
  color: var(--color-primary);
}

.table-subtle {
  display: block;
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
}

.table-actions {
  min-width: 126px;
}

.inline-action-form {
  display: inline-flex;
  margin: 0;
}

.payment-alert-list {
  display: grid;
  gap: 10px;
}

.payment-alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 11px 12px;
}

.payment-alert-item strong,
.payment-alert-item small {
  display: block;
}

.payment-alert-item small {
  margin-top: 2px;
  color: var(--color-muted);
}

.payment-alert-item.is-overdue {
  border-color: #fecaca;
}

.field.is-disabled {
  opacity: 0.65;
}

.access-option.is-disabled {
  opacity: 0.65;
}

.member-pending-note {
  margin-top: 3px;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
}

.member-requirements-notice {
  margin-bottom: 16px;
}

.badge.pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

@media (max-width: 860px) {
  .onboarding-profile-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .onboarding-profile-card > .button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .gym-requirement-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .onboarding-profile-card,
  .person-search-controls,
  .profile-consents-grid,
  .person-search-categories {
    grid-template-columns: 1fr;
  }

  .onboarding-profile-icon {
    width: 46px;
    height: 46px;
  }

  .onboarding-profile-heading,
  .profile-form-section-header,
  .profile-form-actions,
  .consent-gym-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-form-section,
  .consent-gym-card {
    padding: 17px;
  }

  .profile-form-section-header p {
    text-align: left;
  }

  .profile-form-actions .button,
  .person-search-controls .button,
  .person-search-actions .button,
  .inline-generation-form .button,
  .consent-form > .button,
  .consent-required-action .button {
    width: 100%;
  }

  .billing-operation-grid,
  .inline-generation-form {
    grid-template-columns: 1fr;
  }

  .person-search-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Fase 2.2: sistema visual administrativo inspirado en la referencia Figma. */
body {
  background: var(--color-bg);
  color: var(--color-text);
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
  background: var(--color-bg);
}

.app-sidebar,
.sidebar {
  background:
    linear-gradient(180deg, rgba(79, 70, 229, 0.10), transparent 240px),
    var(--color-sidebar);
  padding: 24px 18px;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.brand-logo-sidebar {
  width: min(164px, 100%);
  padding: 4px 6px;
  border-radius: var(--radius-md);
}

.brand-subtitle {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.gym-active-card,
.space-card {
  border-color: rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gym-logo-active,
.space-card img,
.space-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.space-card select {
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
}

.nav-section {
  margin: 18px 0 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a,
.logout-button {
  min-height: 42px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-weight: 700;
}

.nav a:hover,
.logout-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav a.active {
  background: rgba(79, 70, 229, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.nav-icon {
  width: 26px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.app-header,
.topbar {
  min-height: 82px;
  padding: 18px 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.page-title {
  color: var(--color-navy);
  font-size: 26px;
  font-weight: 800;
}

.page-subtitle,
.topbar-meta {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.user-chip {
  min-height: 46px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}

.user-chip span {
  display: grid;
  line-height: 1.15;
}

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

.user-menu {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.user-menu__trigger {
  max-width: min(280px, 44vw);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.user-menu__trigger:hover,
.user-menu__trigger:focus-visible,
.user-menu__trigger[aria-expanded="true"] {
  border-color: rgba(47, 111, 237, 0.42);
  background: var(--surface-soft);
  color: var(--color-text);
  outline: none;
}

.user-menu__trigger:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.18);
}

.user-menu__identity {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.user-menu__identity strong,
.user-menu__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu__identity strong {
  color: var(--color-text);
}

.user-menu__chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0.7;
}

.user-menu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: min(248px, calc(100vw - 24px));
  display: none;
  gap: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 6px;
}

.user-menu__dropdown.is-open {
  display: grid;
}

.user-menu__dropdown form {
  margin: 0;
}

.user-menu__item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  padding: 9px 10px;
  text-align: left;
  text-decoration: none;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
  background: var(--surface-soft);
  color: var(--color-primary);
  outline: none;
}

.user-menu__item:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(47, 111, 237, 0.22);
}

.user-menu__item-danger {
  color: var(--color-danger);
}

.user-menu__item-danger:hover,
.user-menu__item-danger:focus-visible {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.user-menu__divider {
  height: 1px;
  margin: 4px 2px;
  background: var(--color-border);
}

.content-wrap,
.content {
  width: min(1440px, 100%);
  padding: 30px 32px;
  gap: 24px;
}

.page-header,
.section-header {
  align-items: center;
}

.section-header h2,
.panel h2,
.card-header h2,
.card-header h3,
.profile-block-title {
  color: var(--color-navy);
  font-weight: 800;
}

.panel,
.card,
.expandable-card,
.profile-header,
.profile-block,
.table-card,
.table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.panel,
.profile-header,
.profile-block {
  padding: 20px;
}

.card-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

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

.metric,
.kpi-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.metric::after,
.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.metric span,
.kpi-label {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong,
.kpi-value {
  color: var(--color-navy);
  font-size: 30px;
  font-weight: 850;
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #eef2ff;
  color: var(--color-primary);
  font-weight: 900;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #ecfdf5;
  color: var(--color-success);
  font-size: 12px;
  font-weight: 800;
}

.table-toolbar,
.filter-bar {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.table-responsive,
.table-wrap {
  overflow-x: auto;
}

.data-table,
table {
  min-width: 760px;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.04em;
}

td {
  color: #334155;
}

tbody tr:hover {
  background: #f8fafc;
}

.avatar {
  border-radius: 12px;
}

.button,
button.button,
.btn,
.btn-primary {
  min-height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.20);
}

.button:hover,
.btn-primary:hover {
  background: var(--color-primary-hover);
}

.button.secondary,
.btn-secondary,
.btn-ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: none;
}

.button.secondary:hover,
.btn-secondary:hover,
.btn-ghost:hover {
  background: #f8fafc;
}

.button.danger,
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.button.warning,
.btn-warning {
  background: var(--color-warning);
  color: #111827;
}

.badge,
.status-badge {
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 800;
}

.badge.ok,
.badge.active,
.badge-success,
.status-active,
.status-paid {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge.warning,
.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge.info,
.badge-info {
  background: #eef2ff;
  color: var(--color-primary);
  border-color: #c7d2fe;
}

.badge.inactive,
.badge-muted,
.status-inactive {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.badge.archived,
.badge.deleted,
.status-archived {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.badge.expired,
.badge.suspended,
.badge.cancelled,
.badge-danger,
.status-suspended,
.status-overdue,
.status-cancelled {
  background: #fef2f2;
  color: var(--color-danger);
  border-color: #fecaca;
}

.field label,
.form-label {
  color: #334155;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea,
.form-control,
.form-select {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  min-height: 42px;
}

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

.form-error {
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
}

.modal-content {
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.modal-body {
  padding: 8px 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.profile-header {
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(0, 194, 184, 0.08)),
    var(--color-surface);
}

.profile-avatar,
.profile-photo {
  border-radius: 18px;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.profile-grid {
  gap: 18px;
}

.profile-block-title,
.profile-block h3 {
  margin: 0 0 12px;
}

.profile-field {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

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

.profile-value {
  color: var(--color-text);
  font-weight: 800;
}

.attendance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.attendance-scanner-card,
.attendance-result-card,
.attendance-history-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.cover-preview {
  border-radius: var(--radius-lg);
}

@media (max-width: 1080px) {
  .metric-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar,
  .sidebar {
    position: static;
    height: auto;
  }

  .attendance-layout {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 680px) {
  .content-wrap,
  .content,
  .app-header,
  .topbar,
  .app-sidebar,
  .sidebar {
    padding: 18px;
  }

  .user-chip {
    max-width: 100%;
  }

  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Fase 2.3: ajustes finales de UI administrativa. */
.content-wrap,
.content {
  width: 100%;
  max-width: none;
}

.main,
.app-main {
  min-width: 0;
}

.full-width-section,
.table-card,
.table-wrap,
.data-table {
  width: 100%;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
}

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

.dashboard-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.dashboard-chart-card,
.dashboard-payments-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.compact-table {
  min-width: 680px;
}

.kpi-value-muted {
  color: var(--color-muted);
}

.trend-badge.neutral {
  width: max-content;
  background: #f1f5f9;
  color: #64748b;
}

.attendance-chart {
  min-height: 240px;
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 18px 6px 6px;
}

.attendance-bar {
  height: 220px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  align-items: end;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font: inherit;
}

.attendance-bar-value,
.attendance-bar-label {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.attendance-bar-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 999px;
  background: #eef2ff;
  overflow: hidden;
}

.attendance-bar-fill {
  width: 100%;
  height: var(--bar-height);
  min-height: 6px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--color-accent), var(--color-primary));
  transition: height 0.18s ease, background 0.18s ease;
}

.attendance-bar:hover .attendance-bar-fill,
.attendance-bar.is-active .attendance-bar-fill {
  background: linear-gradient(180deg, #22d3ee, var(--color-primary-hover));
}

.attendance-bar.is-active {
  color: var(--color-primary);
}

.attendance-day-panels {
  margin-top: 16px;
}

.attendance-day-detail {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #f8fafc;
  padding: 16px;
}

.detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-heading strong,
.detail-heading span {
  display: block;
}

.detail-heading span {
  color: var(--color-muted);
  font-size: 13px;
}

.attendance-detail-list {
  display: grid;
  gap: 10px;
}

.attendance-detail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
}

.attendance-detail-item span,
.attendance-detail-item small {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
}

.attendance-detail-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  text-align: right;
}

.action-popover {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.action-popover-trigger {
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.action-popover-trigger:hover,
.action-popover-trigger[aria-expanded="true"] {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: var(--color-primary);
}

.action-popover-menu {
  position: fixed;
  z-index: 80;
  width: 210px;
  display: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 6px;
}

.action-popover-menu.is-open {
  display: grid;
  gap: 2px;
}

.action-popover-menu form {
  margin: 0;
}

.action-popover-item {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  padding: 8px 10px;
  text-align: left;
  text-decoration: none;
}

.action-popover-item:hover {
  background: #f8fafc;
}

.action-popover-item-danger {
  color: var(--color-danger);
}

.action-popover-item-danger:hover {
  background: #fef2f2;
}

.action-popover-item.is-disabled {
  color: var(--color-muted);
  cursor: default;
}

.action-popover-item.is-disabled:hover {
  background: transparent;
}

.modal {
  z-index: 120;
}

.modal-panel,
.modal-content {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.modal-wide {
  width: min(980px, calc(100vw - 32px));
}

.confirm-modal-panel {
  width: min(460px, calc(100vw - 32px));
}

.modal-header {
  align-items: flex-start;
}

.modal-title {
  margin: 8px 0 4px;
}

.modal-description {
  margin: 0;
}

.modal-body {
  margin-top: 16px;
}

.modal-footer {
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .attendance-chart {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    gap: 8px;
    overflow-x: auto;
  }

  .attendance-bar {
    height: 180px;
  }

  .attendance-detail-item {
    grid-template-columns: 1fr;
  }

  .attendance-detail-meta {
    justify-content: flex-start;
    text-align: left;
  }

  .modal-wide {
    width: calc(100vw - 24px);
  }
}

/* Fase 3: reportes administrativos y cobranzas. */
.section-kicker {
  display: inline-flex;
  width: max-content;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 850;
  padding: 3px 9px;
}

.reports-header {
  grid-template-columns: minmax(0, 1fr) minmax(520px, auto);
  align-items: end;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.reports-header h2 {
  margin: 6px 0 4px;
  color: var(--color-navy);
  font-size: 28px;
}

.reports-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.reports-filter .field {
  gap: 5px;
}

.reports-filter .field span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.report-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 10px;
}

.report-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-md);
  color: var(--color-muted);
  font-weight: 800;
  padding: 7px 11px;
}

.report-nav a:hover {
  background: #f8fafc;
  color: var(--color-primary);
}

.reports-kpi-grid .metric {
  min-height: 134px;
}

.dashboard-hero-actions {
  justify-content: flex-end;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.reports-grid-main {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

.report-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.report-card .section-header {
  align-items: flex-start;
}

.report-card .section-header h2 {
  margin: 0;
  color: var(--color-navy);
}

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

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

.report-mini-stat {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid #e5eaf2;
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 12px;
}

.report-mini-stat span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.report-mini-stat strong {
  color: var(--color-navy);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.report-bars {
  display: grid;
  gap: 12px;
}

.report-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(150px, 1fr) minmax(72px, auto);
  gap: 12px;
  align-items: center;
}

.report-bar-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bar-row strong {
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.report-bar-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2ff;
}

.report-bar-fill {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), #2563eb);
}

.report-bar-fill.accent {
  background: linear-gradient(90deg, #0ea5e9, var(--color-primary));
}

.report-bar-fill.teal {
  background: linear-gradient(90deg, var(--color-accent), #10b981);
}

.report-table td,
.report-table th {
  white-space: nowrap;
}

.report-table td:first-child,
.report-table th:first-child {
  min-width: 190px;
}

.report-card .empty {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.action-popover-item[data-copy-text] {
  justify-content: flex-start;
}

@media (max-width: 1180px) {
  .reports-header,
  .reports-grid,
  .reports-grid-main {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .reports-header {
    padding: 18px;
  }

  .reports-filter,
  .report-mini-grid,
  .report-collection-summary {
    grid-template-columns: 1fr;
  }

  .report-bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .report-bar-row strong {
    text-align: left;
  }

  .dashboard-hero-actions {
    justify-content: stretch;
  }

  .dashboard-hero-actions .button {
    width: 100%;
  }
}

/* Fase 4: clases, horarios, cupos e inscripciones. */
.classes-hero,
.classes-week-card,
.classes-list-card,
.class-detail-card,
.dashboard-classes-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.classes-hero {
  grid-template-columns: minmax(0, 1fr) auto;
}

.classes-hero h2 {
  margin: 6px 0 4px;
  color: var(--color-navy);
  font-size: 28px;
}

.onboarding-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.onboarding-card {
  display: grid;
  gap: 16px;
}

.onboarding-card h2 {
  margin: 0 0 2px;
  color: var(--color-navy);
  font-size: 18px;
}

.empty-state-card {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.empty-state-card h2 {
  margin: 0;
  color: var(--color-navy);
}

.classes-layout,
.classes-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  gap: 20px;
  align-items: start;
}

.class-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.class-week-nav h2,
.class-week-nav p {
  margin: 0;
  text-align: center;
}

.class-week-nav p {
  color: var(--color-muted);
}

.class-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.class-day-column {
  min-width: 190px;
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 10px;
}

.class-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.class-day-heading span,
.class-day-empty,
.class-session-meta,
.class-session-footer {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.class-day-sessions {
  display: grid;
  gap: 9px;
}

.class-session-card {
  display: grid;
  gap: 7px;
  min-height: 132px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
}

.class-session-card strong {
  min-width: 0;
  color: var(--color-navy);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.class-session-card.is-full {
  border-left-color: var(--color-warning);
}

.class-session-card.is-cancelled {
  border-left-color: var(--color-danger);
  opacity: 0.72;
}

.class-session-top,
.class-session-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.class-session-time {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 900;
}

.class-capacity-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2ff;
}

.class-capacity-fill {
  display: block;
  width: var(--capacity-pct);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
}

.class-list {
  display: grid;
  gap: 10px;
}

.class-list-item,
.class-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
}

.class-list-item span,
.class-history-item span,
.class-history-item small {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
}

.class-list-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.class-detail-header h2 {
  margin: 4px 0;
  color: var(--color-navy);
}

.class-detail-icon {
  width: 78px;
  height: 78px;
  font-size: 22px;
}

.class-attendance-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.class-history-list {
  display: grid;
  gap: 10px;
}

.is-selected-row td {
  background: #eef2ff;
}

.badge.scheduled,
.badge.enrolled,
.badge.present {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge.completed,
.badge.justified {
  background: #eef2ff;
  color: var(--color-primary);
  border-color: #c7d2fe;
}

.badge.absent,
.badge.no_show {
  background: #fef2f2;
  color: var(--color-danger);
  border-color: #fecaca;
}

.badge.late {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

@media (max-width: 1180px) {
  .classes-layout,
  .classes-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .classes-hero {
    grid-template-columns: 1fr;
  }

  .class-week-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .class-week-nav h2,
  .class-week-nav p {
    text-align: left;
  }

  .class-week-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .class-day-column {
    min-width: 0;
  }

  .class-list-item,
  .class-history-item,
  .class-attendance-filter {
    grid-template-columns: 1fr;
  }

  .class-list-meta {
    justify-content: flex-start;
  }
}

/* Fase 4.2: onboarding limpio, navegación por rol, sidebar responsive y filtros compactos. */
.sidebar-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-navy);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.app-header > .sidebar-toggle {
  display: none;
}

.sidebar-control {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.app-sidebar .sidebar-toggle,
.sidebar .sidebar-toggle {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}

.app-sidebar .sidebar-toggle:hover,
.sidebar .sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-overlay {
  display: none;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-collapsed .app-sidebar,
body.sidebar-collapsed .sidebar {
  padding: 22px 12px;
  overflow-x: hidden;
}

body.sidebar-collapsed .brand-logo-sidebar {
  width: 56px;
  padding: 3px;
}

body.sidebar-collapsed .sidebar-control {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .space-card {
  display: none;
}

body.sidebar-collapsed .brand-subtitle,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .gym-active-card form,
body.sidebar-collapsed .space-card-header div {
  display: none;
}

body.sidebar-collapsed .space-card {
  padding: 10px;
}

body.sidebar-collapsed .space-card-header {
  justify-content: center;
  margin-bottom: 0;
}

body.sidebar-collapsed .nav a,
body.sidebar-collapsed .logout-button {
  justify-content: center;
  gap: 0;
  padding: 10px;
}

body.sidebar-collapsed .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.onboarding-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 22px;
  margin: 0 auto;
  padding: 28px;
}

.onboarding-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 14px 18px;
}

.onboarding-topbar .brand-logo-login {
  width: min(176px, 46vw);
}

.user-mini-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.onboarding-hero-clean,
.onboarding-card,
.onboarding-empty,
.member-home-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.onboarding-hero-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.onboarding-hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
}

.onboarding-hub-copy {
  max-width: 680px;
}

.onboarding-hub-copy .muted {
  max-width: 620px;
  margin: 0;
}

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

.onboarding-hub-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.onboarding-hub-summary article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.onboarding-hub-summary span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-hub-summary strong {
  color: var(--color-navy);
  font-size: 22px;
}

.onboarding-hub-summary p {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.onboarding-hero-clean h1,
.member-home-card h2 {
  margin: 6px 0 4px;
  color: var(--color-navy);
  font-size: 28px;
  letter-spacing: 0;
}

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

.onboarding-create-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
}

.onboarding-create-card h2 {
  margin: 4px 0 0;
}

.onboarding-logout {
  display: flex;
  justify-content: flex-end;
}

.force-password-card {
  margin-bottom: 18px;
}

.access-option {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 12px;
}

.filter-card,
.results-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.filter-card {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
}

.filter-grid {
  flex: 1 1 520px;
  display: grid;
  gap: 12px;
  align-items: end;
}

.members-filter-grid {
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 180px);
}

.users-filter-grid {
  grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(150px, 180px));
}

.filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.results-card {
  overflow: hidden;
}

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

.results-card .table-responsive {
  width: 100%;
}

.results-card .data-table {
  margin: 0;
}

.compact-empty,
.compact-empty-cell {
  min-height: 0;
  padding: 18px;
}

.results-table {
  min-height: 0;
}

.table-count {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
}

.member-home {
  max-width: 760px;
}

.member-home-card {
  display: grid;
  gap: 12px;
  justify-items: start;
}

@media (max-width: 980px) {
  body.sidebar-collapsed .app-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar,
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 110;
    width: min(320px, 86vw);
    height: 100vh;
    transform: translateX(calc(-100% + 68px));
    transition: transform 0.18s ease;
    overflow: hidden;
    padding: 14px 10px;
  }

  body.sidebar-open .app-sidebar,
  body.sidebar-open .sidebar {
    transform: translateX(0);
    overflow-y: auto;
    padding: 24px 18px;
  }

  body:not(.sidebar-open) .app-sidebar .sidebar-brand,
  body:not(.sidebar-open) .app-sidebar .space-card,
  body:not(.sidebar-open) .app-sidebar .nav-section,
  body:not(.sidebar-open) .app-sidebar .nav {
    display: none;
  }

  body:not(.sidebar-open) .app-sidebar .sidebar-control {
    justify-content: center;
    margin-bottom: 0;
  }

  body:not(.sidebar-open) .app-main {
    padding-left: 68px;
  }

  body.sidebar-open .app-main {
    padding-left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.46);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .app-header,
  .topbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .page-heading {
    min-width: 0;
    flex: 1 1 220px;
  }

  .filter-card,
  .filter-grid,
  .members-filter-grid,
  .users-filter-grid,
  .onboarding-hub-summary,
  .onboarding-create-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .filter-actions .button,
  .filter-actions .btn {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .onboarding-shell {
    padding: 18px;
  }

  .onboarding-topbar,
  .onboarding-hero-clean {
    align-items: flex-start;
    flex-direction: column;
  }

  .onboarding-hub-hero {
    grid-template-columns: 1fr;
  }

  .onboarding-hub-actions {
    justify-content: flex-start;
  }

  .onboarding-hero-clean h1,
  .member-home-card h2 {
    font-size: 24px;
  }
}

/* Fase 4.4: Portal Persona separado del panel administrativo. */
.portal-body {
  background: #f6f8fb;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  background: #07133f;
  color: #eef5ff;
  overflow-y: auto;
}

.portal-sidebar-control {
  display: flex;
  justify-content: flex-end;
}

.portal-sidebar-toggle {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #eef5ff;
}

.portal-mobile-toggle {
  display: none;
  flex: 0 0 auto;
}

.portal-brand {
  display: grid;
  gap: 10px;
  font-weight: 800;
}

.portal-nav,
.portal-logout {
  display: grid;
  gap: 8px;
}

.portal-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #dbe7f7;
  font-weight: 700;
}

.portal-nav-icon {
  width: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  color: #b9c6d8;
}

.portal-nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-nav-label,
.portal-logout-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-nav a:hover,
.portal-nav a.active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.portal-logout {
  margin-top: auto;
}

.portal-logout .button.secondary {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  gap: 10px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #dbe7f7;
}

.portal-logout .button.secondary:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.portal-main {
  width: 100%;
  min-width: 0;
  display: block;
  grid-template-rows: none;
  margin: 0;
  padding: 0 0 28px;
}

.portal-main > :not(.portal-topbar):not(.flash-stack) {
  width: min(1180px, calc(100% - 56px));
  margin-left: auto;
  margin-right: auto;
}

.portal-main > .flash-stack {
  width: min(1180px, calc(100% - 56px));
  margin: 18px auto;
}

.portal-topbar,
.portal-hero,
.portal-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.portal-topbar {
  align-items: center;
  margin-bottom: 22px;
}

.portal-topbar-main {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 auto;
}

.portal-topbar-copy {
  min-width: 0;
}

.portal-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.portal-topbar h1,
.portal-hero h2,
.portal-section-heading h2 {
  margin: 0;
  color: var(--text);
}

.portal-hero,
.portal-panel,
.portal-space-card,
.portal-quick-card,
.portal-authorization-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.portal-hero {
  padding: 24px;
}

.portal-hero p,
.portal-section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.portal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.portal-kpi-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 104px;
}

.portal-kpi-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.portal-kpi-value {
  display: block;
  color: var(--text);
  font-size: 34px;
  font-weight: 850;
  line-height: 1;
}

.portal-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.portal-warning-panel {
  border-color: rgba(245, 158, 11, 0.38);
  background: #fffaf0;
}

.portal-pending-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.portal-quick-grid,
.portal-card-grid,
.portal-dashboard-grid {
  display: grid;
  gap: 14px;
}

.portal-quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.portal-quick-card {
  min-height: 104px;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.portal-quick-card strong {
  color: var(--text);
}

.portal-quick-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

.portal-space-card,
.portal-authorization-card {
  padding: 18px;
}

.portal-space-card.is-selected,
.portal-authorization-card.is-selected {
  outline: 2px solid rgba(0, 194, 184, 0.42);
  outline-offset: 2px;
}

.portal-space-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-space-card-header h3 {
  margin: 0;
}

.portal-space-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.portal-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.portal-detail-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 11px 12px;
}

.portal-detail-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.portal-detail-value {
  display: block;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.portal-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.portal-filter-tabs a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
}

.portal-filter-tabs a.active,
.portal-filter-tabs a:hover {
  border-color: rgba(11, 111, 234, 0.42);
  color: var(--accent);
}

.portal-list {
  display: grid;
  gap: 10px;
}

.portal-list-row {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.portal-list-row:last-child {
  border-bottom: 0;
}

.portal-list-row span,
.portal-list-row small {
  color: var(--muted);
}

.custom-routines-list .portal-list-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.portal-consent-form {
  margin-top: 12px;
}

.account-security-hero,
.account-security-card {
  margin-bottom: 18px;
}

.account-security-card .onboarding-profile-copy {
  max-width: 760px;
}

.account-security-form {
  margin-top: 14px;
}

.account-actions-card {
  align-items: start;
  margin-bottom: 18px;
}

.account-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.portal-space-select-form,
.person-profile-privacy-selector {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.person-profile-privacy-selector {
  max-width: 760px;
}

.authorization-actions,
.space-exit-form {
  margin-top: 12px;
}

.space-exit-form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compact-section-header {
  margin-bottom: 14px;
}

.compact-section-header h3,
.custom-routine-card h4 {
  margin: 0;
  color: var(--text);
}

.compact-section-header p,
.custom-routine-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.custom-routine-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.custom-routine-exercise-list {
  display: grid;
  gap: 10px;
}

.custom-routine-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.custom-routine-exercise-row {
  display: grid;
  grid-template-columns: 34px minmax(210px, 1.5fr) repeat(4, minmax(88px, 0.6fr)) minmax(170px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.custom-routine-exercise-row.is-cleared {
  border-color: rgba(0, 194, 184, 0.48);
  box-shadow: 0 0 0 3px rgba(0, 194, 184, 0.12);
}

.custom-routine-row-number {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  border-radius: 50%;
  background: rgba(11, 111, 234, 0.1);
  color: var(--accent);
  font-weight: 850;
}

.custom-routine-row-actions {
  display: flex;
  justify-content: flex-end;
  align-self: end;
}

.custom-routine-remove-row {
  min-width: 74px;
}

.custom-routine-detail {
  display: grid;
  gap: 14px;
}

.custom-routine-detail-summary {
  margin-bottom: 0;
}

.custom-routine-detail-list {
  display: grid;
  gap: 10px;
}

.custom-routine-detail-exercise {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.custom-routine-detail-exercise-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.custom-routine-detail-exercise-heading strong,
.custom-routine-detail-exercise-heading small {
  display: block;
}

.custom-routine-detail-exercise-heading strong {
  color: var(--text);
}

.custom-routine-detail-exercise-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.custom-routine-exercise-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0;
}

.custom-routine-exercise-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
}

.custom-routine-exercise-metrics dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.custom-routine-exercise-metrics dd {
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.custom-routine-detail-notes {
  margin: 0;
  color: var(--muted);
}

.custom-routine-detail-actions {
  align-items: center;
}

.custom-routine-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.custom-routine-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.custom-routine-card .actions {
  align-items: center;
}

@media (max-width: 1100px) {
  .portal-kpi-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

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

  .custom-routine-exercise-row {
    grid-template-columns: 34px minmax(180px, 1fr) repeat(2, minmax(88px, 0.5fr));
  }

  .custom-routine-exercise-select,
  .custom-routine-notes {
    grid-column: span 3;
  }

  .custom-routine-row-actions {
    grid-column: span 3;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-nav {
    grid-template-columns: 1fr;
  }

  .portal-main {
    padding-bottom: 18px;
  }

  .portal-main > :not(.portal-topbar):not(.flash-stack),
  .portal-main > .flash-stack {
    width: min(calc(100% - 36px), 1180px);
  }

  .portal-mobile-toggle {
    display: inline-flex;
  }

  .portal-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 110;
    width: min(320px, 86vw);
    height: 100vh;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.18s ease, visibility 0s linear 0.18s;
    padding: 24px 18px;
  }

  body.sidebar-open .portal-sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.18s ease;
  }

  .portal-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.46);
  }

  body.sidebar-open .portal-sidebar-overlay {
    display: block;
  }
}

@media (max-width: 640px) {
  .portal-topbar,
  .portal-hero,
  .portal-section-heading,
  .portal-space-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-topbar-main,
  .portal-topbar-actions {
    width: 100%;
  }

  .portal-topbar-actions {
    margin-left: 0;
    justify-content: flex-start;
  }

  .portal-kpi-grid,
  .portal-quick-grid,
  .portal-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .portal-space-select-form,
  .person-profile-privacy-selector,
  .custom-routine-form,
  .custom-routine-exercise-row {
    grid-template-columns: 1fr;
  }

  .custom-routine-exercise-select,
  .custom-routine-notes,
  .custom-routine-row-actions {
    grid-column: auto;
  }

  .account-action-buttons,
  .account-action-buttons form,
  .account-action-buttons .button,
  .portal-space-select-form .button,
  .custom-routine-list-heading {
    width: 100%;
  }

  .custom-routine-list-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .custom-routine-row-actions,
  .custom-routine-remove-row,
  .custom-routine-detail-actions .button,
  .custom-routine-detail-actions form,
  .custom-routines-list .portal-list-row .button {
    width: 100%;
  }

  .custom-routine-row-actions {
    justify-content: stretch;
  }

  .custom-routines-list .portal-list-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

body.sidebar-collapsed .portal-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-collapsed .portal-sidebar {
  align-items: center;
  padding: 22px 12px;
}

body.sidebar-collapsed .portal-brand {
  justify-items: center;
}

body.sidebar-collapsed .portal-brand .brand-logo-sidebar {
  width: 52px;
}

body.sidebar-collapsed .portal-brand span,
body.sidebar-collapsed .portal-nav-label,
body.sidebar-collapsed .portal-logout-label {
  display: none;
}

body.sidebar-collapsed .portal-nav a,
body.sidebar-collapsed .portal-logout .button.secondary {
  justify-content: center;
  padding: 10px;
}

.portal-main .person-profile-hero {
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  body.sidebar-collapsed .portal-shell,
  .portal-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .portal-sidebar {
    align-items: stretch;
    transform: translateX(-100%);
    padding: 24px 18px;
  }

  body.sidebar-collapsed.sidebar-open .portal-sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .portal-brand span,
  body.sidebar-collapsed .portal-nav-label,
  body.sidebar-collapsed .portal-logout-label {
    display: inline;
  }
}

/* Sistema visual común: capa aditiva segura */
.button.ghost,
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border);
  box-shadow: none;
}

.button:disabled,
.button[disabled],
.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.filter-card,
.results-card,
.onboarding-card,
.onboarding-empty,
.member-home-card,
.profile-form-section,
.consent-gym-card,
.portal-hero,
.portal-panel,
.portal-space-card,
.portal-quick-card,
.portal-authorization-card,
.empty-state-card {
  border-color: var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.definition-list {
  display: grid;
  gap: 10px;
}

.definition-list .definition {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 11px 12px;
}

.space-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge.paid,
.badge.current {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge.pending,
.badge.invited,
.badge.due {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge.overdue,
.badge.failed,
.badge.rejected {
  background: #fef2f2;
  color: var(--color-danger);
  border-color: #fecaca;
}

.badge.role-admin,
.badge.role-co_admin,
.badge.role-superuser {
  background: #eef2ff;
  color: var(--color-primary);
  border-color: #c7d2fe;
}

.badge.role-trainer {
  background: #ecfeff;
  color: #0f766e;
  border-color: #99f6e4;
}

.badge.role-member {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.badge.context-personal_trainer {
  background: #ccfbf1;
  color: #0f766e;
  border-color: #99f6e4;
}

/* Admin visual refresh */
.admin-body {
  background: linear-gradient(180deg, #f8fafc 0%, #eef4f8 100%);
}

.admin-shell {
  background: transparent;
}

.admin-main {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 247, 251, 0.96) 280px),
    #f5f7fb;
}

.admin-body .app-header,
.admin-body .topbar {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: rgba(203, 213, 225, 0.72);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
}

.admin-body .page-title {
  letter-spacing: 0;
}

.admin-user-chip {
  border-color: rgba(203, 213, 225, 0.86);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.role-context-switcher {
  position: relative;
  min-width: 0;
}

.role-context-trigger {
  border: 1px solid rgba(203, 213, 225, 0.86);
  cursor: pointer;
  text-align: left;
}

button.role-context-trigger {
  appearance: none;
}

.role-context-trigger:hover,
.role-context-trigger:focus-visible {
  border-color: rgba(79, 70, 229, 0.34);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10), 0 10px 26px rgba(15, 23, 42, 0.06);
  outline: 0;
}

.role-context-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #64748b;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.18s ease;
}

.role-context-trigger[aria-expanded="true"] .role-context-chevron {
  transform: rotate(180deg);
}

.role-context-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, calc(100vw - 24px));
  display: none;
  gap: 6px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
  padding: 8px;
}

.role-context-menu.is-open {
  display: grid;
}

.role-context-menu-title {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px 4px;
}

.role-context-menu form {
  margin: 0;
}

.role-context-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font-weight: 800;
  padding: 9px 10px;
  text-align: left;
}

.role-context-option:hover,
.role-context-option:focus-visible {
  background: #f8fafc;
  outline: 0;
}

.role-context-option.is-active,
.role-context-option:disabled {
  background: #eef2ff;
  color: #3730a3;
  cursor: default;
}

.role-context-option small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.admin-user-info {
  gap: 4px;
}

.admin-role-badge {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 11px;
}

.admin-body .button,
.admin-body button.button,
.admin-body .btn {
  border-radius: 10px;
}

.admin-body .button.secondary,
.admin-body .btn-secondary,
.admin-body .btn-ghost {
  background: #ffffff;
}

.admin-body .button.secondary:hover,
.admin-body .btn-secondary:hover,
.admin-body .btn-ghost:hover {
  border-color: rgba(0, 194, 184, 0.36);
  background: #f8fafc;
}

.admin-body .field label,
.admin-body .form-label {
  color: #334155;
  font-weight: 800;
}

.admin-body .field input,
.admin-body .field select,
.admin-body .field textarea,
.admin-body .form-control,
.admin-body .form-select {
  border-color: rgba(203, 213, 225, 0.92);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

/* Admin brand/header */
.admin-sidebar {
  background: linear-gradient(180deg, #071826 0%, #0e2236 62%, #08131f 100%);
  border-right: 1px solid rgba(94, 234, 212, 0.14);
  box-shadow: 22px 0 48px rgba(15, 23, 42, 0.18);
}

.admin-brand-header {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

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

.admin-brand-logo-card {
  width: min(168px, calc(100% - 58px));
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  background: #ffffff;
  padding: 7px 9px;
  box-shadow: 0 18px 34px rgba(0, 194, 184, 0.16);
}

.admin-brand-logo-card .brand-logo-sidebar {
  width: 100%;
  max-width: 148px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-brand-subtitle {
  display: block;
  padding-left: 2px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.admin-menu-toggle {
  width: 46px;
  height: 46px;
  border-color: rgba(94, 234, 212, 0.34);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  box-shadow: none;
}

.admin-menu-toggle:hover {
  border-color: rgba(94, 234, 212, 0.58);
  background: rgba(94, 234, 212, 0.16);
}

.admin-sidebar .space-card,
.admin-sidebar .gym-active-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.admin-sidebar .nav a,
.admin-sidebar .logout-button {
  color: #dbe7f5;
  border: 1px solid transparent;
}

.admin-sidebar .nav a:hover,
.admin-sidebar .logout-button:hover {
  border-color: rgba(94, 234, 212, 0.16);
  background: rgba(255, 255, 255, 0.10);
}

.admin-sidebar .nav a.active {
  border-color: rgba(94, 234, 212, 0.22);
  background:
    linear-gradient(90deg, rgba(0, 194, 184, 0.18), rgba(79, 70, 229, 0.18));
  box-shadow: inset 3px 0 0 #5eead4;
}

.admin-sidebar .nav a.active .nav-icon {
  color: #5eead4;
}

/* Admin cards */
.admin-card,
.admin-body .panel,
.admin-body .card,
.admin-body .expandable-card,
.admin-body .table-card,
.admin-body .table-wrap,
.admin-body .filter-card,
.admin-body .results-card,
.admin-body .profile-header,
.admin-body .profile-block,
.admin-body .dashboard-classes-card,
.admin-body .dashboard-chart-card,
.admin-body .dashboard-payments-card {
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.admin-card,
.admin-body .dashboard-classes-card,
.admin-body .dashboard-chart-card,
.admin-body .dashboard-payments-card {
  padding: 22px;
}

.admin-body .dashboard-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.10), rgba(0, 194, 184, 0.10)),
    rgba(255, 255, 255, 0.96);
}

.admin-body .dashboard-hero h2,
.admin-body .section-header h2 {
  color: #0f172a;
  font-size: 22px;
}

.admin-kpi-card {
  min-height: 152px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border-radius: 18px;
}

.admin-kpi-card .metric-icon {
  background: linear-gradient(135deg, #eef2ff, #ccfbf1);
  color: #3730a3;
}

.admin-body .data-table th {
  background: #f8fafc;
}

.admin-body .action-popover-trigger {
  border-radius: 10px;
}

/* Admin responsive */
body.sidebar-collapsed .admin-brand-header {
  display: grid;
}

body.sidebar-collapsed .admin-brand-row {
  justify-content: center;
}

body.sidebar-collapsed .admin-brand-logo-card,
body.sidebar-collapsed .admin-brand-subtitle {
  display: none;
}

body.sidebar-collapsed .admin-menu-toggle {
  width: 44px;
  height: 44px;
}

@media (max-width: 980px) {
  .admin-sidebar {
    padding: 14px 10px;
  }

  body.sidebar-open .admin-sidebar {
    padding: 24px 18px;
  }

  body:not(.sidebar-open) .app-sidebar .admin-brand-header {
    display: grid;
    margin-bottom: 0;
  }

  body:not(.sidebar-open) .admin-sidebar .admin-brand-row {
    justify-content: flex-end;
  }

  body:not(.sidebar-open) .admin-sidebar .admin-brand-logo-card,
  body:not(.sidebar-open) .admin-sidebar .admin-brand-subtitle {
    display: none;
  }

  body.sidebar-open .admin-sidebar .admin-brand-logo-card,
  body.sidebar-open .admin-sidebar .admin-brand-subtitle {
    display: inline-flex;
  }

  body.sidebar-open .admin-sidebar .admin-brand-subtitle {
    display: block;
  }

  .admin-body .dashboard-hero,
  .admin-body .section-header {
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .admin-body .app-header,
  .admin-body .topbar {
    padding: 16px 18px;
  }

  .admin-card,
  .admin-body .dashboard-classes-card,
  .admin-body .dashboard-chart-card,
  .admin-body .dashboard-payments-card {
    padding: 18px;
  }

  .admin-body .dashboard-hero h2,
  .admin-body .section-header h2 {
    font-size: 20px;
  }
}

/* Person profile visual refresh */
.person-profile-page {
  position: relative;
  display: grid;
  gap: 20px;
  isolation: isolate;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 194, 184, 0.22), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(129, 140, 248, 0.24), transparent 34%),
    linear-gradient(180deg, #07133f 0%, #0b1120 176px, #f8fafc 176px, #f8fafc 100%);
  padding: 22px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.10);
}

.portal-main .person-profile-page {
  margin-top: 4px;
}

.person-profile-page .person-profile-hero {
  position: relative;
  overflow: hidden;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 254, 255, 0.94)),
    #ffffff;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.16);
}

.person-profile-page .person-profile-hero::after {
  content: "";
  position: absolute;
  inset: -42px -58px auto auto;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 194, 184, 0.22), transparent 68%);
  pointer-events: none;
}

.person-profile-header {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.person-profile-back,
.profile-back-link.person-profile-back {
  width: max-content;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 999px;
  background: #ffffff;
  color: #3730a3;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.14);
}

.profile-back-link.person-profile-back:hover {
  border-color: rgba(0, 194, 184, 0.40);
  background: #f8fafc;
  color: #0f766e;
  text-decoration: none;
  transform: translateY(-1px);
}

.profile-back-link.person-profile-back:focus-visible {
  outline: 3px solid rgba(0, 194, 184, 0.30);
  outline-offset: 3px;
}

.person-profile-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.person-profile-avatar {
  width: 70px;
  height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  background:
    linear-gradient(135deg, #4f46e5, #00c2b8);
  color: #ffffff;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 18px 36px rgba(79, 70, 229, 0.20);
}

.person-profile-title-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.person-profile-title,
.person-profile-hero .person-profile-title {
  margin: 0;
  color: #0f172a;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
}

.person-profile-subtitle {
  max-width: 660px;
  margin: 0;
  color: #475569;
  font-size: 15px;
  line-height: 1.6;
}

.person-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-profile-badge {
  min-height: 28px;
}

.person-profile-summary {
  position: relative;
  z-index: 1;
  min-width: min(100%, 390px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.person-profile-summary-item {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.person-profile-summary-item span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.person-profile-summary-item strong {
  color: #0f172a;
  font-size: 14px;
}

.person-profile-summary-item.is-complete {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.person-profile-summary-item.is-complete strong {
  color: #047857;
}

.person-profile-summary-item.is-pending {
  border-color: #fde68a;
  background: #fffbeb;
}

.person-profile-summary-item.is-pending strong {
  color: #b45309;
}

.person-profile-summary-item.is-neutral {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.person-profile-summary-item.is-neutral strong {
  color: #475569;
}

.person-profile-page .privacy-notice,
.person-profile-page .profile-form-actions,
.person-profile-page .person-profile-card,
.person-profile-page .profile-form-section,
.person-profile-page .consent-gym-card,
.person-profile-page .empty-state-card {
  border-color: rgba(203, 213, 225, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.person-profile-page .profile-form-section {
  gap: 20px;
}

.person-profile-page .profile-form-section-header {
  border-bottom-color: rgba(203, 213, 225, 0.76);
}

.person-profile-page .person-profile-section-title,
.person-profile-page .profile-form-section-header h2,
.person-profile-page .profile-consents-heading h2 {
  color: #0f172a;
  font-weight: 900;
}

.person-profile-page .profile-section-number {
  background: linear-gradient(135deg, #eef2ff, #ccfbf1);
  color: #3730a3;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.10);
}

.person-profile-page .field input,
.person-profile-page .field select,
.person-profile-page .field textarea {
  border-color: rgba(203, 213, 225, 0.92);
  border-radius: 12px;
  background: #ffffff;
}

.person-profile-page .field input:focus,
.person-profile-page .field select:focus,
.person-profile-page .field textarea:focus {
  outline: 3px solid rgba(0, 194, 184, 0.24);
  outline-offset: 2px;
  border-color: #00c2b8;
}

.person-profile-page .person-profile-grid--two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.person-profile-page .person-profile-field {
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 6px;
}

.person-profile-page .person-profile-field label {
  min-height: 18px;
  margin: 0;
  line-height: 1.35;
}

.person-profile-page .person-profile-field input {
  min-height: 42px;
}

.person-profile-page .person-profile-help {
  margin: 0;
  line-height: 1.45;
}

.person-profile-page .health-insurance-control,
.person-profile-page .profile-inline-help,
.person-profile-page .gym-requirements-summary {
  border-color: rgba(199, 210, 254, 0.86);
  border-radius: 14px;
  background: #f8fafc;
}

.person-profile-page .profile-form-actions {
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(0, 194, 184, 0.10)),
    #ffffff;
}

.person-profile-page .profile-form-actions .button,
.person-profile-page .consent-form > .button {
  min-height: 42px;
  border-radius: 12px;
}

.person-profile-page .profile-consents-section {
  padding-top: 0;
}

.person-profile-page .profile-consents-heading {
  border: 1px solid rgba(203, 213, 225, 0.76);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  padding: 18px 20px;
}

.person-profile-page .consent-option {
  border-color: rgba(203, 213, 225, 0.86);
  border-radius: 14px;
}

.person-profile-page .consent-option:hover {
  border-color: rgba(0, 194, 184, 0.36);
  background: #f8fafc;
}

@media (max-width: 900px) {
  .person-profile-page .person-profile-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .person-profile-summary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .person-profile-page {
    gap: 16px;
    border-radius: 22px;
    padding: 14px;
    background:
      radial-gradient(circle at 8% 0%, rgba(0, 194, 184, 0.20), transparent 34%),
      linear-gradient(180deg, #07133f 0%, #0b1120 156px, #f8fafc 156px, #f8fafc 100%);
  }

  .person-profile-page .person-profile-hero,
  .person-profile-page .profile-form-section,
  .person-profile-page .consent-gym-card,
  .person-profile-page .profile-form-actions,
  .person-profile-page .profile-consents-heading {
    border-radius: 16px;
    padding: 17px;
  }

  .person-profile-title-row {
    align-items: flex-start;
  }

  .person-profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    font-size: 17px;
  }

  .person-profile-title,
  .person-profile-hero .person-profile-title {
    font-size: 26px;
  }

  .person-profile-summary {
    grid-template-columns: 1fr;
  }

  .person-profile-page .person-profile-grid--two {
    grid-template-columns: 1fr;
  }

  .person-profile-back,
  .profile-back-link.person-profile-back {
    width: 100%;
    justify-content: center;
  }
}

/* Training admin */
.table-description {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
}

.compact-actions {
  align-items: center;
  gap: 6px;
}

.compact-actions form {
  margin: 0;
}

.trainer-self-assign-form {
  margin: 0;
}

.trainer-create-flow {
  display: grid;
  gap: 18px;
}

.trainer-smart-link {
  border-color: #c7d2fe;
}

.trainer-smart-link-form {
  display: grid;
  gap: 12px;
  margin: 0;
  border-top: 1px solid rgba(203, 213, 225, 0.82);
  padding-top: 12px;
}

.trainer-smart-link-form[hidden] {
  display: none;
}

.trainer-smart-link-form .field {
  max-width: 320px;
}

.trainer-smart-link-actions {
  justify-content: space-between;
  padding-top: 2px;
}

.trainer-manual-escape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px dashed rgba(0, 194, 184, 0.45);
  border-radius: var(--radius-md);
  background: rgba(240, 253, 250, 0.72);
  padding: 12px;
}

.trainer-manual-escape strong,
.trainer-manual-escape p {
  margin: 0;
}

.trainer-manual-escape strong {
  color: var(--color-navy);
  font-size: 13px;
}

.trainer-manual-escape p {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

.trainer-create-panel[hidden] {
  display: none;
}

.trainer-manual-section {
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 16px;
}

.trainer-manual-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
  padding-bottom: 12px;
}

.trainer-manual-heading h3,
.trainer-self-assign-confirmation h3 {
  margin: 6px 0 4px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.trainer-manual-heading p {
  margin: 0;
}

.trainer-self-assign-confirmation {
  margin: 0;
}

.trainer-self-assign-box {
  margin: 0;
  border: 1px dashed rgba(79, 70, 229, 0.38);
  border-radius: var(--radius-lg);
  background: #f8fafc;
  padding: 14px;
}

.trainer-self-assign-box .modal-footer {
  padding-top: 0;
}

.trainer-account-status {
  display: grid;
  gap: 5px;
  align-items: start;
}

.trainer-account-status .muted {
  font-size: 12px;
  line-height: 1.35;
}

.pending-trainer-link-card {
  align-content: start;
}

@media (max-width: 860px) {
  .trainer-manual-escape,
  .trainer-manual-heading,
  .trainer-smart-link-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .trainer-smart-link-form .field {
    max-width: none;
  }
}

.routine-exercises-table td {
  vertical-align: top;
}

.routine-exercises-table input {
  min-width: 120px;
}

.routine-exercises-table .compact-input {
  min-width: 68px;
  width: 76px;
}

.routine-assignment-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding: 8px 0;
}

.badge.draft,
.badge.private {
  background: rgba(100, 116, 139, .12);
  color: #475569;
}

.badge.member,
.badge.institutional {
  background: rgba(13, 148, 136, .12);
  color: #0f766e;
}

/* Fase 5.5 - Panel Fittiar y soporte */
.platform-body {
  min-width: 320px;
  background: #f8fafc;
}

.platform-shell {
  width: min(100% - 40px, 1240px);
  display: grid;
  gap: 18px;
  margin: 0 auto;
  padding: 24px 0 42px;
}

.platform-topbar,
.platform-hero,
.platform-card,
.platform-metric-card,
.support-mode-banner {
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.platform-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 16px;
}

.platform-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #0f172a;
  font-weight: 900;
}

.platform-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

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

.platform-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.platform-hero h1 {
  margin: 6px 0 6px;
  color: #0f172a;
  font-size: 34px;
  line-height: 1.08;
}

.platform-hero p {
  margin: 0;
  color: var(--color-muted);
}

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

.platform-metric-card {
  min-height: 108px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.platform-metric-card span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.platform-metric-card strong {
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
}

.platform-card {
  margin: 0;
}

.support-mode-body {
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.88), rgba(248, 250, 252, 0.94) 210px),
    var(--bg);
}

.support-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 20px 18px;
  border-color: rgba(5, 150, 105, 0.34);
  background: #ecfdf5;
  padding: 14px 16px;
}

.platform-support-banner,
.onboarding-support-banner {
  margin: 0;
}

.support-mode-banner strong {
  display: block;
  margin-bottom: 3px;
  color: #047857;
  font-size: 15px;
}

.support-mode-banner p {
  margin: 0;
  color: #064e3b;
}

.support-mode-banner form {
  margin: 0;
}

.support-exit-button {
  background: #047857;
  color: #ffffff;
}

.support-exit-button:hover {
  background: #065f46;
}

.platform-entry-card {
  border-color: rgba(79, 70, 229, 0.22);
}

.platform-entry-icon {
  background: rgba(79, 70, 229, 0.1);
  color: #4338ca;
}

.badge.role-support {
  background: rgba(5, 150, 105, 0.14);
  color: #047857;
}

@media (max-width: 980px) {
  .platform-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .platform-hero,
  .platform-topbar,
  .support-mode-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-actions,
  .platform-hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .platform-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 14px;
  }

  .platform-metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .platform-hero h1 {
    font-size: 28px;
  }

  .support-mode-banner {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* Fase 5.6 - tema, topbar contextual y rutinas dinamicas */
.page-heading {
  min-width: 0;
}

.header-actions,
.platform-actions,
.onboarding-topbar-actions,
.portal-topbar-actions {
  flex-wrap: wrap;
}

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

.theme-switcher {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.theme-toggle {
  min-width: 94px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.theme-switcher-icon-only .theme-toggle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
}

.theme-switcher-icon-only .theme-toggle-label {
  display: none;
}

.theme-switcher-with-label .theme-toggle {
  min-width: 98px;
}

.header-actions .theme-switcher-icon-only,
.platform-actions .theme-switcher-icon-only,
.portal-topbar-actions .theme-switcher-icon-only {
  margin-left: 0;
}

.theme-toggle-icon,
.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.theme-toggle-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle-icon-moon {
  display: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--surface-2);
  color: var(--color-text);
  outline: 0;
}

.theme-toggle:focus-visible,
.context-chip:focus-visible,
.icon-button:focus-visible,
.role-context-option:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.topbar-context-row {
  display: flex;
  min-width: 0;
  margin-top: 6px;
}

.context-chip {
  max-width: min(520px, 100%);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 5px 9px 5px 5px;
  box-shadow: var(--shadow-soft);
}

button.context-chip {
  appearance: none;
  cursor: pointer;
}

.context-chip-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.context-chip-copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.context-chip-copy strong,
.admin-user-info strong,
.user-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-chip-copy small,
.admin-user-info small {
  color: var(--color-muted);
  font-size: 12px;
}

.topbar-context-switcher .role-context-menu {
  right: auto;
  left: 0;
}

.admin-user-chip {
  max-width: 250px;
}

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.routine-order-control {
  display: inline-grid;
  grid-template-columns: 30px 76px 30px;
  align-items: center;
  gap: 6px;
}

.routine-exercises-table .routine-order-control input.compact-input {
  min-width: 0;
  width: 76px;
}

.routine-mobile-preview {
  overflow: hidden;
}

.routine-phone-preview {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.routine-phone-header,
.routine-preview-day,
.routine-defaults-panel {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.routine-phone-header {
  display: grid;
  gap: 8px;
}

.routine-phone-header strong {
  color: var(--color-text);
  font-size: 20px;
  line-height: 1.14;
}

.routine-phone-header p,
.routine-preview-exercise small {
  margin: 0;
  color: var(--color-muted);
}

.routine-phone-days {
  display: grid;
  gap: 10px;
}

.routine-preview-day h3 {
  margin: 0 0 10px;
  color: var(--color-text);
  font-size: 15px;
}

.routine-preview-exercise {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--color-border);
  padding: 10px 0 0;
}

.routine-preview-exercise + .routine-preview-exercise {
  margin-top: 10px;
}

.routine-preview-exercise strong {
  color: var(--color-text);
}

.routine-preview-exercise span {
  color: var(--color-muted);
  font-size: 13px;
}

.routine-defaults-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.routine-defaults-actions {
  align-self: end;
}

.routine-assignment-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.compact-field {
  margin: 0;
}

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

.routine-assignment-list .checkbox-row {
  align-items: start;
}

.routine-assignment-list .checkbox-row span,
.routine-assignment-list .checkbox-row small {
  min-width: 0;
}

.routine-assignment-list .checkbox-row small {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.25;
}

.compact-note {
  margin: 6px 0 0;
  font-size: 12px;
}

[data-theme="dark"] body,
[data-theme="dark"] .admin-body,
[data-theme="dark"] .platform-body,
[data-theme="dark"] .portal-body,
[data-theme="dark"] .login-page {
  background: var(--page-bg);
  color: var(--color-text);
}

[data-theme="dark"] .admin-body {
  background: linear-gradient(180deg, #101827 0%, #0c111b 100%);
}

[data-theme="dark"] .admin-main,
[data-theme="dark"] .portal-main,
[data-theme="dark"] .support-mode-body {
  background: var(--page-bg);
}

[data-theme="dark"] .admin-sidebar,
[data-theme="dark"] .portal-sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-strong) 100%);
  border-color: var(--sidebar-border);
  box-shadow: 22px 0 48px rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] .app-header,
[data-theme="dark"] .topbar,
[data-theme="dark"] .platform-topbar,
[data-theme="dark"] .portal-topbar,
[data-theme="dark"] .onboarding-topbar {
  border-color: var(--color-border);
  background: rgba(18, 26, 40, 0.92);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .platform-topbar,
[data-theme="dark"] .portal-topbar,
[data-theme="dark"] .onboarding-topbar {
  backdrop-filter: blur(16px);
}

[data-theme="dark"] .page-title,
[data-theme="dark"] .section-header h2,
[data-theme="dark"] .panel h2,
[data-theme="dark"] .card-header h2,
[data-theme="dark"] .card-header h3,
[data-theme="dark"] .profile-block-title,
[data-theme="dark"] .platform-brand,
[data-theme="dark"] .platform-hero h1,
[data-theme="dark"] .platform-metric-card strong,
[data-theme="dark"] .portal-topbar h1 {
  color: var(--text-strong);
}

[data-theme="dark"] .muted,
[data-theme="dark"] .topbar-meta,
[data-theme="dark"] .page-subtitle,
[data-theme="dark"] .platform-hero p,
[data-theme="dark"] .section-kicker,
[data-theme="dark"] .table-description {
  color: var(--color-muted);
}

[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .expandable-card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .filter-card,
[data-theme="dark"] .results-card,
[data-theme="dark"] .profile-header,
[data-theme="dark"] .profile-block,
[data-theme="dark"] .dashboard-classes-card,
[data-theme="dark"] .dashboard-chart-card,
[data-theme="dark"] .dashboard-payments-card,
[data-theme="dark"] .metric,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .onboarding-card,
[data-theme="dark"] .onboarding-profile-card,
[data-theme="dark"] .empty-state-card,
[data-theme="dark"] .platform-hero,
[data-theme="dark"] .platform-card,
[data-theme="dark"] .platform-metric-card,
[data-theme="dark"] .modal-panel,
[data-theme="dark"] .auth-panel,
[data-theme="dark"] .login-form-panel,
[data-theme="dark"] .login-preview {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .theme-switcher,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .context-chip,
[data-theme="dark"] .user-chip,
[data-theme="dark"] .user-menu__dropdown,
[data-theme="dark"] .user-mini-chip,
[data-theme="dark"] .role-context-menu,
[data-theme="dark"] .routine-phone-header,
[data-theme="dark"] .routine-preview-day,
[data-theme="dark"] .routine-defaults-panel,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .admin-brand-logo-card,
[data-theme="dark"] .portal-brand {
  border-color: var(--color-border);
  background: var(--surface-elevated);
  color: var(--color-text);
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  border-color: var(--color-border);
  background: #0f1726;
  color: var(--color-text);
  box-shadow: none;
}

[data-theme="dark"] option {
  background: #0f1726;
  color: var(--color-text);
}

[data-theme="dark"] .field label,
[data-theme="dark"] .form-label {
  color: var(--text-strong);
}

[data-theme="dark"] .data-table,
[data-theme="dark"] table {
  background: transparent;
  color: var(--color-text);
}

[data-theme="dark"] th,
[data-theme="dark"] .data-table th {
  background: var(--surface-muted);
  color: var(--color-muted);
}

[data-theme="dark"] .data-table td,
[data-theme="dark"] td,
[data-theme="dark"] .definition,
[data-theme="dark"] .routine-preview-exercise {
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .data-table tbody tr,
[data-theme="dark"] tbody tr {
  background: transparent;
}

[data-theme="dark"] .data-table tbody tr:hover,
[data-theme="dark"] .role-context-option:hover,
[data-theme="dark"] .role-context-option:focus-visible {
  background: var(--surface-muted);
}

[data-theme="dark"] .button.secondary,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-ghost {
  border-color: var(--color-border);
  background: var(--surface-elevated);
  color: var(--color-text);
}

[data-theme="dark"] .button.secondary:hover,
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-ghost:hover {
  border-color: var(--color-primary);
  background: var(--surface-muted);
}

[data-theme="dark"] .badge.draft,
[data-theme="dark"] .badge.private,
[data-theme="dark"] .badge.role-member {
  border-color: #475569;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

[data-theme="dark"] .badge.active,
[data-theme="dark"] .badge.member,
[data-theme="dark"] .badge.institutional,
[data-theme="dark"] .badge.context-personal_trainer,
[data-theme="dark"] .badge.role-support {
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(45, 212, 191, 0.16);
  color: #8df2df;
}

[data-theme="dark"] .badge.warning,
[data-theme="dark"] .flash.warning {
  border-color: rgba(251, 191, 36, 0.38);
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}

[data-theme="dark"] .badge.danger,
[data-theme="dark"] .flash.error {
  border-color: rgba(248, 113, 113, 0.42);
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

[data-theme="dark"] .flash.success {
  border-color: rgba(16, 185, 129, 0.42);
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

[data-theme="dark"] .auth-shell,
[data-theme="dark"] .auth-shell-split,
[data-theme="dark"] .auth-shell-login {
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(12, 17, 27, 0.96) 44%, rgba(13, 78, 76, 0.38)),
    var(--page-bg);
}

[data-theme="dark"] .auth-shell-login::before {
  background: radial-gradient(circle, rgba(45, 212, 191, 0.14), rgba(45, 212, 191, 0) 62%);
}

[data-theme="dark"] .auth-visual {
  color: var(--color-text);
}

[data-theme="dark"] .login-brand-panel::before {
  border-color: rgba(122, 167, 255, 0.18);
  background: rgba(15, 23, 42, 0.34);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .login-brand-panel::after {
  opacity: 0.55;
}

[data-theme="dark"] .auth-shell-login .auth-visual h1 {
  color: var(--text-strong);
}

[data-theme="dark"] .auth-shell-login .auth-visual h1 span {
  background: linear-gradient(135deg, #bfdbfe, #5eead4);
  -webkit-background-clip: text;
  background-clip: text;
}

[data-theme="dark"] .auth-visual p,
[data-theme="dark"] .login-card .auth-form-heading p,
[data-theme="dark"] .field-hint,
[data-theme="dark"] .brand-subtitle {
  color: var(--color-muted);
}

[data-theme="dark"] .login-pill {
  border-color: rgba(122, 167, 255, 0.28);
  background: rgba(122, 167, 255, 0.14);
  color: #bfdbfe;
}

[data-theme="dark"] .login-pill i {
  background: var(--color-primary);
  box-shadow: 0 0 0 5px rgba(122, 167, 255, 0.16);
}

[data-theme="dark"] .login-preview-head {
  border-color: var(--color-border);
}

[data-theme="dark"] .login-preview-stats span,
[data-theme="dark"] .login-preview-row,
[data-theme="dark"] .auth-visual-links a {
  border-color: var(--color-border);
  background: var(--surface-elevated);
  color: var(--color-muted);
}

[data-theme="dark"] .login-preview-head strong,
[data-theme="dark"] .login-preview-stats strong,
[data-theme="dark"] .login-preview-row strong,
[data-theme="dark"] .login-card .auth-form-heading h1,
[data-theme="dark"] .auth-form-heading h1 {
  color: var(--text-strong);
}

[data-theme="dark"] .login-preview-head span,
[data-theme="dark"] .login-preview-row span {
  color: var(--color-muted);
}

[data-theme="dark"] .login-preview-row em {
  background: rgba(122, 167, 255, 0.16);
  color: #bfdbfe;
}

[data-theme="dark"] .auth-visual-links a:hover {
  border-color: rgba(45, 212, 191, 0.38);
  color: #8df2df;
}

[data-theme="dark"] .auth-shell-login .login-form-panel {
  background: rgba(12, 17, 27, 0.72);
}

[data-theme="dark"] .login-card {
  border-color: var(--color-border);
  background: rgba(18, 26, 40, 0.96);
  color: var(--color-text);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .login-card .section-kicker {
  color: #93c5fd;
}

[data-theme="dark"] .login-field label,
[data-theme="dark"] .auth-panel .field label,
[data-theme="dark"] .auth-panel label {
  color: var(--text-strong);
}

[data-theme="dark"] .login-field input,
[data-theme="dark"] .login-card .login-field input,
[data-theme="dark"] .auth-panel input,
[data-theme="dark"] .auth-panel select,
[data-theme="dark"] .auth-panel textarea {
  border-color: var(--color-border);
  background: #0f1726;
  color: var(--color-text);
  box-shadow: none;
}

[data-theme="dark"] .login-field input::placeholder,
[data-theme="dark"] .auth-panel input::placeholder,
[data-theme="dark"] .auth-panel textarea::placeholder {
  color: #7f8da3;
  opacity: 1;
}

[data-theme="dark"] .login-field input:hover,
[data-theme="dark"] .auth-panel input:hover {
  border-color: rgba(122, 167, 255, 0.44);
}

[data-theme="dark"] .login-field input:focus,
[data-theme="dark"] .auth-panel input:focus,
[data-theme="dark"] .auth-panel select:focus,
[data-theme="dark"] .auth-panel textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.16);
  outline: 0;
}

[data-theme="dark"] .login-links a,
[data-theme="dark"] .auth-links a {
  color: #bfdbfe;
}

[data-theme="dark"] .login-links a:hover,
[data-theme="dark"] .auth-links a:hover {
  color: #8df2df;
}

[data-theme="dark"] .login-card .flash,
[data-theme="dark"] .auth-panel .flash {
  border-color: var(--color-border);
}

[data-theme="dark"] .support-mode-body {
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.22), var(--page-bg) 230px);
}

[data-theme="dark"] .support-mode-banner {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(6, 78, 59, 0.34);
}

[data-theme="dark"] .support-mode-banner strong,
[data-theme="dark"] .support-mode-banner p {
  color: #b7f7d5;
}

[data-theme="dark"] .support-exit-button {
  background: #10b981;
  color: #06281d;
}

[data-theme="dark"] .admin-body .dashboard-hero {
  background:
    linear-gradient(135deg, rgba(122, 167, 255, 0.14), rgba(45, 212, 191, 0.12)),
    var(--color-surface);
}

[data-theme="dark"] .admin-body .dashboard-hero h2,
[data-theme="dark"] .admin-body .section-header h2,
[data-theme="dark"] .report-card .section-header h2,
[data-theme="dark"] .classes-hero h2,
[data-theme="dark"] .class-detail-header h2,
[data-theme="dark"] .onboarding-card h2,
[data-theme="dark"] .empty-state-card h2,
[data-theme="dark"] .member-home-card h2 {
  color: var(--text-strong);
}

[data-theme="dark"] .report-mini-stat,
[data-theme="dark"] .report-mini-stat:hover,
[data-theme="dark"] .definition-list .definition,
[data-theme="dark"] .portal-detail-item,
[data-theme="dark"] .portal-filter-tabs a,
[data-theme="dark"] .portal-space-select-form,
[data-theme="dark"] .person-profile-privacy-selector,
[data-theme="dark"] .custom-routine-exercise-row,
[data-theme="dark"] .class-day-column,
[data-theme="dark"] .class-session-card,
[data-theme="dark"] .class-list-item,
[data-theme="dark"] .class-history-item,
[data-theme="dark"] .force-password-card,
[data-theme="dark"] .person-search-result,
[data-theme="dark"] .member-billing-preview,
[data-theme="dark"] .billing-panel,
[data-theme="dark"] .payment-filter-tabs a,
[data-theme="dark"] .payment-alert-item,
[data-theme="dark"] .trainer-account-status,
[data-theme="dark"] .pending-trainer-link-card,
[data-theme="dark"] .trainer-manual-section,
[data-theme="dark"] .trainer-self-assign-box,
[data-theme="dark"] .privacy-notice,
[data-theme="dark"] .empty,
[data-theme="dark"] .compact-empty,
[data-theme="dark"] .compact-empty-cell {
  border-color: var(--color-border);
  background: var(--surface-muted);
  color: var(--color-text);
}

[data-theme="dark"] .report-mini-stat span,
[data-theme="dark"] .definition-list .definition span,
[data-theme="dark"] .portal-detail-label,
[data-theme="dark"] .class-day-heading span,
[data-theme="dark"] .class-day-empty,
[data-theme="dark"] .class-session-meta,
[data-theme="dark"] .class-session-footer,
[data-theme="dark"] .class-session-time,
[data-theme="dark"] .class-list-item span,
[data-theme="dark"] .class-history-item span,
[data-theme="dark"] .class-history-item small,
[data-theme="dark"] .routine-assignment-list .checkbox-row small,
[data-theme="dark"] .report-bar-row span {
  color: var(--color-muted);
}

[data-theme="dark"] .report-mini-stat strong,
[data-theme="dark"] .definition-list .definition strong,
[data-theme="dark"] .class-session-card strong,
[data-theme="dark"] .portal-detail-value,
[data-theme="dark"] .portal-kpi-value,
[data-theme="dark"] .portal-quick-card strong,
[data-theme="dark"] .routine-assignment-list .checkbox-row span,
[data-theme="dark"] .report-bar-row strong {
  color: var(--text-strong);
}

[data-theme="dark"] .portal-hero,
[data-theme="dark"] .portal-panel,
[data-theme="dark"] .portal-space-card,
[data-theme="dark"] .portal-quick-card,
[data-theme="dark"] .portal-authorization-card,
[data-theme="dark"] .custom-routine-card,
[data-theme="dark"] .custom-routine-editor,
[data-theme="dark"] .portal-kpi-card,
[data-theme="dark"] .classes-hero,
[data-theme="dark"] .classes-week-card,
[data-theme="dark"] .classes-list-card,
[data-theme="dark"] .class-detail-card,
[data-theme="dark"] .attendance-scanner-card,
[data-theme="dark"] .attendance-result-card,
[data-theme="dark"] .attendance-history-card,
[data-theme="dark"] .routine-mobile-preview,
[data-theme="dark"] .routine-assignment-list .checkbox-row {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .onboarding-profile-icon,
[data-theme="dark"] .person-profile-back,
[data-theme="dark"] .profile-back-link.person-profile-back {
  border-color: var(--color-border);
  background: var(--surface-elevated);
  color: var(--color-primary);
}

[data-theme="dark"] .person-profile-page {
  background:
    linear-gradient(180deg, #07111f 0%, #0a1625 176px, var(--page-bg) 176px, var(--page-bg) 100%);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .person-profile-page .person-profile-hero {
  border-color: var(--color-border);
  background: var(--color-surface);
}

[data-theme="dark"] .person-profile-page .person-profile-hero::after {
  opacity: 0.28;
}

[data-theme="dark"] .person-profile-title,
[data-theme="dark"] .person-profile-hero .person-profile-title,
[data-theme="dark"] .profile-form-section-header h2,
[data-theme="dark"] .trainer-manual-heading h3,
[data-theme="dark"] .trainer-self-assign-confirmation h3,
[data-theme="dark"] .trainer-manual-escape strong {
  color: var(--text-strong);
}

[data-theme="dark"] .person-profile-subtitle,
[data-theme="dark"] .privacy-notice p,
[data-theme="dark"] .trainer-manual-escape p {
  color: var(--color-muted);
}

[data-theme="dark"] .portal-warning-panel,
[data-theme="dark"] .payment-warning,
[data-theme="dark"] .notice-warning {
  border-color: rgba(251, 191, 36, 0.38);
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}

[data-theme="dark"] .payment-filter-tabs a.active,
[data-theme="dark"] .payment-filter-tabs a:hover {
  border-color: rgba(122, 167, 255, 0.55);
  background: rgba(122, 167, 255, 0.14);
  color: var(--color-primary);
}

[data-theme="dark"] .payment-alert-item.is-overdue {
  border-color: rgba(248, 113, 113, 0.45);
}

[data-theme="dark"] .report-bar-track,
[data-theme="dark"] .class-capacity-meter {
  background: #25324a;
}

[data-theme="dark"] .attendance-chart {
  border-radius: var(--radius-lg);
  background: transparent;
}

[data-theme="dark"] .attendance-bar {
  color: var(--color-muted);
}

[data-theme="dark"] .attendance-bar-value {
  color: var(--text-strong);
}

[data-theme="dark"] .attendance-bar-label {
  color: var(--color-muted);
}

[data-theme="dark"] .attendance-bar-track {
  border: 1px solid rgba(122, 167, 255, 0.18);
  background: linear-gradient(180deg, #1a2538 0%, #111a29 100%);
}

[data-theme="dark"] .attendance-bar-fill {
  background: linear-gradient(180deg, #5eead4, #7aa7ff);
}

[data-theme="dark"] .attendance-bar:hover .attendance-bar-fill,
[data-theme="dark"] .attendance-bar.is-active .attendance-bar-fill {
  background: linear-gradient(180deg, #67e8f9, #9bbdff);
}

[data-theme="dark"] .attendance-bar.is-active {
  color: #bfdbfe;
}

[data-theme="dark"] .attendance-day-detail {
  border-color: var(--color-border);
  background: var(--surface-muted);
  color: var(--color-text);
}

[data-theme="dark"] .detail-heading strong,
[data-theme="dark"] .attendance-detail-item strong {
  color: var(--text-strong);
}

[data-theme="dark"] .detail-heading span,
[data-theme="dark"] .attendance-detail-item span,
[data-theme="dark"] .attendance-detail-item small {
  color: var(--color-muted);
}

[data-theme="dark"] .attendance-detail-item {
  border-color: var(--color-border);
  background: var(--surface-elevated);
  color: var(--color-text);
}

[data-theme="dark"] .dashboard-chart-card > .empty,
[data-theme="dark"] .attendance-day-detail .empty {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--color-muted);
  padding: 12px;
}

[data-theme="dark"] .admin-kpi-card .metric-icon,
[data-theme="dark"] .platform-entry-icon {
  background: rgba(122, 167, 255, 0.16);
  color: #bfdbfe;
}

[data-theme="dark"] .trend-badge,
[data-theme="dark"] .trend-badge.neutral,
[data-theme="dark"] .badge.info,
[data-theme="dark"] .badge-info,
[data-theme="dark"] .badge.completed,
[data-theme="dark"] .badge.justified {
  border-color: rgba(122, 167, 255, 0.34);
  background: rgba(122, 167, 255, 0.16);
  color: #bfdbfe;
}

[data-theme="dark"] .badge.ok,
[data-theme="dark"] .badge-success,
[data-theme="dark"] .badge.scheduled,
[data-theme="dark"] .badge.enrolled,
[data-theme="dark"] .badge.present,
[data-theme="dark"] .badge.paid,
[data-theme="dark"] .badge.current {
  border-color: rgba(16, 185, 129, 0.42);
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

[data-theme="dark"] .is-selected-row td,
[data-theme="dark"] .portal-space-card.is-selected,
[data-theme="dark"] .portal-authorization-card.is-selected {
  background: rgba(122, 167, 255, 0.14);
}

[data-theme="dark"] .flash.info {
  border-color: rgba(122, 167, 255, 0.38);
  background: rgba(122, 167, 255, 0.16);
  color: #bfdbfe;
}

[data-theme="dark"] .modal-backdrop,
[data-theme="dark"] .sidebar-overlay {
  background: rgba(0, 0, 0, 0.62);
}

[data-theme="dark"] .portal-body .portal-main {
  background: var(--page-bg);
}

[data-theme="dark"] .admin-body .button.secondary,
[data-theme="dark"] .admin-body .btn-secondary,
[data-theme="dark"] .admin-body .btn-ghost,
[data-theme="dark"] .portal-body .button.secondary {
  border-color: var(--color-border);
  background: var(--surface-elevated);
  color: var(--color-text);
}

[data-theme="dark"] .person-profile-page .privacy-notice,
[data-theme="dark"] .person-profile-page .profile-form-actions,
[data-theme="dark"] .person-profile-page .person-profile-card,
[data-theme="dark"] .person-profile-page .profile-form-section,
[data-theme="dark"] .person-profile-page .consent-gym-card,
[data-theme="dark"] .person-profile-page .empty-state-card,
[data-theme="dark"] .person-profile-page .profile-consents-heading,
[data-theme="dark"] .account-security-hero,
[data-theme="dark"] .account-security-card,
[data-theme="dark"] .account-actions-card {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .person-profile-page .health-insurance-control,
[data-theme="dark"] .person-profile-page .profile-inline-help,
[data-theme="dark"] .person-profile-page .gym-requirements-summary,
[data-theme="dark"] .gym-requirements-summary,
[data-theme="dark"] .consent-option,
[data-theme="dark"] .portal-list-row,
[data-theme="dark"] .custom-routine-detail-exercise,
[data-theme="dark"] .custom-routine-exercise-metrics div,
[data-theme="dark"] .action-popover-menu {
  border-color: var(--color-border);
  background: var(--surface-elevated);
  color: var(--color-text);
}

[data-theme="dark"] .person-profile-page .field input,
[data-theme="dark"] .person-profile-page .field select,
[data-theme="dark"] .person-profile-page .field textarea,
[data-theme="dark"] .account-security-form input,
[data-theme="dark"] .account-security-form select,
[data-theme="dark"] .account-security-form textarea {
  border-color: var(--color-border);
  background: #0f1726;
  color: var(--color-text);
}

[data-theme="dark"] input:disabled,
[data-theme="dark"] select:disabled,
[data-theme="dark"] textarea:disabled,
[data-theme="dark"] .consent-option.is-disabled {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.10);
  color: var(--color-muted);
  opacity: 1;
}

[data-theme="dark"] input[type="checkbox"] {
  accent-color: var(--color-primary);
}

[data-theme="dark"] .requirement-chip,
[data-theme="dark"] .badge.inactive,
[data-theme="dark"] .badge.archived,
[data-theme="dark"] .badge.deleted {
  border-color: rgba(148, 163, 184, 0.30);
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

[data-theme="dark"] .requirement-chip.is-required {
  border-color: rgba(251, 191, 36, 0.38);
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}

[data-theme="dark"] .action-popover-item {
  color: var(--color-text);
}

[data-theme="dark"] .action-popover-trigger:hover,
[data-theme="dark"] .action-popover-trigger[aria-expanded="true"],
[data-theme="dark"] .action-popover-item:hover {
  border-color: rgba(122, 167, 255, 0.38);
  background: var(--surface-muted);
  color: var(--text-strong);
}

[data-theme="dark"] .action-popover-item-danger,
[data-theme="dark"] .user-menu__item-danger {
  color: var(--status-danger-text);
}

[data-theme="dark"] .action-popover-item-danger:hover {
  background: rgba(248, 113, 113, 0.14);
}

[data-theme="dark"] .custom-routine-detail-exercise-heading strong,
[data-theme="dark"] .custom-routine-exercise-metrics dd,
[data-theme="dark"] .compact-section-header h3,
[data-theme="dark"] .custom-routine-card h4 {
  color: var(--text-strong);
}

[data-theme="dark"] .custom-routine-detail-exercise-heading small,
[data-theme="dark"] .custom-routine-exercise-metrics dt,
[data-theme="dark"] .custom-routine-detail-notes,
[data-theme="dark"] .compact-section-header p,
[data-theme="dark"] .custom-routine-card p,
[data-theme="dark"] .consent-scope-note {
  color: var(--color-muted);
}

@media (max-width: 980px) {
  .header-actions {
    justify-content: flex-start;
  }

  .context-chip {
    max-width: 100%;
  }

  .routine-phone-preview,
  .routine-defaults-panel,
  .routine-assignment-tools {
    grid-template-columns: 1fr;
  }

  .routine-assignment-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .auth-theme-action {
    top: 12px;
    right: 12px;
  }

  .theme-switcher {
    justify-content: flex-start;
  }

  .theme-toggle {
    min-width: 84px;
    padding-inline: 9px;
  }

  .context-chip {
    width: 100%;
  }

  .context-chip .badge {
    display: none;
  }

  .admin-user-chip {
    max-width: 100%;
  }

  .user-menu {
    max-width: 100%;
  }

  .user-menu__trigger {
    max-width: min(100%, 320px);
  }
}
