/* Unified scrolling and action footer for every app modal. */
body:has(#udma-club-app) .modal {
  --udma-modal-gutter: 22px;
  isolation: isolate;
  overflow-x: hidden;
  padding-bottom: max(var(--udma-modal-gutter), env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: max(var(--udma-modal-gutter), env(safe-area-inset-bottom, 0px));
  overscroll-behavior: contain;
}

/* La tienda utiliza su propia capa flotante fuera del contenedor principal. */
body:has(#udma-club-app) .store-dialog {
  padding-bottom: max(22px, env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
}

body:has(#udma-club-app) .modal > .modal-actions {
  position: sticky !important;
  right: 0;
  bottom: -1px;
  left: 0;
  z-index: 40;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: auto;
  margin: 22px calc(-1 * var(--udma-modal-gutter)) 0 !important;
  padding: 14px var(--udma-modal-gutter) max(16px, env(safe-area-inset-bottom, 0px)) !important;
  border-top: 1px solid #d7e1e8;
  border-radius: 0 0 16px 16px;
  background: #fff !important;
  box-shadow: 0 -12px 20px rgba(19, 35, 51, .08);
}

/* The footer must remain opaque even when a modal uses translucent cards. */
body:has(#udma-club-app) .modal > .modal-actions::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  content: "";
}

@media (max-width: 900px) {
  body:has(#udma-club-app) .modal {
    --udma-modal-gutter: 16px;
  }

  body:has(#udma-club-app) .modal > .modal-actions {
    flex-wrap: wrap;
  }

  body:has(#udma-club-app) .modal[data-form="poll"] {
    padding-bottom: max(120px, env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Team linking codes act as one-tap copy controls. */
body:has(#udma-club-app) .team-private-code {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 7px 11px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: copy;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

body:has(#udma-club-app) .team-private-code small {
  display: block;
  line-height: 1.15;
}

body:has(#udma-club-app) .team-private-code b {
  display: block;
  margin-top: 1px;
  color: #18384d;
  font-size: 12px;
  letter-spacing: .07em;
  line-height: 1.2;
}

body:has(#udma-club-app) .team-private-code:hover,
body:has(#udma-club-app) .team-private-code:focus-visible {
  border-color: #0b83c9;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 131, 201, .13);
  outline: none;
}

body:has(#udma-club-app) .team-private-code.is-copied {
  border-color: #26a65b;
  background: #effbf3;
}

/* Required fields in the public account-registration flow. */
body:has(#udma-club-app) #account-register .registration-required {
  margin-left: 3px;
  margin-right: 1px;
  color: #d32626;
  font-size: 1.05em;
  font-weight: 800;
  line-height: 1;
}

/* The registration steps are nested inside the form, so their action bars do
 * not use the direct-child modal footer above. Keep a real lower gutter after
 * the buttons, including when the form needs vertical scrolling. */
body:has(#udma-club-app) #account-register {
  padding-bottom: 22px !important;
  scroll-padding-bottom: 22px;
}

/* Numeric counters use the same compact, neutral badge as the store cart tab.
 * Keep status pills, unread dots, avatars and chart markers out of this rule. */
#udma-club-app :is(
  .admin-form-counter strong,
  .organization-role-count,
  .post-status-heading > span,
  .roster-column h4 > span,
  .member-status-tabs button > span,
  .match-agenda > header > span,
  .privacy-group-title > span,
  .registration-category > header > span,
  .profile-form-count,
  .mailbox-count
) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 24px !important;
  height: 18px !important;
  min-height: 18px !important;
  padding: 0 7px !important;
  border: 1px solid #c8d9e4 !important;
  border-radius: 6px !important;
  background: #f4f8fb !important;
  color: #526f82 !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

#udma-club-app .member-status-tabs button.active > span {
  border-color: #a9cadc !important;
  background: #eaf4f9 !important;
  color: #086fae !important;
}

/* Primary checkout action: sober payment styling, separate from generic blue actions. */
#udma-club-app [data-payment-checkout] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 142px;
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid #244b62;
  border-radius: 9px;
  background: linear-gradient(180deg, #315d73 0%, #244b62 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(24, 63, 84, .16);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

#udma-club-app [data-payment-checkout]::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

#udma-club-app [data-payment-checkout]:hover:not(:disabled) {
  border-color: #173d52;
  background: linear-gradient(180deg, #294f64 0%, #1d4155 100%);
  box-shadow: 0 4px 10px rgba(24, 63, 84, .2);
  transform: translateY(-1px);
}

#udma-club-app [data-payment-checkout]:focus-visible {
  outline: 3px solid rgba(58, 132, 168, .24);
  outline-offset: 2px;
}

#udma-club-app [data-payment-checkout]:disabled {
  border-color: #cbd7de;
  background: #e9eef1;
  color: #7b8e99;
  box-shadow: none;
  cursor: not-allowed;
}

/* Payments list: one restrained visual language for headings, data and actions. */
#udma-club-app .content:has([data-payment-checkout]) .table-wrap {
  padding: 14px !important;
  border: 1px solid #d4e0e7 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 5px 16px rgba(22, 58, 78, .055) !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data {
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data th {
  padding: 7px 13px !important;
  color: #667d8b !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: .045em !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td {
  padding: 14px 13px !important;
  border-top: 1px solid #dbe5ea !important;
  border-bottom: 1px solid #dbe5ea !important;
  background: #fbfcfd !important;
  color: #425d6d !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:first-child {
  padding-left: 57px !important;
  border-left: 1px solid #dbe5ea !important;
  border-radius: 10px 0 0 10px !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:first-child::before {
  width: 32px !important;
  height: 24px !important;
  border: 1px solid #9cafba !important;
  border-radius: 7px !important;
  background: linear-gradient(#aec0ca, #aec0ca) 6px 7px/19px 2px no-repeat,
    linear-gradient(#eaf0f3, #eaf0f3) 6px 14px/10px 2px no-repeat,
    linear-gradient(145deg, #36596c, #274758) !important;
  box-shadow: 0 2px 5px rgba(25, 59, 77, .14) !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:first-child > b {
  color: #243f4f !important;
  font-weight: 650 !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:nth-child(2) {
  color: #607685 !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:nth-child(3) {
  color: #27495b !important;
  font-size: 15px !important;
  font-weight: 650 !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:nth-child(4)::before {
  padding: 5px 8px !important;
  border: 1px solid #cfe3d5 !important;
  border-radius: 6px !important;
  background: #f0f7f2 !important;
  color: #3f7250 !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  letter-spacing: .01em !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:nth-child(4) {
  font-size: 0 !important;
}

/* Checkout summary columns must follow the real icon size to avoid overlap. */
#udma-club-app #store-checkout .store-checkout-summary article {
  grid-template-columns: 56px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 74px;
  padding: 9px 14px !important;
}

#udma-club-app #store-checkout .store-checkout-product-icon {
  box-sizing: border-box;
  width: 54px !important;
  height: 54px !important;
  border-radius: 10px;
}

#udma-club-app #store-checkout .store-checkout-summary article > div:nth-child(2) {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 0;
}

#udma-club-app #store-checkout .store-checkout-summary article > div:nth-child(2) small,
#udma-club-app #store-checkout .store-checkout-summary article > div:nth-child(2) strong,
#udma-club-app #store-checkout .store-checkout-summary article > div:nth-child(2) span {
  display: block;
  position: static;
  margin: 0;
}

#udma-club-app #store-checkout .store-checkout-summary article > div:nth-child(2) strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#udma-club-app #store-checkout .store-checkout-product-price {
  align-self: center;
  justify-self: end;
  padding-left: 10px;
}

#udma-club-app #store-checkout .store-checkout-summary article.store-checkout-summary-payment {
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-height: 66px;
  padding: 11px 16px !important;
}

#udma-club-app #store-checkout .store-checkout-summary-payment > div:first-child {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  row-gap: 7px;
  min-width: 0;
}

#udma-club-app #store-checkout .store-checkout-summary-payment > div:first-child small,
#udma-club-app #store-checkout .store-checkout-summary-payment > div:first-child strong {
  display: block;
  position: static;
  margin: 0;
}

#udma-club-app #store-checkout .store-checkout-summary-payment > div:first-child small {
  min-height: 12px;
  color: #718797;
  font-size: 10px;
  line-height: 1.2;
}

#udma-club-app #store-checkout .store-checkout-summary-payment > div:first-child strong {
  color: #17364e;
  font-size: 15px;
  line-height: 1.3;
}

#udma-club-app #store-checkout .store-checkout-summary-payment > .store-checkout-payment-copy {
  display: flex !important;
  align-items: baseline !important;
  gap: 12px !important;
  overflow: visible !important;
}

