/* Acabado visual del panel. Se carga después de los estilos base. */
:root {
  --navy: #0b111e;
  --blue: #1179bd;
  --blue-dark: #075a94;
  --blue-soft: #eaf4fb;
  --ink: #142235;
  --muted: #68788a;
  --line: #e4eaf1;
  --surface: #fff;
  --shadow-soft: 0 16px 42px rgb(17 39 67 / 6%);
}

html { scroll-behavior: smooth; }
body { background: #f3f6f9; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #65afe0;
  outline-offset: 3px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Acceso */
.login-brand {
  background: radial-gradient(circle at 70% 10%, #124a74 0%, transparent 32%),
    linear-gradient(150deg, #080c13 10%, #0a1727 68%, #092f4b 100%);
}
.login-brand::after { opacity: .7; }
.brand-content { padding-inline: clamp(2.5rem, 6vw, 7rem); }
.brand-logo-image { width: 58px; height: 58px; border: 1px solid #ffffff38; border-radius: 17px; }
.brand-message { max-width: 760px; }
.brand-message h1 { font-size: clamp(3.2rem, 5vw, 5.7rem); line-height: 1.02; }
.brand-message > p:last-child { max-width: 490px; color: #afc0d2; }
.login-panel { background: radial-gradient(circle at 100% 0%, #e9f3fb, transparent 40%), #f9fbfd; }
.login-card {
  width: min(100%, 450px);
  padding: clamp(1.5rem, 3vw, 2.65rem);
  border: 1px solid #e8eef4;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 25px 70px rgb(17 39 67 / 9%);
}
.login-card h2 { font-size: 2.2rem; }
.login-card-top { margin-bottom: 2rem; }
.login-card .input-group { margin-block: 1.25rem; }
.login-card input { min-height: 50px; }
.login-card .primary-button { min-height: 52px; }
.forgot-password-link { display: block; width: fit-content; margin: -.3rem 0 1rem auto; color: #095d99; font-size: .82rem; font-weight: 750; text-decoration: none; }
.forgot-password-link:hover { text-decoration: underline; }

/* Estructura del panel */
.app-layout { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 1.5rem 1.05rem 1.15rem;
  background: radial-gradient(circle at 100% 0%, #183653 0%, transparent 28%),
    linear-gradient(180deg, #0b1422 0%, #0b111e 100%);
}
.sidebar-brand { gap: .85rem; padding: .35rem .65rem 2.65rem; }
.sidebar-brand img, .sidebar-monogram { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; }
.sidebar-brand-text strong { font-size: .77rem; letter-spacing: .13em; }
.sidebar-brand-text small { color: #77b8e5; }
.nav-caption { margin-bottom: .9rem; padding-inline: .9rem; color: #71859d; }
.sidebar nav { gap: .28rem; }
.nav-item {
  min-height: 47px;
  gap: .85rem;
  border-radius: 12px;
  padding: .78rem .9rem;
  color: #9aaec3;
  font-size: .86rem;
  font-weight: 690;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item.active {
  background: linear-gradient(90deg, #1179bd40, #1179bd10);
  box-shadow: inset 3px 0 #35a7ed;
}
.nav-item:hover { background: #ffffff11; }
.sidebar-support { margin-inline: .35rem; padding: 1rem .55rem; }
.sidebar-support small { color: #8da0b5; }
.logout-button { min-height: 43px; border-radius: 10px; }
.dashboard {
  min-height: 100vh;
  padding: 0 clamp(1.5rem, 3.2vw, 4rem) 4rem;
  background: radial-gradient(circle at 100% 0%, #e8f1f8 0%, transparent 30%), #f3f6f9;
}
.dashboard-header {
  min-height: 102px;
  max-width: 1400px;
  margin-bottom: 2rem;
  border-bottom: 1px solid #dce5ec;
}
.header-title h1 { margin-top: .35rem; color: var(--ink); font-size: clamp(1.5rem, 2vw, 2rem); }
.header-date { color: #76899c; font-size: .75rem; font-weight: 750; text-transform: capitalize; }
.header-actions { gap: .8rem; }
.notification-button { background: #ffffffc7; }
.user-chip { min-height: 46px; border-radius: 13px; background: #fff; box-shadow: 0 4px 12px #0a253009; }
.user-chip > span { width: 35px; height: 35px; border-radius: 10px; }
.content-card {
  max-width: 1400px;
  padding: clamp(1.5rem, 2.6vw, 2.75rem);
  border: 1px solid #e3eaf0;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}
.content-card.is-home { padding: 0; border: 0; background: none; box-shadow: none; }
.content-card > p { max-width: 760px; }

/* Inicio */
.home-hero {
  display: flex;
  position: relative;
  min-height: 340px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #182d42;
  border-radius: 23px;
  padding: clamp(2rem, 4vw, 4rem);
  color: #fff;
  background: radial-gradient(circle at 86% 24%, #126b9d 0%, transparent 28%),
    linear-gradient(125deg, #0a111d 5%, #10273f 70%, #0e4262 100%);
  box-shadow: 0 24px 55px rgb(10 39 64 / 16%);
}
.home-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .24;
  background-image: linear-gradient(#ffffff10 1px, transparent 1px), linear-gradient(90deg, #ffffff10 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.home-hero-content { position: relative; z-index: 1; max-width: 640px; }
.home-kicker { display: inline-flex; align-items: center; gap: .55rem; color: #9bd2f7; font-size: .69rem; font-weight: 900; letter-spacing: .16em; }
.home-kicker span { width: 8px; height: 8px; border-radius: 50%; background: #59bcf1; box-shadow: 0 0 0 4px #59bcf12a; }
.home-hero h2 { margin: 1rem 0 .85rem; color: #fff; font-size: clamp(2.45rem, 4.3vw, 4.1rem); line-height: 1.08; letter-spacing: -.055em; }
.home-hero h2 em { color: #8bc9f0; font-style: normal; }
.home-hero p { max-width: 540px; margin: 0; color: #c6d6e3; font-size: .93rem; line-height: 1.65; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.7rem; }
.home-hero-actions button { min-height: 44px; padding-inline: 1.15rem; font-size: .8rem; }
.home-hero-actions .primary-button { background: #1179bd; box-shadow: none; }
.home-outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 1rem; border: 1px solid #ffffff55; border-radius: 10px; color: #fff; background: #ffffff0b; font-weight: 850; }
.home-outline-button:hover { background: #ffffff1a; }
.home-hero-mark { display: grid; position: absolute; right: -3rem; bottom: -6rem; width: 370px; height: 370px; place-items: center; border: 1px solid #ffffff30; border-radius: 50%; box-shadow: 0 0 0 36px #ffffff08, 0 0 0 75px #ffffff05; transform: rotate(-13deg); }
.home-hero-mark span { color: #ffffff13; font-size: 8rem; font-weight: 950; letter-spacing: -.08em; }
.home-hero.is-dashboard { min-height: 255px; }
.home-hero.is-dashboard h2 { font-size: clamp(2.35rem, 3.6vw, 3.45rem); }
.home-hero.is-dashboard .home-hero-mark { right: -1rem; bottom: -9rem; }
.home-overview { margin-top: 1.5rem; }
.home-overview .home-section-heading { align-items: center; margin: 0 0 .9rem; }
.home-overview .home-section-heading button { min-height: 37px; padding-inline: .85rem; font-size: .72rem; }
.home-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.home-stat-card { position: relative; display: flex; min-width: 0; min-height: 174px; flex-direction: column; align-items: start; border: 1px solid #dfe8ef; border-radius: 15px; padding: 1.2rem; color: var(--ink); background: #fff; box-shadow: 0 9px 25px rgb(17 39 67 / 4%); text-align: left; transition: transform .2s, border-color .2s, box-shadow .2s; }
.home-stat-card:hover { border-color: #a9d0ea; box-shadow: var(--shadow-soft); transform: translateY(-3px); }
.home-stat-label { max-width: calc(100% - 25px); color: #557187; font-size: .72rem; font-weight: 800; }
.home-stat-card strong { margin: .75rem 0 .35rem; color: var(--ink); font-size: clamp(1.8rem, 2.8vw, 2.5rem); line-height: 1; letter-spacing: -.06em; overflow-wrap: anywhere; }
.home-stat-card small { margin-top: auto; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.home-stat-arrow { position: absolute; top: 1rem; right: 1.1rem; color: #8ba5b8; font-size: .9rem; }
.home-stat-card.is-attention { border-color: #f4dfc9; background: linear-gradient(155deg, #fff 55%, #fff8f1); }
.home-stat-card.is-attention strong { color: #a3521b; }
.home-stat-card.is-revenue { border-color: #0e4c79; background: linear-gradient(135deg, #0c263c, #0d5a8b); }
.home-stat-card.is-revenue .home-stat-label, .home-stat-card.is-revenue small { color: #c5ddea; }
.home-stat-card.is-revenue strong, .home-stat-card.is-revenue .home-stat-arrow { color: #fff; }
.home-summary-loading, .home-summary-error { margin: 0; border: 1px solid #dfe8ef; border-radius: 14px; padding: 1.4rem; color: var(--muted); background: #fff; font-size: .8rem; }
.home-summary-error { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.home-summary-error p { margin: 0; }
.home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.home-section-heading h3 { margin: .35rem 0 0; font-size: 1.25rem; letter-spacing: -.03em; }
.home-section-heading > span { color: #93a3b2; font-size: .68rem; font-weight: 900; letter-spacing: .15em; }
.home-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.home-action-card {
  display: grid;
  min-height: 180px;
  align-content: start;
  justify-items: start;
  border: 1px solid #e1e9ef;
  border-radius: 16px;
  padding: 1.4rem;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 25px rgb(17 39 67 / 4%);
  text-align: left;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.home-action-card:hover { border-color: #a9d0ea; box-shadow: var(--shadow-soft); transform: translateY(-3px); }
.home-action-icon { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 1rem; border-radius: 9px; color: var(--blue-dark); background: var(--blue-soft); font-size: .66rem; font-weight: 900; }
.home-action-card strong { font-size: 1rem; }
.home-action-card small { margin-top: .3rem; color: var(--muted); font-size: .76rem; }
.home-action-link { display: flex; justify-content: space-between; width: 100%; margin-top: 1.25rem; padding-top: .8rem; border-top: 1px solid var(--line); color: var(--blue-dark); font-size: .73rem; font-weight: 850; }
.coming-soon { display: grid; min-height: 330px; align-content: center; justify-items: center; text-align: center; }
.coming-soon-mark { display: grid; width: 66px; height: 66px; place-items: center; margin-bottom: 1.4rem; border: 1px solid #bddcf0; border-radius: 18px; color: var(--blue-dark); background: var(--blue-soft); font-size: .87rem; font-weight: 950; }
.coming-soon h2 { margin: .55rem 0 .3rem; font-size: 1.65rem; }
.coming-soon p:not(.eyebrow) { max-width: 380px; margin: 0 0 1.35rem; font-size: .86rem; }

/* Formularios y acciones */
input, select { min-height: 44px; border-color: #dce5ed; border-radius: 10px; }
input:hover, select:hover { border-color: #b7c9d8; }
.primary-button { padding-inline: 1.15rem; background: linear-gradient(125deg, #1179bd, #095d99); box-shadow: 0 10px 20px #0b5d9d25; font-size: .8rem; }
.secondary-button { border-radius: 9px; }
.module-header { margin-bottom: 1.75rem; }
.module-header .eyebrow { margin-bottom: .5rem; font-size: .65rem; }
.module-header h2 { margin: 0 0 .35rem; font-size: clamp(1.35rem, 2vw, 1.65rem); }
.module-header p:last-child { max-width: 650px; font-size: .86rem; }
.search-row input { min-height: 48px; background: #f9fbfd; }
.member-form section { border-radius: 13px; padding: 1.5rem; background: #fbfcfe; }
.member-form h3 { font-size: 1rem; }
.form-actions { align-items: center; margin-top: .8rem; }
.form-message.error:not([hidden]) { padding: .7rem .85rem; border: 1px solid #f6ceca; border-radius: 9px; background: #fff6f4; }
.success-message { border-radius: 10px; }

/* Tablas y detalle de socio */
.table-scroll { border-radius: 12px; background: #fff; }
th { padding-block: .95rem; color: #6b7f91; background: #f5f8fb; font-size: .65rem; }
td { padding-block: 1rem; color: #304255; }
td strong { color: #19293a; }
td small { color: #718294; }
tbody tr:hover { background: #f2f8fc; }
.table-action { display: inline-flex; align-items: center; min-height: 34px; padding: .25rem .55rem; border-radius: 8px; }
.table-action:hover { background: var(--blue-soft); text-decoration: none; }
.status-pill { padding: .36rem .65rem; font-size: .63rem; letter-spacing: .035em; white-space: nowrap; }
.pagination { margin-top: 1.2rem; }
.empty-state { background: #fafdff; }
.member-detail { width: min(590px, 100vw); padding: clamp(1.5rem, 3vw, 2.5rem); background: #fff; }
.detail-header { margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.detail-header h3 { margin-bottom: 1.4rem; font-size: 1.4rem; }
.detail-grid { gap: .8rem; }
.detail-grid div { min-height: 70px; padding: .75rem .85rem; border: 1px solid #e9eef3; border-radius: 10px; background: #f9fbfd; }
.detail-grid span:first-child { color: #758597; }
.detail-grid strong { overflow-wrap: anywhere; }
.app-dialog-card { border-radius: 18px; box-shadow: 0 25px 70px #07111d5c; }
.dialog-icon { width: 52px; height: 52px; font-size: 1.35rem; }

/* Membresías */
.membership-plan-toolbar { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.membership-plan-toolbar input { width: min(380px, 100%); background: #f9fbfd; }
.membership-plan-toolbar select { width: 180px; background: #fff; }
.membership-plan-toolbar > span { margin-left: auto; color: var(--muted); font-size: .73rem; font-weight: 800; white-space: nowrap; }
.membership-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1rem; }
.membership-plan-card { display: flex; min-height: 265px; flex-direction: column; border: 1px solid #e1e9f0; border-radius: 16px; padding: 1.3rem; background: #fff; box-shadow: 0 9px 24px rgb(17 39 67 / 4%); }
.membership-plan-card.is-inactive { background: #f9fbfc; }
.membership-plan-card-top { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.membership-plan-symbol { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-size: .65rem; font-weight: 950; letter-spacing: .05em; }
.membership-plan-card h3 { margin: 1.05rem 0 .3rem; color: var(--ink); font-size: 1.05rem; overflow-wrap: anywhere; }
.membership-plan-card > p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; overflow-wrap: anywhere; }
.membership-plan-price { margin-top: auto; padding-top: 1.15rem; color: var(--ink); font-size: 1.45rem; font-weight: 900; letter-spacing: -.04em; }
.membership-plan-price small { display: block; margin-top: .1rem; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: 0; }
.membership-plan-card-actions { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.membership-plan-card-actions button { min-height: 38px; font-size: .75rem; }
.membership-plan-empty { grid-column: 1 / -1; border: 1px dashed #cbdbe7; border-radius: 13px; padding: 2rem; color: var(--muted); background: #f9fcfe; text-align: center; font-size: .82rem; }
#membership-plan-form-panel:not([hidden]) { display: block; margin-bottom: 1.45rem; scroll-margin-top: 1rem; }
.membership-plan-form { border: 1px solid #cde3f1; border-radius: 14px; padding: clamp(1rem, 2vw, 1.5rem); background: #f7fbfe; }
.membership-plan-form-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.membership-plan-form-heading h3 { margin: .35rem 0; color: var(--ink); font-size: 1.1rem; }
.membership-plan-form-heading p:not(.eyebrow) { max-width: 640px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.membership-plan-form label { display: grid; gap: .35rem; color: #41576b; font-size: .76rem; font-weight: 750; }
.membership-plan-form input, .membership-plan-form textarea { min-width: 0; background: #fff; }
.membership-plan-form textarea { width: 100%; border: 1px solid #dce5ed; border-radius: 10px; padding: .8rem .9rem; font: inherit; resize: vertical; }
.membership-layout { grid-template-columns: minmax(270px, .62fr) minmax(0, 1.38fr); gap: 1.1rem; }
.membership-search-panel, .membership-detail-panel { min-width: 0; border-radius: 15px; padding: clamp(1.2rem, 2vw, 1.65rem); background: #fff; }
.membership-search-panel { border-color: #dae6ef; box-shadow: 0 10px 25px #0b355a0b; }
.panel-heading { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.25rem; }
.panel-step { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-size: .7rem; font-weight: 900; }
.panel-heading strong, .panel-heading small { display: block; }
.panel-heading strong { color: var(--ink); font-size: .9rem; }
.panel-heading small { margin-top: .2rem; color: var(--muted); font-size: .7rem; }
.membership-search-panel .search-row input { font-size: .78rem; }
.membership-member-results { gap: .4rem; max-height: 530px; overflow-y: auto; }
.member-choice { min-height: 62px; border-color: #edf1f4; border-radius: 11px; background: #fff; }
.member-choice:hover, .member-choice[aria-pressed="true"] { border-color: #9cc8e6; background: #edf7fd; }
.member-choice[aria-pressed="true"] { box-shadow: inset 3px 0 var(--blue); }
.member-choice-avatar { width: 35px; height: 35px; border-radius: 10px; }
.member-choice-avatar.large { width: 46px; height: 46px; border-radius: 12px; }
.member-choice .status-pill { font-size: .56rem; }
.membership-awaiting { display: grid; min-height: 280px; place-content: center; justify-items: center; text-align: center; }
.membership-awaiting > span { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid #cfe4f3; border-radius: 15px; color: var(--blue-dark); background: var(--blue-soft); font-size: .8rem; font-weight: 900; }
.membership-awaiting h3 { margin: 1rem 0 .35rem; font-size: 1.08rem; }
.membership-awaiting p { max-width: 310px; margin: 0; font-size: .8rem; }
.membership-member-heading { padding-bottom: 1.2rem; }
.membership-member-heading h3 { font-size: 1.15rem; }
.membership-summary-grid { gap: .65rem; margin: 1.35rem 0; border: 0; border-radius: 0; background: transparent; }
.membership-summary-grid > div { min-height: 90px; border: 1px solid #e4eaf0; border-radius: 11px; padding: 1rem; background: #f9fbfd; }
.membership-summary-grid > div:first-child { border-color: #0e4c79; color: #fff; background: linear-gradient(125deg, #0c263c, #0d5a8b); }
.membership-summary-grid > div:first-child span:first-child, .membership-summary-grid > div:first-child strong { color: #fff; }
.membership-summary-grid strong { font-size: .9rem; }
.payment-form { padding-top: 1.35rem; }
.payment-form h3, .section-heading h3 { margin-bottom: 1.1rem; font-size: 1.04rem; }
.payment-form label { font-size: .77rem; }
.payment-form .form-actions .primary-button { min-height: 44px; }
.payment-plan-description { margin-top: 1rem; border-left: 3px solid #8dc7eb; padding: .25rem .7rem; background: #f5faff; }
.payment-history-section { margin-top: 2rem; padding-top: 1.5rem; }
.section-heading p { margin-top: -.8rem; margin-bottom: 1.1rem; }
.payment-history-empty { padding: 1.35rem; background: #f9fcfe; }
.payment-history-list { display: grid; gap: .65rem; }
.payment-record { border: 1px solid #e5ecf2; border-radius: 12px; padding: 1rem; background: #fff; }
.payment-record:hover { border-color: #c5deee; background: #fcfeff; }
.payment-record-top { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.payment-record-identity { display: flex; align-items: center; min-width: 0; gap: .7rem; }
.payment-record-icon { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-size: 1rem; }
.payment-record-identity strong, .payment-record-identity small { display: block; }
.payment-record-identity strong { color: var(--ink); font-size: .82rem; }
.payment-record-identity small { margin-top: .18rem; color: var(--muted); font-size: .71rem; }
.payment-record-amount { display: grid; justify-items: end; gap: .3rem; text-align: right; }
.payment-record-amount strong { color: #0b4167; font-size: .9rem; white-space: nowrap; }
.payment-record-meta { display: grid; grid-template-columns: .8fr 1.3fr 1fr; gap: .75rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid #edf1f5; }
.payment-record-meta span { min-width: 0; color: #506276; font-size: .71rem; overflow-wrap: anywhere; }
.payment-record-meta b { display: block; margin-bottom: .2rem; color: #8a9aaa; font-size: .63rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }

/* Mediciones InBody */
.measurement-layout { display: grid; grid-template-columns: minmax(270px, .62fr) minmax(0, 1.38fr); gap: 1.1rem; align-items: start; }
.measurement-detail-panel { min-width: 0; min-height: 280px; border: 1px solid #e4eaf0; border-radius: 15px; padding: clamp(1.2rem, 2vw, 1.65rem); background: #fff; }
.measurement-search-empty, .measurement-loading { padding: 1rem; color: var(--muted); font-size: .81rem; }
.measurement-profile-heading { display: flex; align-items: center; gap: .8rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.measurement-profile-heading > div { min-width: 0; }
.measurement-profile-heading h3 { margin: .25rem 0; color: var(--ink); font-size: 1.15rem; }
.measurement-profile-heading p:not(.eyebrow) { overflow: hidden; margin: 0; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.measurement-profile-heading .primary-button { min-height: 42px; margin-left: auto; white-space: nowrap; }
.measurement-inactive-note { margin: 1rem 0 0; border: 1px solid #f2dfc6; border-radius: 10px; padding: .8rem 1rem; color: #8a571e !important; background: #fff8ee; font-size: .8rem; }
.measurement-section-title { display: flex; align-items: end; justify-content: space-between; gap: .8rem; margin: 1.55rem 0 .9rem; }
.measurement-section-title .eyebrow { font-size: .6rem; }
.measurement-section-title h3 { margin: .28rem 0 0; color: var(--ink); font-size: 1.08rem; }
.measurement-section-title > span { color: #8292a2; font-size: .7rem; text-align: right; }
.measurement-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.measurement-metric-card { display: grid; min-width: 0; min-height: 123px; align-content: start; gap: .35rem; border: 1px solid #e4eaf0; border-radius: 12px; padding: .95rem; color: var(--ink); background: #f9fbfd; text-align: left; transition: border-color .18s, background .18s, box-shadow .18s; }
.measurement-metric-card:hover, .measurement-metric-card.is-selected { border-color: #a5d2ed; background: #f1f9fe; }
.measurement-metric-card.is-selected { box-shadow: inset 0 -3px var(--blue); }
.measurement-metric-label { display: flex; align-items: center; gap: .4rem; color: #5f7184; font-size: .7rem; font-weight: 800; }
.metric-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.measurement-metric-card strong { font-size: 1.28rem; letter-spacing: -.035em; white-space: nowrap; }
.measurement-metric-card small { color: var(--muted); font-size: .66rem; line-height: 1.35; }
.measurement-chart-card { margin-top: 1rem; border: 1px solid #e4eaf0; border-radius: 13px; padding: 1.2rem; background: #fff; }
.measurement-chart-heading { display: flex; align-items: start; justify-content: space-between; gap: .8rem; }
.measurement-chart-heading h3 { margin: 0; color: var(--ink); font-size: .91rem; }
.measurement-chart-heading p { margin: .25rem 0 0; color: var(--muted); font-size: .72rem; }
.measurement-chart-heading > span { border-radius: 7px; padding: .25rem .45rem; color: var(--blue-dark); background: var(--blue-soft); font-size: .67rem; font-weight: 900; }
.measurement-chart-visual { margin-top: .75rem; }
.measurement-chart-visual svg { width: 100%; height: auto; min-height: 130px; overflow: visible; }
.chart-grid-line { stroke: #e7edf2; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-axis-label { fill: #91a0af; font-size: 10px; font-family: inherit; }
.measurement-chart-dates { display: flex; justify-content: space-between; padding-left: 7%; color: #8292a2; font-size: .68rem; }
.measurement-chart-visual > p { margin: .75rem 0 0; color: var(--muted); font-size: .75rem; text-align: center; }
.measurement-chart-empty, .measurement-empty { display: grid; min-height: 145px; place-content: center; justify-items: center; border: 1px dashed #dce7ef; border-radius: 10px; padding: 1.2rem; color: var(--muted); background: #f9fcfe; font-size: .78rem; text-align: center; }
.measurement-empty { min-height: 110px; gap: .3rem; }
.measurement-empty strong { color: var(--ink); font-size: .85rem; }
.measurement-history-section { margin-top: 1.65rem; padding-top: .25rem; }
.measurement-history-list { display: grid; gap: .5rem; }
.measurement-record { border: 1px solid #e5ecf2; border-radius: 10px; background: #fff; }
.measurement-record[open] { border-color: #bdd9ec; background: #fbfdff; }
.measurement-record summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 62px; padding: .75rem 1rem; cursor: pointer; list-style: none; }
.measurement-record summary::-webkit-details-marker { display: none; }
.measurement-record summary strong, .measurement-record summary small { display: block; }
.measurement-record summary strong { color: var(--ink); font-size: .83rem; }
.measurement-record summary small { margin-top: .18rem; color: var(--muted); font-size: .72rem; }
.measurement-record-summary { color: #5b7081; font-size: .76rem; white-space: nowrap; }
.measurement-record-summary span { margin-left: .4rem; color: var(--blue-dark); font-size: 1rem; }
.measurement-record-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; border-top: 1px solid #e8eef3; padding: 1rem; }
.measurement-record-details > div { display: grid; gap: .2rem; }
.measurement-record-details > div > span { color: #8594a3; font-size: .67rem; }
.measurement-record-details > div > strong { color: var(--ink); font-size: .79rem; }
.measurement-record-notes { grid-column: 1 / -1; margin: 0 !important; border-top: 1px solid #edf1f4; padding-top: .8rem; color: #506276 !important; font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.measurement-record-notes strong { display: block; margin-bottom: .25rem; color: var(--ink); }
.measurement-form { margin-top: 1.2rem; border: 1px solid #cde3f1; border-radius: 13px; padding: 1.25rem; background: #f6fbfe; scroll-margin-top: 1rem; }
.measurement-form-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.measurement-form-heading h3 { margin: 0; color: var(--ink); font-size: 1rem; }
.measurement-form-heading p { margin: .3rem 0 0; color: var(--muted); font-size: .75rem; }
.measurement-form label { display: grid; gap: .4rem; min-width: 0; font-size: .75rem; }
.measurement-form input, .measurement-form textarea { min-width: 0; background: #fff; }
.measurement-form textarea { width: 100%; border: 1px solid #dce5ed; border-radius: 10px; padding: .85rem .95rem; color: var(--ink); font: inherit; outline: none; resize: vertical; }
.measurement-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px #167fcf1c; }
.measurement-notes-label { grid-column: 1 / -1; }

/* Catálogo de ejercicios */
.exercise-module-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.exercise-module-header .primary-button { flex: none; min-height: 44px; }
.exercise-form { margin-bottom: 1.5rem; border: 1px solid #cde3f1; border-radius: 14px; padding: clamp(1.2rem, 2vw, 1.7rem); background: #f6fbfe; scroll-margin-top: 1rem; }
.exercise-form-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.exercise-form-heading h3 { margin: .2rem 0 0; color: var(--ink); font-size: 1.05rem; }
.exercise-form label { display: grid; gap: .4rem; min-width: 0; font-size: .76rem; }
.exercise-form label small { color: var(--muted); font-size: .7rem; }
.exercise-form-wide { grid-column: 1 / -1; }
.exercise-form textarea { width: 100%; min-height: 100px; border: 1px solid #dce5ed; border-radius: 10px; padding: .85rem .95rem; color: var(--ink); background: #fff; font: inherit; resize: vertical; }
.exercise-form textarea:focus { outline: 3px solid #65afe0; outline-offset: 2px; }
.exercise-toolbar { display: flex; align-items: center; gap: .75rem; margin: .4rem 0 1.1rem; }
.exercise-toolbar input { width: min(100%, 410px); background: #f9fbfd; }
.exercise-toolbar select { min-width: 165px; background: #fff; }
.exercise-toolbar > span { margin-left: auto; color: var(--muted); font-size: .73rem; font-weight: 800; white-space: nowrap; }
.exercise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.exercise-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: .4rem; border: 1px dashed #d7e5ef; border-radius: 13px; padding: 2.5rem 1rem; background: #fafdff; text-align: center; }
.exercise-empty strong { color: var(--ink); }
.exercise-empty p { margin: 0; color: var(--muted); font-size: .8rem; }
.exercise-empty .secondary-button { margin-top: .6rem; }
.exercise-card { min-width: 0; overflow: hidden; border: 1px solid #e0e8ef; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgb(17 39 67 / 4%); }
.exercise-card.is-inactive { background: #fafbfc; }
.exercise-card-image { display: grid; height: 135px; place-items: center; overflow: hidden; color: #6cb4df; background: radial-gradient(circle at 75% 20%, #1a6595, transparent 35%), linear-gradient(135deg, #0a1523, #183b57); font-size: 1.55rem; font-weight: 950; letter-spacing: .15em; }
.exercise-card-image img { width: 100%; height: 100%; object-fit: cover; }
.exercise-card-body { display: grid; align-content: start; gap: .65rem; padding: 1.15rem; }
.exercise-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-width: 0; color: var(--blue-dark); font-size: .68rem; font-weight: 850; }
.exercise-card-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exercise-card h3 { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.exercise-card-body > p { min-height: 3.4em; max-height: 3.4em; overflow: hidden; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.7; }
.exercise-card-equipment { color: #52687a; font-size: .72rem; overflow-wrap: anywhere; }
.exercise-card-links { display: flex; flex-wrap: wrap; gap: .8rem; min-height: 24px; align-items: center; font-size: .72rem; font-weight: 850; }
.exercise-card-links a { color: var(--blue-dark); text-decoration: none; }
.exercise-card-links a:hover { text-decoration: underline; }
.exercise-card-links > span { color: #8a99a8; font-weight: 600; }
.exercise-card-actions { display: flex; gap: .55rem; margin-top: .3rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.exercise-card-actions button { flex: 1; min-width: 0; font-size: .72rem; }
.exercise-card-actions .exercise-deactivate { color: #a3413b; }

/* Rutinas */
.routine-layout { display: grid; grid-template-columns: minmax(270px, .62fr) minmax(0, 1.38fr); gap: 1.1rem; align-items: start; }
.routine-detail-panel { min-width: 0; min-height: 280px; border: 1px solid #e4eaf0; border-radius: 15px; padding: clamp(1.2rem, 2vw, 1.65rem); background: #fff; }
.routine-member-heading { display: flex; align-items: center; gap: .8rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.routine-member-heading > div { min-width: 0; }
.routine-member-heading h3 { margin: .25rem 0; color: var(--ink); font-size: 1.15rem; }
.routine-member-heading p:not(.eyebrow) { overflow: hidden; margin: 0; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.routine-member-heading .primary-button { flex: none; min-height: 42px; max-width: 45%; margin-left: auto; white-space: normal; }
.routine-empty { display: grid; gap: .35rem; justify-items: center; margin-top: 1.25rem; border: 1px dashed #dce7ef; border-radius: 12px; padding: 2rem 1rem; background: #f9fcfe; text-align: center; }
.routine-empty strong { color: var(--ink); }
.routine-empty p { max-width: 420px; margin: 0; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.routine-current-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 1rem; }
.routine-current-heading h3 { margin: .3rem 0; color: var(--ink); font-size: 1.2rem; }
.routine-current-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .72rem; }
.routine-current-heading > span { flex: none; border-radius: 8px; padding: .45rem .65rem; color: var(--blue-dark); background: var(--blue-soft); font-size: .7rem; font-weight: 850; }
.routine-objective { display: grid; gap: .2rem; margin: .55rem 0; border-left: 3px solid #8fc3e4; padding: .5rem .85rem; color: #52687a; background: #f7fbfe; font-size: .76rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.routine-objective strong { color: var(--ink); }
.routine-day-list { display: grid; gap: .85rem; margin-top: 1.2rem; }
.routine-saved-day { border: 1px solid #e3eaf0; border-radius: 12px; padding: 1rem; background: #fff; }
.routine-saved-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.routine-saved-day-heading span, .routine-day-number { color: var(--blue-dark); font-size: .63rem; font-weight: 900; letter-spacing: .1em; }
.routine-saved-day-heading h4 { margin: .25rem 0 0; color: var(--ink); font-size: .95rem; }
.routine-saved-day-heading small { color: var(--muted); white-space: nowrap; }
.routine-saved-day > p { margin: .65rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.routine-weekday-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .8rem 0; }
.routine-weekday-tags span { border-radius: 6px; padding: .25rem .5rem; color: #56758c; background: #edf5fa; font-size: .66rem; font-weight: 750; }
.routine-saved-exercises { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: exercise; }
.routine-saved-exercises li { display: flex; align-items: start; justify-content: space-between; gap: .6rem; border-top: 1px solid #edf1f4; padding: .75rem 0; counter-increment: exercise; }
.routine-saved-exercises li::before { display: grid; width: 24px; height: 24px; flex: none; place-items: center; border-radius: 6px; color: var(--blue-dark); background: var(--blue-soft); content: counter(exercise); font-size: .67rem; font-weight: 900; }
.routine-saved-exercises li > div { min-width: 0; margin-right: auto; }
.routine-saved-exercises strong { display: block; color: var(--ink); font-size: .78rem; }
.routine-saved-exercises small { display: block; margin-top: .2rem; color: var(--muted); font-size: .69rem; line-height: 1.4; overflow-wrap: anywhere; }
.routine-saved-exercises a { flex: none; color: var(--blue-dark); font-size: .7rem; font-weight: 850; text-decoration: none; }
.routine-saved-exercises a:hover { text-decoration: underline; }
.routine-form { margin-top: 1.25rem; border: 1px solid #cde3f1; border-radius: 14px; padding: clamp(1rem, 2vw, 1.5rem); background: #f7fbfe; scroll-margin-top: 1rem; }
.routine-form-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.routine-form-heading h3 { margin: .3rem 0; color: var(--ink); font-size: 1.08rem; }
.routine-form-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.routine-form label { display: grid; gap: .35rem; min-width: 0; color: #41576b; font-size: .73rem; font-weight: 750; }
.routine-form input, .routine-form select, .routine-form textarea { min-width: 0; background: #fff; }
.routine-form textarea { width: 100%; border: 1px solid #dce5ed; border-radius: 10px; padding: .8rem .9rem; font: inherit; resize: vertical; }
.routine-form-wide { grid-column: 1 / -1; }
.routine-days-heading, .routine-exercise-list-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.routine-days-heading { margin: 1.4rem 0 .75rem; }
.routine-days-heading h4 { margin: 0; color: var(--ink); font-size: .9rem; }
.routine-days-heading p { margin: .25rem 0 0; color: var(--muted); font-size: .69rem; }
.routine-days-heading .secondary-button, .routine-exercise-list-heading .secondary-button { min-height: 35px; font-size: .69rem; }
#routine-day-editors { display: grid; gap: 1rem; }
.routine-day-editor { min-width: 0; border: 1px solid #d9e7f0; border-radius: 12px; padding: 1rem; background: #fff; }
.routine-day-editor-heading { display: flex; align-items: start; justify-content: space-between; gap: .8rem; margin-bottom: .9rem; }
.routine-day-editor-heading h4 { margin: .2rem 0 0; color: var(--ink); font-size: .88rem; }
.routine-weekdays { margin: 1rem 0; border: 0; padding: 0; }
.routine-weekdays legend { margin-bottom: .6rem; color: #41576b; font-size: .73rem; font-weight: 800; }
.routine-weekdays legend small { color: var(--muted); font-size: .67rem; font-weight: 500; }
.routine-weekdays > div { display: flex; flex-wrap: wrap; gap: .35rem; }
.routine-weekdays label { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #dae8f1; border-radius: 8px; padding: .35rem .55rem; color: #52687a; background: #f8fbfd; font-size: .67rem; cursor: pointer; }
.routine-weekdays input { min-width: auto; min-height: auto; margin: 0; accent-color: var(--blue); }
.routine-exercise-list-heading { border-top: 1px solid #edf1f4; padding-top: .9rem; }
.routine-exercise-list-heading strong { color: var(--ink); font-size: .8rem; }
.routine-exercise-editor-list { display: grid; gap: .7rem; margin-top: .7rem; }
.routine-exercise-row { min-width: 0; border: 1px solid #e5edf3; border-radius: 10px; padding: .85rem; background: #fbfdff; }
.routine-exercise-top { display: flex; align-items: end; justify-content: space-between; gap: .7rem; }
.routine-exercise-top label { flex: 1; }
.routine-exercise-top .text-button { padding-bottom: .65rem; white-space: nowrap; }
.routine-exercise-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: .75rem; }
.routine-exercise-notes { grid-column: span 2; }

@media (max-width: 1180px) {
  .home-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .membership-layout { grid-template-columns: 1fr; }
  .membership-member-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 350px; }
  .measurement-layout { grid-template-columns: 1fr; }
  .exercise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routine-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-layout { display: block; }
  .sidebar { position: fixed; z-index: 30; width: min(82vw, 300px); height: 100dvh; }
  .dashboard { padding: 0 1.5rem 3rem; }
  .dashboard-header { min-height: 90px; margin-bottom: 1.5rem; }
  .mobile-menu-button { display: block; }
}
@media (max-width: 650px) {
  .home-stats-grid { grid-template-columns: 1fr; }
  .home-stat-card { min-height: 145px; }
  .home-overview .home-section-heading { align-items: start; flex-wrap: wrap; }
  .home-summary-error { align-items: start; flex-direction: column; }
  .login-brand, .brand-content { min-height: 300px; }
  .brand-content { padding: 1.5rem; }
  .brand-message { padding: 1.5rem 0; }
  .brand-message h1 { font-size: 2.3rem; }
  .brand-message > p:last-child { font-size: .88rem; }
  .login-card { padding: 1.55rem; }
  .dashboard { padding-inline: 1rem; }
  .dashboard-header { min-height: 82px; }
  .header-date, .notification-button { display: none; }
  .content-card { padding: 1.2rem; border-radius: 15px; }
  .home-hero { min-height: 340px; padding: 1.6rem; }
  .home-hero h2 { font-size: 2.55rem; }
  .home-hero-mark { right: -9rem; bottom: -12rem; opacity: .35; }
  .home-section-heading > span { display: none; }
  .home-action-grid, .membership-member-results { grid-template-columns: 1fr; }
  .home-action-card { min-height: 160px; }
  .membership-summary-grid { grid-template-columns: 1fr 1fr; }
  .membership-summary-grid strong { font-size: .78rem; }
  .member-choice .status-pill { display: none; }
  .membership-member-heading { flex-wrap: wrap; }
  .membership-member-heading .text-button { width: 100%; margin-left: 0; text-align: left; }
  .module-header { gap: .9rem; }
  .payment-record-meta { grid-template-columns: 1fr 1fr; }
  .measurement-profile-heading { flex-wrap: wrap; }
  .measurement-profile-heading .primary-button { width: 100%; margin-left: 0; }
  .measurement-metrics { grid-template-columns: 1fr; }
  .measurement-metric-card { min-height: 92px; }
  .measurement-record-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exercise-module-header, .exercise-toolbar { align-items: stretch; flex-direction: column; }
  .exercise-toolbar input, .exercise-toolbar select { width: 100%; }
  .exercise-toolbar > span { margin-left: 0; }
  .exercise-grid { grid-template-columns: 1fr; }
  .routine-member-heading { flex-wrap: wrap; }
  .routine-member-heading .primary-button { width: 100%; max-width: none; margin-left: 0; }
  .routine-exercise-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routine-days-heading { align-items: start; flex-direction: column; }
  .membership-plan-toolbar { flex-wrap: wrap; }
  .membership-plan-toolbar input, .membership-plan-toolbar select { width: 100%; }
  .membership-plan-toolbar > span { margin-left: 0; }
  .membership-plan-form-heading { flex-wrap: wrap; }
}
@media (max-width: 390px) {
  .home-hero-actions button { width: 100%; }
  .membership-summary-grid { grid-template-columns: 1fr; }
  .payment-record-meta { grid-template-columns: 1fr; }
  .measurement-record-details { grid-template-columns: 1fr; }
  .measurement-section-title { align-items: start; flex-direction: column; }
  .measurement-record-summary { white-space: normal; text-align: right; }
  .routine-exercise-fields { grid-template-columns: 1fr; }
  .routine-exercise-notes { grid-column: auto; }
  .routine-exercise-top { align-items: stretch; flex-direction: column; }
  .routine-exercise-top .text-button { align-self: start; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-action-card, .member-choice, .primary-button { transition: none; }
}
