/* Pigmalión Fitness · Administrador V23 (diseño de ficha y lista; sin cambios de API) */
main:has(#formview:not(.hide)) { max-width: 1540px; }

#formview.is-client-profile {
  padding: 30px 36px 42px;
  border-radius: 22px;
}
#formview .profile-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 30px;
}
#formview .profile-breadcrumb #formtitle {
  font-size: clamp(25px, 2.4vw, 39px);
  line-height: 1.18;
  margin: 0;
}
#formview .profile-breadcrumb #back {
  padding: 0;
  background: transparent;
  color: #8693a4;
  font-size: clamp(21px, 2vw, 31px);
  font-weight: 720;
}
#formview .profile-breadcrumb #back:hover { color: #152d55; }
#formview .profile-breadcrumb .profile-slash {
  font-size: 29px;
  color: #b3bac5;
}
#formview .profile-intro { display: none; }

.profile-shell { display: block; }
#formview.is-client-profile .profile-shell {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.profile-sidebar {
  display: none;
  min-width: 0;
  padding: 4px 0;
}
#formview.is-client-profile .profile-sidebar { display: block; }
.profile-avatar {
  width: 168px;
  height: 168px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(145deg,#b8bdc5,#d7dbe0);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.profile-avatar svg { width: 115px; height: 115px; }
.profile-person-name {
  color: #1c2530;
  text-align: center;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.profile-person-state {
  color: #27724d;
  text-align: center;
  margin: 7px 0 23px;
  font-size: 13px;
  font-weight: 650;
}
.profile-person-state.inactive { color: #a04646; }
.profile-actions { border-top: 1px solid #e1e7ed; padding-top: 12px; }
#formview .profile-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  color: #354052;
  background: transparent;
  font-size: 15px;
  font-weight: 580;
  line-height: 1.35;
  padding: 13px 9px;
  border-radius: 10px;
}
#formview .profile-action:hover:not(:disabled) { background: #ecf6fd; color: #087fb9; }
#formview .profile-action:focus-visible { outline: 3px solid #3cb6ec; }
#formview .profile-action .action-icon {
  color: #159fe0;
  font-size: 21px;
  width: 27px;
  flex: 0 0 27px;
  text-align: center;
}
#formview .profile-action:disabled { color: #9299a6; opacity: .64; cursor: not-allowed; }
#formview .profile-action-danger { border-top: 1px solid #e7e9ee; margin-top: 9px; border-radius: 0; }
.profile-main { min-width: 0; }
.profile-tabbar {
  display: none;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 23px;
  scrollbar-width: thin;
}
#formview.is-client-profile .profile-tabbar { display: flex; }
#formview .profile-tab {
  flex: 0 0 auto;
  background: transparent;
  color: #66717f;
  border-radius: 34px;
  padding: 12px 17px;
  font-size: 15px;
  font-weight: 600;
}
#formview .profile-tab[aria-selected="true"] {
  background: #11a6e9;
  color: #fff;
  box-shadow: 0 5px 13px #0398e51c;
}
#formview .profile-tab:focus-visible { outline: 3px solid #acdff8; }
.profile-pane { min-width: 0; }
#formview .profile-data-heading {
  margin: 10px 0 25px;
  font-size: clamp(23px, 2vw, 31px);
}
.profile-placeholder {
  min-height: 310px;
  padding: 25px 8px;
}
.profile-placeholder h2 { margin: 0 0 17px; font-size: 28px; }
.profile-placeholder p { max-width: 680px; line-height: 1.7; }
.profile-pending {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 11px;
  color: #5b6d83;
  background: #ecf2f8;
  font-size: 13px;
  font-weight: 750;
}
.profile-products-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.profile-products-bar button { border-radius: 25px; background: #11a6e9; }
.profile-credits { width: 100%; margin-top: 20px; }
.profile-credits th { color: #313e51; font-size: 15px; }
.profile-credits td { background: #f4f7fb; color: #69788b; border-radius: 9px; }
#formview .profile-legacy { display: none !important; }

@media (max-width: 950px) {
  #formview.is-client-profile { padding: 22px 20px; }
  #formview.is-client-profile .profile-shell { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
  .profile-avatar { width: 128px; height: 128px; }
  .profile-avatar svg { width: 92px; height: 92px; }
}
@media (max-width: 690px) {
  #formview.is-client-profile .profile-shell { display: block; }
  #formview.is-client-profile .profile-sidebar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #e3e7ee; }
  .profile-avatar { width: 70px; height: 70px; margin: 0; }
  .profile-avatar svg { width: 51px; height: 51px; }
  .profile-person-name, .profile-person-state { text-align: left; margin: 0; }
  .profile-person-state { flex: 1 1 100%; }
  .profile-actions { display: flex; flex-wrap: wrap; width: 100%; gap: 4px 8px; padding-top: 8px; }
  #formview .profile-action { width: auto; font-size: 13px; padding: 8px; }
  #formview .profile-action-danger { border-top: 0; margin: 0; }
  #formview .profile-tab { padding: 10px 13px; font-size: 14px; }
}

/* Secciones informativas: fieles al orden de la referencia, pero sin datos ficticios. */
#formview.is-client-profile .profile-data-heading { display: none; }
#formview:not(.is-client-profile) .profile-summary,
#formview:not(.is-client-profile) .profile-access-block,
#formview:not(.is-client-profile) .profile-editor-bar { display: none; }
#formview.is-client-profile #clientform,
#formview.is-client-profile .profile-editor-bar { display: none; }
#formview.is-client-profile.profile-editor-open #clientform { display: block; }
#formview.is-client-profile.profile-editor-open .profile-editor-bar { display: flex; }
#formview.is-client-profile.profile-editor-open .profile-summary,
#formview.is-client-profile.profile-editor-open .profile-access-block { display: none; }

#formview .profile-detail-section,
#formview .profile-access-block {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  margin: 0 0 42px;
}
#formview .profile-detail-section > h2,
#formview .profile-access-block > h2 {
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 750;
  margin: 0 0 21px;
  color: #1c2530;
}
.profile-detail-caption {
  font-size: 14px;
  line-height: 1.6;
  color: #788292;
  margin: -9px 0 18px;
  max-width: 780px;
}
.profile-detail-list { margin: 0; padding: 0; }
.profile-detail-row {
  display: grid;
  grid-template-columns: minmax(185px, .86fr) minmax(0, 1.4fr);
  align-items: center;
  column-gap: 20px;
  min-height: 57px;
  padding: 14px 18px;
  border-radius: 12px;
}
.profile-detail-row:nth-child(odd) { background: #f4f5f7; }
.profile-detail-row dt {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
}
.profile-detail-row dd {
  margin: 0;
  min-width: 0;
  color: #3c4654;
  font-size: 15px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.profile-empty-value { color: #9aa3b0 !important; }
#formview .profile-access-block {
  border-top: 1px solid #e6ebf1;
  padding-top: 25px;
  margin-top: 15px;
}
#formview .profile-editor-bar {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 21px;
}
.profile-editor-bar h2 { margin: 0; }
.profile-summary-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin: 6px 0 26px;
}
.profile-summary-card {
  min-height: 110px;
  background: #f3f5f8;
  border-radius: 15px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-summary-card strong { font-size: 16px; }
.profile-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
.profile-table { width: 100%; min-width: 520px; border-collapse: separate; border-spacing: 0 5px; }
.profile-table th {
  color: #374151;
  font-size: 14px;
  font-weight: 750;
  padding: 11px 13px;
  white-space: nowrap;
}
.profile-table td {
  padding: 19px 14px;
  border-bottom: 0;
  border-radius: 12px;
  color: #738095;
  background: #f4f5f7;
}
.profile-membership-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 22px;
}
.profile-membership-state {
  padding: 9px 15px;
  background: #eef2f7;
  color: #607083;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 650;
}
.profile-membership-state:first-child { background: #e4f5ff; color: #148abf; }
@media (max-width: 690px) {
  .profile-detail-row { grid-template-columns: minmax(95px, 1fr) minmax(0, 1.25fr); gap: 9px; padding: 12px; }
  .profile-detail-row dt, .profile-detail-row dd { font-size: 13px; }
  .profile-summary-cards { grid-template-columns: 1fr; }
}

/* Listado de clientes V23: solo utiliza datos disponibles de la API de clientes. */
main:has(#listview:not(.hide)) { max-width: 1600px; }
#listview.client-modern-list {
  padding: 28px 30px 40px;
  box-shadow: none;
  border-radius: 20px;
}
#listview.client-modern-list > .flex:first-child { margin-bottom: 28px; }
#listview.client-modern-list > .flex:first-child h1 {
  font-size: clamp(31px, 3vw, 44px);
  font-weight: 770;
  margin: 0;
}
#listview.client-modern-list > .flex:first-child p { display: none; }
#listview.client-modern-list #add {
  background: #11a6e9;
  color: #fff;
  padding: 16px 27px;
  border-radius: 34px;
  font-size: 17px;
  font-weight: 750;
}
#listview .client-legacy-table,
#listview .client-legacy-count { display: none !important; }
.client-modern-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 28px;
}
.client-modern-search {
  flex: 1 1 260px;
  max-width: 405px;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f5f7;
  padding: 0 16px;
  border-radius: 13px;
}
.client-modern-search span { font-size: 25px; color: #97a1ad; line-height: 1; }
#listview .client-modern-search input {
  width: 100%;
  min-width: 0;
  max-width: none;
  background: transparent;
  border: 0;
  outline-offset: 3px;
  padding: 16px 0;
  font-size: 16px;
}
.client-filter-menu-parent { position: relative; }
.client-filter-menu-parent summary { list-style: none; cursor: pointer; }
.client-filter-menu-parent summary::-webkit-details-marker { display: none; }
#listview .client-filter-chip {
  background: white;
  color: #485565;
  border: 1px solid #d6dce4;
  border-radius: 28px;
  padding: 12px 19px;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#listview .client-filter-chip.client-filter-active {
  color: #0499d8;
  border-color: #11a6e9;
}
#listview button.client-filter-disabled {
  opacity: .56;
  cursor: not-allowed;
}
.client-filter-popover {
  position: absolute;
  z-index: 30;
  min-width: 180px;
  background: #fff;
  box-shadow: 0 13px 32px #18263b2b;
  border: 1px solid #e0e5eb;
  border-radius: 14px;
  padding: 10px;
  top: calc(100% + 9px);
  left: 0;
}
#listview .client-filter-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  color: #374151;
  background: transparent;
}
#listview .client-filter-option:hover { background: #f0f8fe; }
.client-filter-more { min-width: 240px; }
.client-filter-more label { font-size: 13px; margin-bottom: 10px; }
#listview .client-filter-more select { width: 100%; max-width: none !important; }
.client-modern-table-scroll { overflow-x: auto; width: 100%; }
.client-modern-table { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; }
.client-modern-table thead th {
  padding: 14px 13px 18px;
  color: #38404d;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}
#listview .client-sort-button {
  background: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
}
.client-sort-arrows { color: #6d7785; margin-left: 7px; }
.client-modern-table tbody td {
  padding: 15px 13px;
  border: 0;
  font-size: 14px;
  color: #445063;
  vertical-align: middle;
}
.client-modern-table tbody tr:nth-child(odd) td { background: #f4f5f7; }
.client-modern-table tbody td:first-child { border-radius: 12px 0 0 12px; }
.client-modern-table tbody td:last-child { border-radius: 0 12px 12px 0; }
.client-modern-table .client-col-identity { min-width: 285px; max-width: 360px; }
.client-identity-wrap { display: flex; align-items: center; gap: 9px; }
.client-small-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #bdc4cc;
  color: #fff;
  font-size: 0;
  flex: 0 0 auto;
  position: relative;
}
.client-small-avatar::before {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  top: 6px;
  left: 12px;
  background: white;
  border-radius: 50%;
}
.client-small-avatar::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 13px;
  left: 5px;
  bottom: 3px;
  background: white;
  border-radius: 50% 50% 42% 42%;
}
#listview .client-open-profile {
  background: none;
  padding: 4px 0;
  color: #27313f;
  font-weight: 620;
  text-align: left;
  font-size: 14px;
  max-width: 205px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#listview .client-open-profile:hover { color: #0499d8; text-decoration: underline; }
.client-type-tag,
.client-inactive-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 750;
  background: #e5f4fd;
  color: #117fb2;
  border-radius: 5px;
  padding: 4px 6px;
}
.client-inactive-tag { background: #f8e8e8; color: #a34b4b; }
.client-col-contact { white-space: nowrap; }
.client-contact-link { font-size: 22px; text-decoration: none; color: #08a1e2; margin-right: 13px; }
.client-contact-link:hover { color: #0477aa; }
.client-modern-table .client-no-data { color: #a1a8b3; }
.client-modern-table .client-no-results { text-align: center; padding: 35px; }
@media (max-width: 760px) {
  #listview.client-modern-list { padding: 18px 14px 25px; }
  #listview .client-modern-search { max-width: none; flex-basis: 100%; }
  .client-modern-table { min-width: 1010px; }
}