#udma-club-app #store-checkout .store-checkout-summary-payment > .store-checkout-payment-copy > strong {
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: max-content !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

#udma-club-app #store-checkout .store-checkout-summary article:not(.store-checkout-summary-payment) > div:nth-child(2) {
  box-sizing: border-box;
  padding-left: 14px !important;
}

#udma-club-app #store-checkout .store-checkout-summary-payment > .store-checkout-product-price {
  display: grid;
  align-content: center;
  justify-items: end;
  grid-column: auto;
  padding-left: 18px;
}

#udma-club-app #store-checkout .store-checkout-summary article.store-checkout-summary-payment {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  column-gap: 16px !important;
}

#udma-club-app #store-checkout .store-checkout-payment-label {
  display: block !important;
  color: #718797 !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

#udma-club-app #store-checkout .store-checkout-payment-name {
  display: block !important;
  min-width: 0 !important;
  overflow: visible !important;
  color: #17364e !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  text-overflow: clip !important;
  white-space: normal !important;
}

#udma-club-app #store-checkout .store-checkout-payment-price {
  display: block !important;
  overflow: visible !important;
  color: #075f98 !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

#udma-club-app #store-checkout .store-checkout-summary article.store-checkout-summary-product {
  grid-template-columns: 56px minmax(0, 1fr) auto !important;
  column-gap: 18px !important;
}

#udma-club-app #store-checkout .store-checkout-summary-product > .store-checkout-summary-copy {
  padding-left: 0 !important;
}

#udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:last-child {
  border-right: 1px solid #dbe5ea !important;
  border-radius: 0 10px 10px 0 !important;
}

#udma-club-app .payment-row-actions {
  gap: 9px;
}

#udma-club-app .payment-delete-button {
  min-height: 38px;
  padding: 9px 12px !important;
  border: 1px solid #e2caca !important;
  border-radius: 9px !important;
  background: #fffafa !important;
  color: #a44747 !important;
  font-size: 12px !important;
  font-weight: 550 !important;
}

#udma-club-app .payment-delete-button:hover,
#udma-club-app .payment-delete-button:focus-visible {
  border-color: #d8abab !important;
  background: #fff3f3 !important;
  color: #8e3434 !important;
}

@media (max-width: 650px) {
  #udma-club-app .content:has([data-payment-checkout]) .table-wrap {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) {
    padding: 17px 15px 15px 65px !important;
    border-color: #dbe5ea !important;
    background: #fff !important;
    box-shadow: 0 4px 13px rgba(22, 58, 78, .055) !important;
  }

  #udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  #udma-club-app .content:has([data-payment-checkout]) .data tr:not(:first-child) td:first-child {
    padding: 0 !important;
    border: 0 !important;
  }

  #udma-club-app .payment-row-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #udma-club-app .payment-delete-button {
    width: auto !important;
  }

  #udma-club-app #store-checkout .store-checkout-summary article {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 11px !important;
    min-height: 68px;
    padding: 9px 11px !important;
  }

  #udma-club-app #store-checkout .store-checkout-product-icon {
    width: 46px !important;
    height: 46px !important;
  }

  #udma-club-app #store-checkout .store-checkout-product-price {
    grid-column: 2;
    justify-self: start;
    padding-left: 0;
  }

  #udma-club-app #store-checkout .store-checkout-summary article.store-checkout-summary-payment {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 62px;
    padding: 10px 12px !important;
  }

  #udma-club-app #store-checkout .store-checkout-summary-payment > .store-checkout-product-price {
    grid-column: auto;
    justify-self: end;
    padding-left: 10px;
  }

  #udma-club-app #store-checkout .store-checkout-summary article.store-checkout-summary-payment {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto;
    column-gap: 12px !important;
    row-gap: 4px !important;
  }

  #udma-club-app #store-checkout .store-checkout-summary-payment > .store-checkout-payment-label {
    grid-column: 1;
    grid-row: 1;
  }

  #udma-club-app #store-checkout .store-checkout-summary-payment > .store-checkout-payment-name {
    grid-column: 1;
    grid-row: 2;
  }

  #udma-club-app #store-checkout .store-checkout-summary-payment > .store-checkout-payment-price {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  #udma-club-app #store-checkout .store-checkout-summary article.store-checkout-summary-product {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    column-gap: 14px !important;
  }

  #udma-club-app #store-checkout .store-checkout-summary article:not(.store-checkout-summary-payment) > div:nth-child(2) {
    padding-left: 11px !important;
  }
}

body:has(#udma-club-app) #account-register .modal-actions {
  margin-bottom: 0 !important;
  padding-bottom: 2px !important;
  border-radius: 0;
  box-shadow: none;
}

body:has(#udma-club-app) #account-register .registration-password-step {
  margin-bottom: 4px;
}

@media (max-width: 650px) {
  body:has(#udma-club-app) #account-register {
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
  }
}

.linking-codes-modal { max-width: 560px !important; }
.linking-codes-icon { display:grid;place-items:center;width:46px;height:46px;margin-bottom:14px;border-radius:13px;background:#e4f6ec;color:#158348;font-size:26px;font-weight:800; }
.linking-code-download-options { display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:22px 0 4px; }
.linking-download-option { display:flex;flex-direction:column;gap:6px;min-height:110px;padding:18px;border:1px solid #c5d9e5;border-radius:13px;background:#f7fbfd;color:#12364b;text-align:left;cursor:pointer;transition:.18s ease; }
.linking-download-option:hover,.linking-download-option:focus-visible { border-color:#0984c6;background:#ebf7fd;box-shadow:0 0 0 3px rgba(9,132,198,.12);outline:0; }
.linking-download-option b { font-size:17px; }
.linking-download-option span { color:#5d7483;font-size:13px;line-height:1.45; }
@media(max-width:600px){.linking-code-download-options{grid-template-columns:1fr}.linking-download-option{min-height:86px}}

/* Cabeceras informativas compactas situadas inmediatamente bajo el título. */
body:has(#udma-club-app) :is(.training-list-intro,.mailbox-intro,.sponsor-intro,.coach-admin-intro,.downloads-admin-intro,.store-orders-intro,.match-reports-intro) {
  box-sizing: border-box;
  min-height: 0;
  margin-bottom: 12px;
  padding: 12px 16px;
  gap: 14px;
}

body:has(#udma-club-app) :is(.training-list-intro,.mailbox-intro,.sponsor-intro,.coach-admin-intro,.downloads-admin-intro,.store-orders-intro,.match-reports-intro) h3 {
  margin-top: 2px;
  margin-bottom: 3px;
  font-size: 17px;
  line-height: 1.25;
}

body:has(#udma-club-app) :is(.training-list-intro,.mailbox-intro,.sponsor-intro,.coach-admin-intro,.downloads-admin-intro,.store-orders-intro,.match-reports-intro) p {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.35;
}

@media (max-width: 650px) {
  body:has(#udma-club-app) :is(.training-list-intro,.mailbox-intro,.sponsor-intro,.coach-admin-intro,.downloads-admin-intro,.store-orders-intro,.match-reports-intro) {
    padding: 11px 13px;
    gap: 8px;
  }
}
