:root {
    --ink: #242128;
    --muted: #6f7480;
    --line: #e6e8ee;
    --paper: #ffffff;
    --soft: #f5f7fb;
    --accent: #ffe700;
    --blue: #2563eb;
    --green: #11976d;
    --rose: #d64f62;
    --shadow: 0 18px 50px rgba(31, 35, 48, 0.12);
}


/* =====================================================================
   Portal Familias · centro de notificaciones
   ===================================================================== */

.notification-trigger {
    position: relative;
}

.notification-trigger.has-notifications {
    color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #242128;
    border-radius: 999px;
    color: #242128;
    background: var(--accent);
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
}

.notification-centre {
    display: grid;
    gap: 14px;
}

.notification-centre-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.notification-centre-head > div {
    display: grid;
    gap: 3px;
}

.notification-centre-head span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notification-centre-head strong {
    color: var(--ink);
    font-size: 16px;
}

.notification-mark-all {
    padding: 0;
    border: 0;
    color: var(--blue);
    background: transparent;
    font-size: 11px;
    font-weight: 900;
}

.notification-mark-all:disabled {
    color: var(--muted);
    opacity: 0.55;
}

.notification-list {
    display: grid;
    gap: 8px;
    max-height: min(52vh, 430px);
    overflow-y: auto;
    padding-right: 3px;
}

.notification-row {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 10px;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: var(--soft);
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.notification-row:hover,
.notification-row:focus-visible {
    border-color: rgba(255, 231, 0, 0.4);
    background: rgba(255, 231, 0, 0.1);
    transform: translateY(-1px);
}

.notification-row.is-unread {
    border-color: rgba(255, 231, 0, 0.35);
    background: rgba(255, 231, 0, 0.09);
}

.notification-row-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #242128;
    background: var(--accent);
    font-size: 13px;
}

.notification-row-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.notification-row-copy strong,
.notification-row-copy small,
.notification-row-copy time {
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-row-copy strong {
    color: var(--ink);
    font-size: 12px;
    white-space: nowrap;
}

.notification-row-copy small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.notification-row-copy time {
    color: var(--muted);
    font-size: 10px;
}

.notification-row-action {
    color: var(--accent-strong, #d7a800);
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.notification-unread-dot {
    color: var(--accent);
    font-size: 8px;
}

.notification-row-arrow {
    color: var(--muted);
    font-size: 10px;
}

.notification-empty {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 30px 18px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    text-align: center;
}

.notification-empty > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--muted);
    background: var(--soft);
}

.notification-empty strong {
    color: var(--ink);
    font-size: 13px;
}

.notification-empty p {
    max-width: 320px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.notification-push-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 231, 0, 0.26);
    border-radius: 14px;
    background: rgba(255, 231, 0, 0.08);
}

.notification-push-card > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #242128;
    background: var(--accent);
}

.notification-push-card > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.notification-push-card strong {
    color: var(--ink);
    font-size: 12px;
}

.notification-push-card small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

html.portal-theme-light .notification-badge {
    border-color: #fff;
}

@media (max-width: 560px) {
    .notification-push-card {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .notification-push-card .primary-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #eef2f7;
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
h3,
.topbar-brand strong {
    font-family: Outfit, Inter, system-ui, sans-serif;
}

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

button {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.hidden {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

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

.auth-brand {
    min-height: 100vh;
    padding: 72px clamp(28px, 7vw, 96px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(36, 33, 40, 0.96), rgba(36, 33, 40, 0.78)),
        url("../img/logo.png") center / 360px auto no-repeat,
        #242128;
}

.brand-mark {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    margin-bottom: 30px;
}

.brand-mark img,
.topbar-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-brand .eyebrow {
    color: var(--accent);
}

.auth-brand h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 0.96;
    letter-spacing: 0;
}

.brand-copy {
    max-width: 560px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
    line-height: 1.7;
}

.brand-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.brand-points span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    font-size: 13px;
}

.auth-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    background: var(--paper);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 22px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
}

.auth-tabs button {
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    font-weight: 800;
}

.auth-tabs button.active {
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 6px 18px rgba(31, 35, 48, 0.08);
}

.auth-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    padding: 0 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    min-height: 112px;
    padding: 12px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.primary-btn,
.ghost-btn,
.icon-btn {
    border: 0;
    border-radius: 10px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-weight: 900;
}

.primary-btn {
    margin-top: 4px;
    color: var(--ink);
    background: var(--accent);
    box-shadow: 0 10px 22px rgba(255, 231, 0, 0.16);
    transition: transform 0.18s, filter 0.18s, box-shadow 0.18s;
}

.primary-btn:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn.compact {
    min-height: 40px;
    margin-top: 0;
    padding: 0 14px;
    font-size: 13px;
}

.ghost-btn {
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    transition: background 0.18s, transform 0.18s, border-color 0.18s;
}

.ghost-btn:hover {
    background: #f8fafc;
    border-color: #d6dae4;
    transform: translateY(-1px);
}

.ghost-btn.danger {
    color: #b42318;
    background: rgba(255, 255, 255, 0.92);
}

.icon-btn {
    width: 44px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.app-shell {
    min-height: 100vh;
    background: var(--soft);
}

.athlete-header,
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.portal-main {
    min-width: 0;
    padding: 24px clamp(18px, 4vw, 44px) 42px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.athlete-header {
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 12px 34px rgba(31, 35, 48, 0.08);
}

.athlete-header h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 42px);
    letter-spacing: 0;
}

.athlete-profile {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.profile-photo {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #242128;
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-copy {
    min-width: 0;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.profile-badges span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #f8fafc;
    color: #4b5563;
    font-size: 12px;
    font-weight: 800;
}

.athlete-switcher {
    display: grid;
    grid-template-columns: minmax(190px, 280px) minmax(150px, 190px);
    gap: 12px;
    align-items: end;
}

.athlete-switcher label span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.mini-ledger {
    min-height: 70px;
    border-radius: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    background: #f8fafc;
}

.mini-ledger.pending {
    border-color: rgba(214, 79, 98, 0.24);
    background: rgba(214, 79, 98, 0.08);
}

.mini-ledger.clear {
    border-color: rgba(17, 151, 109, 0.22);
    background: rgba(17, 151, 109, 0.08);
}

.mini-ledger span,
.mini-ledger strong {
    display: block;
}

.mini-ledger span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.mini-ledger strong {
    margin-top: 7px;
    font-size: 18px;
}

.athlete-select {
    max-width: 280px;
}

.portal-section {
    display: grid;
    gap: 16px;
}

.section-action-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(31, 35, 48, 0.06);
}

.section-action-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--ink);
    background: rgba(255, 231, 0, 0.22);
    border: 1px solid rgba(255, 231, 0, 0.38);
}

.section-action-copy h3 {
    margin: 0;
    font-size: 19px;
}

.section-action-copy p {
    max-width: 680px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

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

.form-columns {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

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

.metric-card,
.panel-card,
.empty-state {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(31, 35, 48, 0.07);
}

.metric-card {
    min-height: 118px;
    padding: 18px;
}

.metric-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    font-size: 28px;
}

.metric-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.panel-card {
    padding: 18px;
}

.erp-panel {
    overflow: hidden;
    padding: 0;
}

.erp-panel > .card-head {
    min-height: 64px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.erp-panel > .history-list,
.erp-panel > .payment-empty,
.erp-panel > .payable-list {
    margin: 0;
    padding: 14px 18px 18px;
}

.panel-card h3 {
    margin: 0;
    font-size: 17px;
}

.panel-note {
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.payment-empty {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 12px 0 16px;
    padding: 14px;
    border: 1px solid rgba(17, 151, 109, 0.16);
    border-radius: 12px;
    background: rgba(17, 151, 109, 0.08);
    color: var(--green);
}

.payment-empty i {
    margin-top: 2px;
}

.payment-empty strong,
.payment-empty span {
    display: block;
}

.payment-empty span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.portal-form {
    display: grid;
    gap: 12px;
}

.single-panel-grid {
    display: grid;
    grid-template-columns: 1fr;
}

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

.payable-card {
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.payable-card:hover {
    border-color: rgba(255, 231, 0, 0.65);
    background: rgba(255, 231, 0, 0.07);
    box-shadow: 0 10px 22px rgba(31, 35, 48, 0.07);
    transform: translateY(-1px);
}

.payable-card:active {
    transform: scale(0.99);
}

.payable-card strong,
.payable-card small,
.payable-card em {
    display: block;
}

.payable-card strong {
    font-size: 14px;
}

.payable-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.payable-card em {
    color: var(--green);
    font-size: 14px;
    font-style: normal;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.history-list {
    display: grid;
    gap: 9px;
    margin-top: 14px;
}

.history-row {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.history-row:first-child {
    border-top: 0;
}

.history-row strong,
.history-row span,
.history-row small {
    display: block;
}

.history-row strong {
    font-size: 13px;
}

.history-row span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.status-pill {
    min-width: 92px;
    padding: 7px 9px;
    border-radius: 999px;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    background: #edf0f6;
    color: var(--muted);
}

.status-pill.pendiente,
.status-pill.abierto {
    background: rgba(255, 231, 0, 0.28);
    color: #695f00;
}

.status-pill.aprobado,
.status-pill.aprobada,
.status-pill.validado,
.status-pill.respondido,
.status-pill.pagada {
    background: rgba(17, 151, 109, 0.12);
    color: var(--green);
}

.status-pill.rechazado,
.status-pill.rechazada {
    background: rgba(214, 79, 98, 0.12);
    color: var(--rose);
}

.empty-state {
    min-height: 420px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 40px;
}

.empty-state i {
    font-size: 42px;
    color: var(--blue);
}

.empty-state h2 {
    margin: 16px 0 8px;
}

.empty-state p,
.empty-line {
    color: var(--muted);
    line-height: 1.5;
}

.invoice-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.text-link,
.icon-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: #edf0f6;
    color: var(--ink);
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    transition: background 0.18s, transform 0.18s;
}

.text-link:hover,
.icon-action:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.icon-action:active {
    transform: scale(0.98);
}

.icon-action i {
    font-size: 11px;
}

.icon-action:disabled {
    transform: none;
}

.portal-modal {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    place-items: center;
    padding: 22px;
}

.portal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(36, 33, 40, 0.62);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.portal-modal-card {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 28px 70px rgba(31, 35, 48, 0.32);
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.portal-modal.show .portal-modal-backdrop {
    opacity: 1;
}

.portal-modal.show .portal-modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.portal-modal-head {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.portal-modal-head p {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-modal-head h2 {
    margin: 0;
    font-size: 21px;
}

.modal-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: #eef2f7;
    transition: background 0.18s, color 0.18s, transform 0.18s;
}

.modal-close:hover {
    color: var(--rose);
    background: #fff1f3;
    transform: translateY(-1px);
}

.portal-modal-body {
    overflow-y: auto;
    padding: 20px;
}

.modal-form {
    gap: 14px;
}

.modal-summary-card {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #f8fafc;
}

.modal-summary-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.modal-summary-card strong {
    color: var(--ink);
    font-size: 18px;
}

.modal-summary-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.modal-actions .ghost-btn,
.modal-actions .primary-btn {
    min-width: 132px;
}

.profile-form {
    padding: 18px;
}

.profile-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.07);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.profile-note i {
    margin-top: 2px;
}

.inline-actions {
    padding-top: 16px;
}

.portal-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    max-width: min(420px, calc(100vw - 40px));
    padding: 14px 16px;
    border-radius: 12px;
    color: #fff;
    background: #242128;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    font-weight: 800;
    font-size: 13px;
}

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

.portal-toast.error {
    background: var(--rose);
}

.portal-toast.success {
    background: var(--green);
}

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

    .auth-brand {
        min-height: auto;
        padding: 40px 24px;
    }

    .auth-panel {
        min-height: auto;
        padding: 24px;
    }

    .summary-grid,
    .form-columns {
        grid-template-columns: 1fr;
    }

    .invoice-kpis {
        grid-template-columns: 1fr;
    }

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

    .section-action-head .primary-btn {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .ghost-btn {
        flex: 1;
    }

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

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

    .athlete-profile {
        align-items: flex-start;
    }

    .profile-photo {
        width: 72px;
        height: 72px;
        font-size: 22px;
    }

    .athlete-switcher {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .athlete-select {
        max-width: none;
    }

    .history-row,
    .invoice-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-modal {
        align-items: end;
        padding: 0;
    }

    .portal-modal-card {
        width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
    }

    .portal-modal-body {
        padding: 16px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .ghost-btn,
    .modal-actions .primary-btn {
        width: 100%;
    }

    .section-action-copy {
        align-items: flex-start;
    }

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

/* Portal Familias · accesos compartidos */

.access-section-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    align-items: stretch;
    gap: 22px;
    padding: 4px 2px 0;
}

.access-section-intro > div:first-child {
    min-width: 0;
}

.access-section-intro h2 {
    margin: 9px 0 7px;
    color: var(--ink);
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.access-section-intro p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.access-trust-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 90px;
    padding: 16px;
    border: 1px solid rgba(17, 151, 109, 0.22);
    border-radius: 16px;
    color: var(--green);
    background: rgba(17, 151, 109, 0.08);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
}

.access-trust-card i {
    flex: 0 0 auto;
    font-size: 19px;
}

.access-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 14px;
}

.access-request-card,
.access-history-card {
    min-width: 0;
    overflow: hidden;
    padding: 0;
}

.access-request-card > .card-head,
.access-history-card > .card-head {
    min-height: 76px;
    align-items: flex-start;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(128, 143, 160, 0.05);
}

.access-request-card > .card-head > div,
.access-history-card > .card-head > div {
    min-width: 0;
}

.access-request-card .card-head h3,
.access-history-card .card-head h3 {
    margin: 0;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 19px;
    letter-spacing: -0.03em;
}

.access-request-card .card-head .panel-note,
.access-history-card .card-head .panel-note {
    margin: 5px 0 0;
    font-size: 11px;
}

.access-request-card .card-head > i,
.access-history-card .card-head > i {
    color: var(--accent);
}

.access-request-form {
    padding: 18px 20px 20px;
}

.access-request-form label {
    display: grid;
    gap: 6px;
}

.access-request-form label > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.access-request-form label > span small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.access-form-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.access-form-note i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--blue);
}

.access-request-form .primary-btn {
    width: 100%;
}

.access-count {
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #695f00;
    background: rgba(255, 231, 0, 0.24);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.access-request-list {
    display: grid;
    padding: 10px 20px 16px;
}

.access-request-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.access-request-row:last-child {
    border-bottom: 0;
}

.access-request-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.1);
    font-size: 13px;
}

.access-request-copy {
    min-width: 0;
}

.access-request-copy strong,
.access-request-copy small,
.access-request-copy p {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.access-request-copy strong {
    color: var(--ink);
    font-size: 12px;
    white-space: nowrap;
}

.access-request-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.access-request-copy p {
    margin: 4px 0 0;
    color: var(--rose);
    font-size: 10px;
    line-height: 1.35;
    white-space: normal;
}

.access-request-row .status-pill {
    min-width: 78px;
    padding: 6px 8px;
    font-size: 10px;
}

.access-empty-inline,
.access-empty-state {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.access-empty-inline {
    min-height: 96px;
    justify-content: center;
}

.access-empty-inline i {
    color: var(--blue);
}

.access-athlete-section {
    display: grid;
    gap: 14px;
}

.access-list-head {
    margin: 0;
}

.access-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.access-total-badge i {
    color: var(--green);
}

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

.access-athlete-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 12px 30px rgba(31, 35, 48, 0.07);
}

.access-athlete-head {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 17px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(128, 143, 160, 0.05);
}

.access-athlete-head > div {
    min-width: 0;
}

.access-athlete-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    color: var(--ink);
    background: rgba(255, 231, 0, 0.2);
}

.access-eyebrow {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.access-athlete-head h3 {
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 18px;
    letter-spacing: -0.03em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-athlete-head small {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-tutor-list {
    display: grid;
    padding: 8px 18px 13px;
}

.access-tutor-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.access-tutor-row:last-child {
    border-bottom: 0;
}

.access-tutor-row.is-current {
    margin: 0 -9px;
    padding-right: 9px;
    padding-left: 9px;
    border-radius: 10px;
    background: rgba(255, 231, 0, 0.08);
}

.access-tutor-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--muted);
    background: var(--soft);
    font-size: 12px;
}

.access-tutor-row.is-current .access-tutor-avatar {
    color: #695f00;
    background: rgba(255, 231, 0, 0.25);
}

.access-tutor-copy {
    min-width: 0;
}

.access-tutor-copy strong,
.access-tutor-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-tutor-copy strong {
    color: var(--ink);
    font-size: 12px;
}

.access-tutor-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.access-tutor-state {
    color: var(--green);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.access-empty-state {
    min-height: 138px;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 22px;
}

.access-empty-state > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.1);
    font-size: 17px;
}

.access-empty-state strong {
    color: var(--ink);
    font-size: 13px;
}

.access-empty-state p {
    max-width: 320px;
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

html.portal-theme-dark .access-count {
    border: 1px solid rgba(255, 231, 0, 0.32);
    color: var(--accent);
    background: rgba(255, 231, 0, 0.14);
}

@media (max-width: 820px) {
    .access-section-intro,
    .access-layout {
        grid-template-columns: 1fr;
    }

    .access-athlete-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .access-request-card > .card-head,
    .access-history-card > .card-head,
    .access-request-form,
    .access-request-list {
        padding-right: 16px;
        padding-left: 16px;
    }

    .access-request-row {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .access-request-row .status-pill {
        grid-column: 2;
        justify-self: start;
    }

    .access-tutor-row {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .access-tutor-state {
        grid-column: 2;
        justify-self: start;
    }

    .access-list-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =====================================================================
   Portal Familias · capa visual compartida con el ERP
   ===================================================================== */

:root {
    color-scheme: light;
}

html.portal-theme-dark {
    color-scheme: dark;
}

html.portal-theme-dark body.portal-page {
    --ink: #ffffff;
    --muted: #b2b5bc;
    --line: rgba(255, 255, 255, 0.1);
    --paper: #2f2b34;
    --soft: #1c1a20;
    --accent: #ffe700;
    --blue: #ffe700;
    --green: #b2d58f;
    --rose: #f08b8b;
}

html.portal-theme-light body.portal-page {
    --ink: #242128;
    --muted: #6f7480;
    --line: #e6e8ee;
    --paper: #ffffff;
    --soft: #f5f7fb;
    --accent: #ffe700;
    --blue: #d8bd00;
    --green: #11976d;
    --rose: #d64f62;
}

.portal-page {
    min-width: 320px;
    background: var(--soft);
    color: var(--ink);
}

.portal-page button,
.portal-page a,
.portal-page input,
.portal-page select,
.portal-page textarea {
    -webkit-tap-highlight-color: transparent;
}

.portal-page button:focus-visible,
.portal-page a:focus-visible,
.portal-page input:focus-visible,
.portal-page select:focus-visible,
.portal-page textarea:focus-visible {
    outline: 3px solid rgba(255, 231, 0, 0.42);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 14px;
    z-index: 220;
    padding: 9px 12px;
    border-radius: 9px;
    color: #242128;
    background: var(--accent);
    font-size: 12px;
    font-weight: 900;
    transform: translateY(-150%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.auth-panel {
    align-items: stretch;
}

.auth-panel > .auth-tabs,
.auth-panel > .auth-form,
.auth-panel > .install-btn {
    width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.remember-row input {
    width: 16px;
    min-height: 16px;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    accent-color: var(--accent);
}

.install-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 14px;
    padding: 0 14px;
    border: 1px solid rgba(255, 231, 0, 0.35);
    border-radius: 10px;
    color: var(--ink);
    background: rgba(255, 231, 0, 0.11);
    font-size: 12px;
    font-weight: 900;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.install-btn:hover {
    border-color: var(--accent);
    background: rgba(255, 231, 0, 0.2);
    transform: translateY(-1px);
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 72px;
    color: #fff;
    background: #242128;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 12px 30px rgba(18, 16, 21, 0.14);
}

.portal-topbar-inner {
    width: 100%;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 clamp(16px, 3vw, 34px);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: #fff;
    text-decoration: none;
}

.topbar-brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
}

.topbar-brand-mark img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.topbar-brand-copy,
.topbar-user-copy {
    display: grid;
    gap: 2px;
}

.topbar-brand-copy strong {
    color: #fff;
    font-family: Outfit, Inter, sans-serif;
    font-size: 15px;
    line-height: 1;
}

.topbar-brand-copy small,
.topbar-user-copy small {
    color: rgba(255, 255, 255, 0.54);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-page-context {
    display: grid;
    gap: 2px;
    min-width: 0;
    margin-left: 14px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-page-context span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.topbar-page-context strong {
    color: #fff;
    font-family: Outfit, Inter, sans-serif;
    font-size: 17px;
    line-height: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-icon,
.topbar-action {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 800;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.topbar-icon {
    width: 38px;
}

.topbar-action {
    padding: 0 12px;
}

.topbar-icon:hover,
.topbar-action:hover {
    border-color: rgba(255, 231, 0, 0.48);
    color: var(--accent);
    background: rgba(255, 231, 0, 0.11);
    transform: translateY(-1px);
}

.topbar-logout:hover {
    color: #ff9e9e;
    border-color: rgba(240, 139, 139, 0.45);
    background: rgba(240, 139, 139, 0.1);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 0 4px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: #242128;
    background: var(--accent);
    font-size: 11px;
    font-weight: 900;
}

.topbar-user-copy strong {
    display: block;
    max-width: 160px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
}

.portal-layout {
    min-height: calc(100vh - 72px);
}

.portal-main {
    padding-top: 30px;
}

html.portal-theme-dark .auth-panel,
html.portal-theme-dark .athlete-header,
html.portal-theme-dark .section-action-head,
html.portal-theme-dark .metric-card,
html.portal-theme-dark .panel-card,
html.portal-theme-dark .empty-state,
html.portal-theme-dark .payable-card,
html.portal-theme-dark .modal-card,
html.portal-theme-dark .portal-modal-card {
    background: var(--paper);
    border-color: var(--line);
}

html.portal-theme-dark input,
html.portal-theme-dark select,
html.portal-theme-dark textarea {
    border-color: var(--line);
    background: #242128;
    color: #fff;
}

html.portal-theme-dark input::placeholder,
html.portal-theme-dark textarea::placeholder {
    color: #8f939d;
}

html.portal-theme-dark .auth-tabs,
html.portal-theme-dark .auth-tabs button.active,
html.portal-theme-dark .profile-badges span,
html.portal-theme-dark .mini-ledger,
html.portal-theme-dark .erp-panel > .card-head,
html.portal-theme-dark .modal-summary-card,
html.portal-theme-dark .portal-modal-head,
html.portal-theme-dark .icon-action,
html.portal-theme-dark .text-link,
html.portal-theme-dark .ghost-btn,
html.portal-theme-dark .icon-btn {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
}

html.portal-theme-dark .auth-tabs button.active {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

html.portal-theme-dark .form-note,
html.portal-theme-dark .profile-badges span,
html.portal-theme-dark .mini-ledger span,
html.portal-theme-dark .metric-card span,
html.portal-theme-dark .metric-card small,
html.portal-theme-dark .panel-note,
html.portal-theme-dark .section-action-copy p,
html.portal-theme-dark .history-row span,
html.portal-theme-dark .history-row small,
html.portal-theme-dark .modal-summary-card small,
html.portal-theme-dark .empty-state p,
html.portal-theme-dark .empty-line,
html.portal-theme-dark .payment-empty span {
    color: var(--muted);
}

html.portal-theme-dark .profile-badges span {
    color: #d7d8dd;
}

html.portal-theme-dark .section-icon {
    color: var(--accent);
}

html.portal-theme-dark .payment-empty {
    color: var(--green);
    border-color: rgba(178, 213, 143, 0.22);
    background: rgba(178, 213, 143, 0.08);
}

html.portal-theme-dark .empty-state i {
    color: var(--accent);
}

html.portal-theme-dark .status-pill {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

html.portal-theme-dark .status-pill.pendiente,
html.portal-theme-dark .status-pill.abierto {
    color: var(--accent);
    background: rgba(255, 231, 0, 0.15);
}

html.portal-theme-dark .status-pill.aprobado,
html.portal-theme-dark .status-pill.aprobada,
html.portal-theme-dark .status-pill.validado,
html.portal-theme-dark .status-pill.respondido,
html.portal-theme-dark .status-pill.pagada {
    color: var(--green);
    background: rgba(178, 213, 143, 0.12);
}

html.portal-theme-dark .status-pill.rechazado,
html.portal-theme-dark .status-pill.rechazada {
    color: var(--rose);
    background: rgba(240, 139, 139, 0.12);
}

.install-instructions {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding: 4px;
}

.install-instructions h3,
.install-instructions p {
    margin: 0;
}

.install-instructions h3 {
    font-size: 20px;
}

.install-instructions p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 980px) {
    .portal-topbar-inner {
        gap: 10px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .portal-main {
        max-width: none;
    }
}

@media (max-width: 620px) {
    .portal-topbar-inner {
        min-height: 64px;
        padding: 0 12px;
    }

    .portal-topbar {
        min-height: 64px;
    }

    .topbar-brand-copy,
    .topbar-page-context,
    .topbar-user-copy,
    .install-action span {
        display: none;
    }

    .topbar-user {
        margin-left: 0;
        padding-left: 5px;
        border-left: 0;
    }

    .portal-page .portal-main {
        padding: 20px 14px 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-page *,
    .portal-page *::before,
    .portal-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* =====================================================================
   Portal Familias · resumen familiar
   ===================================================================== */

.family-summary-head {
    align-items: center;
}

.family-summary-caption {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.family-summary-caption strong {
    color: var(--ink);
    font-size: 18px;
}

.family-summary-grid .metric-card {
    min-height: 126px;
}

.family-summary-grid .metric-money {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(19px, 2.2vw, 27px);
}

.family-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 14px;
}

.family-overview-panel,
.family-activity-panel {
    min-width: 0;
}

.family-overview-panel .card-head,
.family-activity-panel .card-head {
    align-items: flex-start;
}

.family-overview-panel .card-head > div,
.family-activity-panel .card-head > div {
    min-width: 0;
}

.family-overview-panel .panel-note,
.family-activity-panel .panel-note {
    margin: 5px 0 0;
}

.family-overview-panel .card-head > i,
.family-activity-panel .card-head > i {
    flex: 0 0 auto;
    color: var(--accent);
}

.family-alert-list,
.family-athlete-list,
.family-activity-list {
    display: grid;
    margin-top: 14px;
}

.family-alert-row,
.family-athlete-row {
    width: 100%;
    min-width: 0;
    display: grid;
    align-items: center;
    gap: 10px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    text-align: left;
}

.family-alert-row {
    grid-template-columns: 34px minmax(0, 1fr) 14px;
    min-height: 66px;
    padding: 10px 0;
}

.family-alert-row:first-child,
.family-athlete-row:first-child,
.family-activity-row:first-child {
    border-top: 0;
}

.family-alert-row:not(div),
.family-athlete-row {
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.family-alert-row:not(div):hover,
.family-athlete-row:hover {
    background: rgba(255, 231, 0, 0.07);
}

.family-alert-icon,
.family-activity-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #6f6500;
    background: rgba(255, 231, 0, 0.2);
}

.family-alert-copy,
.family-athlete-copy,
.family-activity-copy {
    min-width: 0;
}

.family-alert-copy strong,
.family-alert-copy small,
.family-athlete-copy strong,
.family-athlete-copy small,
.family-athlete-balance strong,
.family-athlete-balance small,
.family-activity-copy strong,
.family-activity-copy small {
    display: block;
}

.family-alert-copy strong,
.family-athlete-copy strong,
.family-activity-copy strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.family-alert-copy small,
.family-athlete-copy small,
.family-athlete-balance small,
.family-activity-copy small {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.family-row-arrow {
    color: var(--muted);
    font-size: 11px;
}

.family-athlete-row {
    grid-template-columns: 38px minmax(0, 1fr) auto 14px;
    min-height: 67px;
    padding: 10px 0;
}

.family-athlete-row .avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--soft);
    color: var(--ink);
    font-size: 11px;
}

.family-athlete-balance {
    max-width: 155px;
    text-align: right;
}

.family-athlete-balance strong {
    overflow-wrap: anywhere;
    color: var(--green);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.family-athlete-balance.pending strong {
    color: var(--rose);
}

.family-activity-panel {
    padding-bottom: 14px;
}

.family-activity-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.family-activity-icon {
    color: var(--ink);
    background: rgba(178, 181, 188, 0.16);
}

.family-activity-icon.payment,
.family-activity-icon.invoice {
    color: #6f6500;
    background: rgba(255, 231, 0, 0.2);
}

.family-activity-icon.document {
    color: var(--blue);
}

.family-activity-icon.absence {
    color: var(--rose);
    background: rgba(240, 139, 139, 0.13);
}

.family-activity-icon.message {
    color: var(--green);
    background: rgba(178, 213, 143, 0.13);
}

.family-overview-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    color: var(--green);
    font-size: 13px;
}

.family-overview-empty strong,
.family-overview-empty span {
    display: block;
}

.family-overview-empty span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.selected-athlete-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 2px 0;
    border-top: 1px solid var(--line);
}

.selected-athlete-heading .eyebrow {
    display: block;
    margin-bottom: 4px;
}

.selected-athlete-heading h3 {
    margin: 0;
    font-size: 21px;
}

.selected-athlete-heading > span {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

@media (max-width: 820px) {
    .family-overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .family-summary-head {
        align-items: flex-start;
    }

    .family-summary-caption {
        padding-left: 52px;
    }

    .family-athlete-row {
        grid-template-columns: 38px minmax(0, 1fr) 14px;
    }

    .family-athlete-balance {
        grid-column: 2 / 3;
        max-width: none;
        text-align: left;
    }

    .family-athlete-row .family-row-arrow {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .family-activity-row {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .family-activity-row .status-pill {
        grid-column: 2;
        justify-self: start;
    }

    .selected-athlete-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .selected-athlete-heading > span {
        text-align: left;
    }
}

html.portal-theme-dark .family-alert-row:not(div):hover,
html.portal-theme-dark .family-athlete-row:hover {
    background: rgba(255, 231, 0, 0.12);
}

html.portal-theme-dark .family-alert-icon,
html.portal-theme-dark .family-activity-icon.payment,
html.portal-theme-dark .family-activity-icon.invoice {
    color: var(--accent);
}

/* =====================================================================
   Portal Familias · navegación independiente
   ===================================================================== */

.portal-navigation {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: #242128;
}

.portal-navigation-inner {
    width: min(100%, 1200px);
    min-height: 54px;
    display: block;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 34px);
}

.portal-top-nav {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    align-self: stretch;
    gap: 4px;
    overflow: visible;
}

.portal-top-nav button {
    position: relative;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 8px;
    padding: 0 13px;
    border: 0;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.58);
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.portal-top-nav button::after {
    position: absolute;
    right: 12px;
    bottom: 0;
    left: 12px;
    height: 2px;
    content: '';
    background: var(--accent);
    opacity: 0;
    transform: scaleX(0.4);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.portal-top-nav button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.portal-top-nav button:active {
    transform: translateY(1px);
}

.portal-top-nav button.active {
    color: var(--accent);
    background: rgba(255, 231, 0, 0.08);
}

.portal-top-nav button.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.portal-top-nav button i {
    width: 16px;
    text-align: center;
}

.portal-nav-athletes {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    margin-left: auto;
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.54);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.portal-nav-athletes i {
    color: var(--accent);
}

.portal-nav-athletes strong {
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.portal-layout {
    display: block;
    min-height: calc(100vh - 126px);
}

.portal-main {
    min-height: calc(100vh - 126px);
}

@media (max-width: 980px) {
    .portal-navigation {
        display: none;
    }

    .app-shell.nav-open .portal-navigation {
        display: block;
    }

    .portal-navigation-inner {
        display: block;
        padding: 8px 16px 12px;
    }

    .portal-top-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .portal-top-nav button {
        min-height: 44px;
        justify-content: flex-start;
        padding: 0 12px;
        border-radius: 9px;
    }

    .portal-top-nav button::after {
        right: auto;
        bottom: 8px;
        left: 12px;
        width: 22px;
        height: 2px;
    }

    .portal-nav-athletes {
        min-height: 34px;
        margin-top: 8px;
        padding: 8px 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 0;
    }

    .portal-layout,
    .portal-main {
        min-height: calc(100vh - 72px);
    }
}

@media (max-width: 620px) {
    .portal-navigation-inner {
        padding-right: 12px;
        padding-left: 12px;
    }

    .portal-top-nav button {
        font-size: 11px;
    }
}

/* =====================================================================
   Portal Familias · lenguaje visual del dashboard administrativo
   ===================================================================== */

.family-dashboard-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    padding: 2px 0 22px;
    border-bottom: 1px solid var(--line);
}

.family-dashboard-head h2 {
    margin: 5px 0 0;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -0.04em;
    line-height: 1;
}

.family-dashboard-head p {
    max-width: 620px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.family-dashboard-meta {
    display: grid;
    justify-items: end;
    gap: 8px;
    flex: 0 0 auto;
}

.family-live-chip,
.family-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.family-live-chip {
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
}

.family-live-chip i {
    color: var(--green);
    font-size: 7px;
}

.family-context-chip {
    color: var(--green);
    background: rgba(178, 213, 143, 0.11);
    border: 1px solid rgba(178, 213, 143, 0.24);
}

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

.family-signal-card {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 94px;
    padding: 16px 18px;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 14px 26px rgba(31, 35, 48, 0.12);
}

.family-signal-card.billing {
    background: #356789;
    box-shadow: 0 14px 26px rgba(53, 103, 137, 0.2);
}

.family-signal-card.attention {
    background: #8d4851;
    box-shadow: 0 14px 26px rgba(141, 72, 81, 0.18);
}

.family-signal-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    font-size: 18px;
}

.family-signal-card span,
.family-signal-card strong,
.family-signal-card small {
    display: block;
}

.family-signal-card span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.family-signal-card strong {
    margin-top: 3px;
    overflow-wrap: anywhere;
    font-size: clamp(17px, 2.2vw, 24px);
    line-height: 1.15;
}

.family-signal-card small {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
}

.family-dashboard-kpi {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    isolation: isolate;
}

.family-dashboard-kpi > span,
.family-dashboard-kpi > strong,
.family-dashboard-kpi > small {
    position: relative;
    z-index: 1;
}

.family-dashboard-kpi > span {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 8px;
    border-radius: 5px;
    background: rgba(178, 181, 188, 0.13);
    font-size: 10px;
    letter-spacing: 0.08em;
}

.family-dashboard-kpi > strong {
    font-variant-numeric: tabular-nums;
}

.family-dashboard-kpi .metric-money {
    max-width: 92%;
    overflow-wrap: anywhere;
    font-size: clamp(20px, 2.2vw, 28px);
}

.family-dashboard-kpi.kpi-athletes > span,
.family-dashboard-kpi.kpi-balance > span {
    color: var(--green);
    background: rgba(178, 213, 143, 0.12);
}

.family-dashboard-kpi.kpi-invoices > span,
.family-dashboard-kpi.kpi-review > span {
    color: var(--rose);
    background: rgba(240, 139, 139, 0.12);
}

.family-kpi-watermark {
    position: absolute;
    right: 18px;
    bottom: 11px;
    z-index: 0;
    color: var(--accent);
    font-size: 52px;
    opacity: 0.12;
    transform: rotate(-8deg);
}

.family-pulse-panel {
    display: grid;
    grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.5fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 12px 30px rgba(31, 35, 48, 0.07);
}

.family-pulse-overview {
    min-width: 0;
    padding: 22px;
    border-right: 1px solid var(--line);
}

.family-pulse-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.family-pulse-heading h2 {
    margin: 4px 0 0;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 25px;
    letter-spacing: -0.03em;
}

.family-pulse-heading p {
    max-width: 300px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.family-health-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.family-health-badge.ok {
    color: var(--green);
    background: rgba(178, 213, 143, 0.13);
}

.family-health-badge.attention {
    color: var(--rose);
    background: rgba(240, 139, 139, 0.13);
}

.family-health-badge i {
    font-size: 7px;
}

.family-pulse-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 22px;
}

.family-pulse-stat-grid > div {
    min-height: 70px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--soft);
}

.family-pulse-stat-grid span,
.family-pulse-stat-grid strong {
    display: block;
}

.family-pulse-stat-grid span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.family-pulse-stat-grid strong {
    margin-top: 6px;
    color: var(--ink);
    font-size: 21px;
    font-variant-numeric: tabular-nums;
}

.family-pulse-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}

.family-pulse-footer i {
    margin-right: 4px;
    color: var(--green);
}

.family-pulse-content {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.family-pulse-content .family-overview-panel {
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.family-pulse-content .family-overview-panel + .family-overview-panel {
    border-left: 1px solid var(--line);
}

.family-panel-count {
    min-width: 26px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    color: var(--rose);
    background: rgba(240, 139, 139, 0.12);
    font-size: 11px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 980px) {
    .family-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .family-dashboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .family-dashboard-meta {
        justify-items: start;
        display: flex;
        flex-wrap: wrap;
    }

    .family-pulse-panel {
        grid-template-columns: 1fr;
    }

    .family-pulse-overview {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 720px) {
    .family-signal-grid,
    .family-pulse-content {
        grid-template-columns: 1fr;
    }

    .family-pulse-content .family-overview-panel + .family-overview-panel {
        border-top: 1px solid var(--line);
        border-left: 0;
    }
}

.family-message-action-target { cursor: pointer; }
.family-message-action-target:active { transform: scale(.99); }
.family-message-bubble-topline { min-height: .1rem; display: flex; align-items: center; gap: .45rem; }
.family-message-pinned, .family-message-edited { color: #a48700; font-size: .55rem; font-weight: 900; }
.family-message-edited { margin-left: auto; color: var(--messaging-muted, #8f939d); }
.family-message-reactions { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .2rem; }
.family-message-reaction { display: inline-flex; align-items: center; gap: .15rem; padding: .13rem .32rem; border: 1px solid rgba(36, 33, 40, .12); border-radius: 999px; color: #777b85; background: rgba(255, 255, 255, .7); font-size: .6rem; }
.family-message-reaction.is-mine { border-color: rgba(255, 231, 0, .55); background: rgba(255, 231, 0, .18); }
html.portal-theme-dark .family-message-reaction { border-color: rgba(255, 255, 255, .12); color: #c7cad2; background: rgba(255, 255, 255, .06); }
.family-message-actions-sheet { display: grid; gap: .7rem; }
.family-message-action-preview { display: grid; gap: .25rem; padding: .7rem; border: 1px solid rgba(36, 33, 40, .1); border-radius: .8rem; background: #f8f9fc; }
html.portal-theme-dark .family-message-action-preview { border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); }
.family-message-action-preview p { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .78rem; line-height: 1.5; }
.family-message-action-preview time { color: #8f939d; font-size: .56rem; }
.family-message-reaction-picker { display: flex; align-items: center; gap: .2rem; padding: .5rem; border: 1px solid rgba(36, 33, 40, .1); border-radius: .8rem; background: #f8f9fc; }
html.portal-theme-dark .family-message-reaction-picker { border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); }
.family-message-reaction-picker > span { margin-right: auto; color: #8f939d; font-size: .58rem; font-weight: 800; }
.family-message-reaction-picker button { width: 2rem; height: 2rem; border: 1px solid transparent; border-radius: .5rem; background: transparent; font-size: .95rem; }
.family-message-reaction-picker button:hover, .family-message-reaction-picker button.is-selected { border-color: rgba(255, 231, 0, .5); background: rgba(255, 231, 0, .16); }
.family-message-action-list { display: grid; gap: .4rem; }
.family-message-action-list button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .65rem; border: 1px solid transparent; border-radius: .75rem; color: inherit; background: #f8f9fc; text-align: left; }
html.portal-theme-dark .family-message-action-list button { background: rgba(255, 255, 255, .05); }
.family-message-action-list button:hover { border-color: rgba(255, 231, 0, .4); }
.family-message-action-list button > i { width: 1.85rem; height: 1.85rem; display: grid; place-items: center; border-radius: .55rem; color: #242128; background: #ffe700; }
.family-message-action-list button span { display: grid; gap: .1rem; }
.family-message-action-list button strong { font-size: .68rem; }
.family-message-action-list button small { color: #8f939d; font-size: .56rem; }
.family-message-actions-sheet textarea { width: 100%; min-height: 7.5rem; resize: vertical; }
@media (max-width: 520px) { .family-message-reaction-picker > span { display: none; } .family-message-reaction-picker button { flex: 1; } }

@media (max-width: 620px) {
    .family-summary-grid {
        grid-template-columns: 1fr;
    }

    .family-dashboard-head h2 {
        font-size: 30px;
    }

    .family-pulse-heading {
        flex-direction: column;
    }

    .family-pulse-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =====================================================================
   Portal Familias · cuenta familiar y atleta activo
   ===================================================================== */

.portal-balance-strip {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #302c36;
}

.portal-balance-inner {
    width: min(100%, 1200px);
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 auto;
    padding: 10px clamp(16px, 3vw, 34px);
}

.portal-balance-copy {
    min-width: 0;
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 0 16px;
}

.portal-balance-eyebrow {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-balance-eyebrow i {
    color: var(--accent);
}

.portal-balance-copy strong {
    color: #fff;
    font-family: Outfit, Inter, sans-serif;
    font-size: clamp(21px, 3vw, 27px);
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

.portal-balance-copy small {
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
    font-weight: 700;
}

.portal-balance-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex: 0 0 auto;
}

.portal-balance-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #86e4bd;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.portal-balance-status.pending {
    color: #ffb6a9;
}

.portal-balance-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.portal-balance-link:hover {
    border-color: rgba(255, 231, 0, 0.6);
    background: rgba(255, 231, 0, 0.12);
}

.portal-balance-link:active {
    transform: translateY(1px);
}

.portal-nav-athlete-context {
    min-height: 34px;
    display: grid;
    grid-template-columns: auto minmax(150px, 205px) auto;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    margin: 8px 0 10px auto;
    padding: 8px 0 0 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-nav-athlete-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-nav-athlete-label i {
    color: var(--accent);
    font-size: 13px;
}

.portal-nav-athlete-context select {
    min-width: 0;
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    outline: 0;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
}

.portal-nav-athlete-context select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 231, 0, 0.14);
}

.portal-nav-athlete-context select option {
    color: var(--ink);
    background: var(--paper);
}

.portal-nav-count {
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.portal-nav-count strong {
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.athlete-header-side {
    min-width: 165px;
    display: grid;
    justify-items: end;
    gap: 8px;
    text-align: right;
}

.athlete-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
}

.athlete-active-badge i {
    font-size: 8px;
}

.athlete-header-side small {
    max-width: 190px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

html.portal-theme-dark .portal-balance-strip {
    background: #2a2630;
}

html.portal-theme-light .portal-balance-strip {
    border-color: rgba(36, 33, 40, 0.08);
}

html.portal-theme-light .portal-nav-athlete-context select {
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 980px) {
    .portal-balance-inner {
        padding-right: 16px;
        padding-left: 16px;
    }

    .portal-nav-athlete-context {
        width: 100%;
        grid-template-columns: auto minmax(160px, 1fr) auto;
        margin-top: 8px;
        padding: 10px 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 0;
    }
}

@media (max-width: 620px) {
    .portal-balance-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .portal-balance-copy {
        width: 100%;
    }

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

    .portal-nav-athlete-context {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .portal-nav-athlete-label {
        grid-column: 1 / -1;
    }

    .athlete-header-side {
        min-width: 0;
        justify-items: start;
        text-align: left;
    }
}

/* =====================================================================
   Portal Familias · cuenta integrada en la barra principal
   ===================================================================== */

.topbar-account-context {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
    gap: 18px;
    max-width: 650px;
    margin-right: auto;
}

.app-shell.portal-athlete-restricted .topbar-account-copy,
.app-shell.portal-athlete-restricted .topbar-account-state {
    display: none;
}

.app-shell.portal-athlete-restricted .topbar-account-context {
    justify-content: flex-start;
}

.app-shell.portal-athlete-restricted .portal-mobile-primary-wrap {
    display: none;
}

.portal-attendance-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: clamp(24px, 5vw, 46px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background: #302c36;
}

.portal-attendance-copy h2 {
    margin: 8px 0;
    color: #fff;
    font-family: Outfit, Inter, sans-serif;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.05;
}

.portal-attendance-copy p,
.portal-attendance-copy strong {
    color: rgba(255, 255, 255, 0.7);
}

.portal-attendance-qr-wrap {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    background: #fff;
}

.portal-attendance-qr {
    display: block;
    width: min(260px, 48vw);
    aspect-ratio: 1;
}

.portal-attendance-qr-wrap small {
    color: #242128;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portal-attendance-history {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-attendance-history > div,
.portal-attendance-history p {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.portal-attendance-history > div strong,
.portal-attendance-history p strong {
    color: #fff;
}

.portal-attendance-empty {
    color: rgba(255, 255, 255, 0.5) !important;
}

html.portal-theme-light .portal-attendance-panel {
    border-color: #e7e8ee;
    background: #fff;
}

html.portal-theme-light .portal-attendance-copy h2,
html.portal-theme-light .portal-attendance-history > div strong,
html.portal-theme-light .portal-attendance-history p strong {
    color: #242128;
}

html.portal-theme-light .portal-attendance-copy p,
html.portal-theme-light .portal-attendance-copy strong,
html.portal-theme-light .portal-attendance-history > div,
html.portal-theme-light .portal-attendance-history p {
    color: #6f7480;
}

@media (max-width: 700px) {
    .portal-attendance-panel {
        grid-template-columns: 1fr;
    }

    .portal-attendance-qr-wrap {
        justify-self: start;
    }
}

.topbar-account-copy {
    min-width: 0;
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 0 12px;
}

.topbar-account-eyebrow {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.52) !important;
    font-size: 9px !important;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.topbar-account-eyebrow i {
    color: var(--accent);
}

.topbar-account-copy strong {
    color: #fff;
    font-family: Outfit, Inter, sans-serif;
    font-size: 21px;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

.topbar-account-copy small {
    max-width: 210px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.52);
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-account-state {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-account-state .portal-balance-link {
    min-height: 29px;
    padding: 0 10px;
    font-size: 10px;
}

.topbar-current-page {
    display: grid;
    gap: 2px;
    flex: 0 0 auto;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-current-page span {
    color: rgba(255, 255, 255, 0.42) !important;
    font-size: 9px !important;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-current-page strong {
    max-width: 220px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.9);
    font-family: Outfit, Inter, sans-serif;
    font-size: 13px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .topbar-account-context {
        gap: 12px;
    }

    .topbar-current-page {
        display: none;
    }
}

@media (max-width: 620px) {
    .topbar-account-context {
        display: flex;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 0;
        border-left: 0;
    }

    .topbar-account-copy {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .topbar-account-eyebrow {
        font-size: 0 !important;
        letter-spacing: 0;
    }

    .topbar-account-eyebrow i {
        font-size: 12px;
    }

    .topbar-account-copy strong {
        font-size: 17px;
    }

    .topbar-account-copy small,
    .topbar-account-state {
        display: none;
    }
}

/* =====================================================================
   Portal Familias · carnet del atleta
   ===================================================================== */

.athlete-carnet-action {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
    padding: 0 11px;
    border: 1px solid rgba(255, 231, 0, 0.45);
    border-radius: 8px;
    color: var(--ink);
    background: var(--accent);
    font-size: 10px;
    font-weight: 900;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.athlete-carnet-action:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.athlete-carnet-action:active {
    transform: translateY(1px);
}

.portal-carnet-modal {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: 18px;
}

.portal-carnet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 23, 0.82);
    backdrop-filter: blur(8px);
}

.portal-carnet-dialog {
    position: relative;
    width: min(100%, 650px);
    max-height: calc(100dvh - 36px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #fff;
    background: #242128;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.portal-carnet-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-carnet-dialog-head p,
.portal-carnet-dialog-head h2 {
    margin: 0;
}

.portal-carnet-dialog-head p {
    color: var(--accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-carnet-dialog-head h2 {
    margin-top: 4px;
    font-family: Outfit, Inter, sans-serif;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.portal-carnet-preview {
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 24px 20px 14px;
    background: #1d1a21;
}

.portal-carnet-card {
    position: relative;
    width: 430px;
    height: 270px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 20px;
    color: #111827;
    background: #fff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

.portal-carnet-surface,
.portal-carnet-band,
.portal-carnet-ribbon,
.portal-carnet-border {
    position: absolute;
    pointer-events: none;
}

.portal-carnet-surface {
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 243, 0.96) 48%, rgba(238, 241, 244, 0.96)),
        repeating-linear-gradient(115deg, rgba(36, 33, 40, 0.035) 0 1px, transparent 1px 5px);
}

.portal-carnet-band {
    inset: 0 auto 0 0;
    width: 135px;
    background: linear-gradient(160deg, #242128 0%, #15151a 58%, #0f1117 100%);
}

.portal-carnet-ribbon {
    inset: 0 auto 0 127px;
    width: 40px;
    background: var(--accent);
    clip-path: polygon(0 0, 100% 0, 38% 100%, 0 100%);
}

.portal-carnet-border {
    inset: 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
}

.portal-carnet-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
}

.portal-carnet-rail {
    width: 135px;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 16px 15px;
}

.portal-carnet-photo-wrap {
    width: 90px;
    height: 104px;
    padding: 4px;
    border-radius: 13px;
    background: var(--accent);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.portal-carnet-photo-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    object-fit: cover;
    background: #fff;
}

.portal-carnet-qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.portal-carnet-qr-wrap > img {
    width: 82px;
    height: 82px;
    display: block;
    padding: 4px;
    border: 1px solid #fff;
    border-radius: 5px;
    background: #fff;
    object-fit: contain;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.portal-carnet-qr-wrap small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-carnet-main {
    min-width: 0;
    flex: 1;
    padding: 16px 15px 16px 43px;
}

.portal-carnet-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.portal-carnet-title-row > div {
    min-width: 0;
}

.portal-carnet-title-row span,
.portal-carnet-chip span,
.portal-carnet-details span {
    display: block;
    color: #9ca3af;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.portal-carnet-title-row h3 {
    max-width: 210px;
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: #030712;
    font-family: Outfit, Inter, sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 0.95;
}

.portal-carnet-title-row > img {
    width: 53px;
    height: 35px;
    flex: 0 0 auto;
    object-fit: contain;
}

.portal-carnet-chips {
    display: grid;
    gap: 4px;
    margin-top: 10px;
}

.portal-carnet-chip {
    min-height: 27px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 7px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.85);
}

.portal-carnet-chip.accent {
    border-color: transparent;
    background: var(--accent);
}

.portal-carnet-chip.accent span {
    color: rgba(17, 24, 39, 0.6);
}

.portal-carnet-chip strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #1f2937;
    font-size: 9px;
    line-height: 1.05;
    text-transform: uppercase;
}

.portal-carnet-rule {
    width: 92px;
    height: 3px;
    margin-top: 10px;
    border-radius: 999px;
    background: var(--accent);
}

.portal-carnet-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px 18px;
    margin-top: 11px;
}

.portal-carnet-details strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #111827;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.portal-carnet-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 20px 18px;
}

.portal-carnet-actions .secondary-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
}

.portal-carnet-actions .secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 620px) {
    .portal-carnet-dialog {
        max-height: calc(100dvh - 20px);
        border-radius: 16px;
    }

    .portal-carnet-preview {
        justify-content: flex-start;
        padding: 18px 14px 10px;
    }

    .portal-carnet-card {
        transform: scale(0.72);
        transform-origin: top center;
        margin-bottom: -76px;
    }

    .portal-carnet-actions {
        flex-wrap: wrap;
        justify-content: stretch;
        padding: 12px 14px 14px;
    }

    .portal-carnet-actions > button {
        flex: 1 1 auto;
    }
}

/* =====================================================================
   Portal Familias · tema claro refinado
   ===================================================================== */

html.portal-theme-light body.portal-page {
    --ink: #20252d;
    --muted: #687383;
    --line: #dce3eb;
    --paper: #ffffff;
    --soft: #f1f4f7;
    --accent: #f4d500;
    --blue: #41658d;
    --green: #087f60;
    --rose: #c34158;
    --shadow: 0 18px 45px rgba(37, 49, 64, 0.09);
    background: var(--soft);
}

html.portal-theme-light .app-shell {
    background:
        radial-gradient(circle at 88% 0%, rgba(244, 213, 0, 0.08), transparent 27rem),
        var(--soft);
}

html.portal-theme-light .portal-topbar {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: #dce3eb;
    box-shadow: 0 10px 26px rgba(37, 49, 64, 0.08);
}

html.portal-theme-light .topbar-brand,
html.portal-theme-light .topbar-brand-copy strong,
html.portal-theme-light .topbar-page-context strong,
html.portal-theme-light .topbar-user-copy strong {
    color: var(--ink);
}

html.portal-theme-light .topbar-brand-mark {
    border-color: #dce3eb;
    background: #f4f6f8;
}

html.portal-theme-light .topbar-brand-copy small,
html.portal-theme-light .topbar-user-copy small,
html.portal-theme-light .topbar-page-context span {
    color: #788494;
}

html.portal-theme-light .topbar-page-context,
html.portal-theme-light .topbar-user,
html.portal-theme-light .topbar-account-state,
html.portal-theme-light .topbar-current-page {
    border-color: #dce3eb;
}

html.portal-theme-light .topbar-icon,
html.portal-theme-light .topbar-action {
    border-color: #dce3eb;
    color: #526071;
    background: #f5f7f9;
}

html.portal-theme-light .topbar-icon:hover,
html.portal-theme-light .topbar-action:hover {
    border-color: rgba(215, 188, 0, 0.75);
    color: #20252d;
    background: rgba(244, 213, 0, 0.2);
}

html.portal-theme-light .topbar-logout:hover {
    color: #b9344d;
    border-color: rgba(195, 65, 88, 0.28);
    background: rgba(195, 65, 88, 0.08);
}

html.portal-theme-light .topbar-account-eyebrow {
    color: #788494 !important;
}

html.portal-theme-light .topbar-account-copy strong {
    color: var(--ink);
}

html.portal-theme-light .topbar-account-copy small {
    color: #788494;
}

html.portal-theme-light .topbar-account-eyebrow i {
    color: #b59e00;
}

html.portal-theme-light .topbar-current-page span {
    color: #8994a2 !important;
}

html.portal-theme-light .topbar-current-page strong {
    color: #445163;
}

html.portal-theme-light .portal-navigation {
    border-top-color: #e3e8ee;
    border-bottom: 1px solid #dce3eb;
    background: #ffffff;
}

html.portal-theme-light .portal-top-nav button {
    color: #687383;
}

html.portal-theme-light .portal-top-nav button:hover {
    color: var(--ink);
    background: #f3f6f8;
}

html.portal-theme-light .portal-top-nav button.active {
    color: var(--ink);
    background: rgba(244, 213, 0, 0.17);
}

html.portal-theme-light .portal-nav-athlete-context {
    border-left-color: #dce3eb;
}

html.portal-theme-light .portal-nav-athlete-label {
    color: #758091;
}

html.portal-theme-light .portal-nav-athlete-label i {
    color: #b59e00;
}

html.portal-theme-light .portal-nav-athlete-context select {
    border-color: #cfd8e2;
    color: var(--ink);
    background-color: #f6f8fa;
}

html.portal-theme-light .portal-nav-athlete-context select:focus {
    border-color: #c9ae00;
    box-shadow: 0 0 0 3px rgba(244, 213, 0, 0.2);
}

html.portal-theme-light .portal-nav-count {
    color: #84909f;
}

html.portal-theme-light .portal-nav-count strong {
    color: #384657;
}

html.portal-theme-light .portal-balance-status {
    color: #087f60;
}

html.portal-theme-light .portal-balance-status.pending {
    color: #bd3e55;
}

html.portal-theme-light .portal-balance-link {
    border-color: #d1d9e2;
    color: #354254;
    background: #f4f6f8;
}

html.portal-theme-light .portal-balance-link:hover {
    border-color: #cfb400;
    color: var(--ink);
    background: rgba(244, 213, 0, 0.2);
}

html.portal-theme-light .athlete-header,
html.portal-theme-light .section-action-head,
html.portal-theme-light .metric-card,
html.portal-theme-light .panel-card,
html.portal-theme-light .empty-state,
html.portal-theme-light .payable-card,
html.portal-theme-light .family-pulse-panel {
    border-color: #dce3eb;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(37, 49, 64, 0.065);
}

html.portal-theme-light .athlete-header h2,
html.portal-theme-light .panel-card h3,
html.portal-theme-light .metric-card strong,
html.portal-theme-light .family-pulse-heading h2,
html.portal-theme-light .family-dashboard-head h2 {
    color: var(--ink);
}

html.portal-theme-light .profile-photo {
    border-color: #cfd8e2;
    background: #27313d;
}

html.portal-theme-light .profile-badges span {
    border-color: #dce3eb;
    color: #4e5b6c;
    background: #f4f6f8;
}

html.portal-theme-light .athlete-active-badge {
    color: var(--green);
}

html.portal-theme-light .athlete-carnet-action {
    border-color: #26313d;
    color: #ffffff;
    background: #26313d;
    box-shadow: 0 7px 16px rgba(37, 49, 64, 0.14);
}

html.portal-theme-light .athlete-carnet-action:hover {
    color: #20252d;
    background: var(--accent);
    border-color: #d5ba00;
}

html.portal-theme-dark .athlete-carnet-action {
    border-color: #f3d900;
    color: #242128;
    background: var(--accent);
    box-shadow: 0 7px 16px rgba(255, 231, 0, 0.16);
}

html.portal-theme-dark .athlete-carnet-action:hover {
    color: #242128;
    border-color: #d8bd00;
    background: #f4d900;
}

html.portal-theme-light .section-action-head,
html.portal-theme-light .family-overview-panel,
html.portal-theme-light .family-activity-panel {
    color: var(--ink);
}

html.portal-theme-light .section-icon {
    color: #5a4f00;
    background: rgba(244, 213, 0, 0.2);
    border-color: rgba(205, 177, 0, 0.35);
}

html.portal-theme-light .erp-panel > .card-head {
    border-bottom-color: #dce3eb;
    background: #f6f8fa;
}

html.portal-theme-light .payable-card:hover {
    background: rgba(244, 213, 0, 0.09);
    box-shadow: 0 10px 22px rgba(37, 49, 64, 0.08);
}

html.portal-theme-light .history-row,
html.portal-theme-light .family-pulse-content .family-overview-panel + .family-overview-panel,
html.portal-theme-light .family-pulse-stat-grid > div {
    border-color: #e0e6ed;
}

html.portal-theme-light .family-pulse-stat-grid > div {
    background: #f5f7f9;
}

html.portal-theme-light .family-live-chip {
    border-color: #dce3eb;
    color: #6d7887;
    background: #ffffff;
}

html.portal-theme-light .family-context-chip,
html.portal-theme-light .family-health-badge.ok {
    color: #087f60;
    border-color: rgba(8, 127, 96, 0.2);
    background: rgba(8, 127, 96, 0.08);
}

html.portal-theme-light .family-health-badge.attention {
    color: #bd3e55;
    background: rgba(195, 65, 88, 0.08);
}

html.portal-theme-light .family-dashboard-kpi > span {
    background: rgba(80, 96, 113, 0.08);
}

html.portal-theme-light .family-dashboard-kpi.kpi-athletes > span,
html.portal-theme-light .family-dashboard-kpi.kpi-balance > span {
    color: #087f60;
    background: rgba(8, 127, 96, 0.08);
}

html.portal-theme-light .family-dashboard-kpi.kpi-invoices > span,
html.portal-theme-light .family-dashboard-kpi.kpi-review > span {
    color: #bd3e55;
    background: rgba(195, 65, 88, 0.08);
}

html.portal-theme-light input,
html.portal-theme-light select,
html.portal-theme-light textarea {
    border-color: #cfd8e2;
    color: var(--ink);
    background: #ffffff;
}

html.portal-theme-light input::placeholder,
html.portal-theme-light textarea::placeholder {
    color: #98a3b0;
}

html.portal-theme-light .ghost-btn,
html.portal-theme-light .icon-btn {
    border-color: #d1dae4;
    color: #3f4d5e;
    background: #ffffff;
}

html.portal-theme-light .ghost-btn:hover,
html.portal-theme-light .icon-btn:hover {
    border-color: #c5d0dc;
    color: var(--ink);
    background: #f4f6f8;
}

html.portal-theme-light .text-link,
html.portal-theme-light .icon-action {
    color: #435164;
    background: #eef2f6;
}

html.portal-theme-light .text-link:hover,
html.portal-theme-light .icon-action:hover {
    color: var(--ink);
    background: var(--accent);
}

html.portal-theme-light .portal-modal-card {
    border-color: #dce3eb;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(37, 49, 64, 0.22);
}

html.portal-theme-light .portal-modal-head,
html.portal-theme-light .modal-summary-card {
    border-color: #dce3eb;
    background: #f6f8fa;
}

html.portal-theme-light .modal-close {
    color: #647184;
    background: #eaf0f5;
}

html.portal-theme-light .modal-close:hover {
    color: #bd3e55;
    background: #fff0f3;
}

html.portal-theme-light .payment-empty {
    border-color: rgba(8, 127, 96, 0.18);
    color: #087f60;
    background: rgba(8, 127, 96, 0.07);
}

html.portal-theme-light .payment-empty span {
    color: var(--muted);
}

html.portal-theme-light .status-pill {
    color: #657183;
    background: #edf1f5;
}

html.portal-theme-light .status-pill.pendiente,
html.portal-theme-light .status-pill.abierto {
    color: #695900;
    background: rgba(244, 213, 0, 0.24);
}

html.portal-theme-light .status-pill.aprobado,
html.portal-theme-light .status-pill.aprobada,
html.portal-theme-light .status-pill.validado,
html.portal-theme-light .status-pill.respondido,
html.portal-theme-light .status-pill.pagada {
    color: #087f60;
    background: rgba(8, 127, 96, 0.1);
}

html.portal-theme-light .status-pill.rechazado,
html.portal-theme-light .status-pill.rechazada {
    color: #bd3e55;
    background: rgba(195, 65, 88, 0.1);
}

/* =====================================================================
   Portal Familias · centro de facturación
   ===================================================================== */

#tab-facturas {
    gap: 18px;
}

.invoice-section-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
    gap: 24px;
    align-items: stretch;
    padding: 4px 2px 0;
}

.invoice-intro-copy {
    min-width: 0;
    padding: 8px 0 3px;
}

.invoice-eyebrow,
.invoice-ledger-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-eyebrow i {
    color: var(--accent);
}

.invoice-intro-copy h2 {
    max-width: 700px;
    margin: 9px 0 7px;
    color: var(--ink);
    font-size: clamp(28px, 4vw, 43px);
    letter-spacing: -0.055em;
    line-height: 0.98;
    text-wrap: balance;
}

.invoice-intro-copy p {
    max-width: 660px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.invoice-account-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    min-height: 142px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 12px 32px rgba(31, 35, 48, 0.07);
}

.invoice-account-state.attention {
    border-color: rgba(255, 231, 0, 0.46);
    background: rgba(255, 231, 0, 0.09);
}

.invoice-account-state.clear {
    border-color: rgba(17, 151, 109, 0.24);
    background: rgba(17, 151, 109, 0.08);
}

.invoice-account-state span,
.invoice-account-state strong,
.invoice-account-state small {
    display: block;
}

.invoice-account-state span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.invoice-account-state.attention span,
.invoice-account-state.attention strong {
    color: var(--ink);
}

.invoice-account-state.clear span,
.invoice-account-state.clear strong {
    color: var(--green);
}

.invoice-account-state span i {
    margin-right: 4px;
}

.invoice-account-state strong {
    font-family: Outfit, Inter, sans-serif;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.invoice-account-state small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.invoice-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(280px, 0.78fr);
    gap: 14px;
}

.invoice-balance-card,
.invoice-stat-card,
.invoice-ledger-panel {
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 14px 34px rgba(31, 35, 48, 0.08);
}

.invoice-balance-card {
    position: relative;
    min-height: 235px;
    overflow: hidden;
    padding: 22px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 92% 4%, rgba(255, 231, 0, 0.2), transparent 13rem),
        var(--paper);
}

.invoice-balance-card::after {
    position: absolute;
    right: -58px;
    bottom: -68px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(255, 231, 0, 0.16);
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.invoice-balance-topline,
.invoice-balance-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.invoice-balance-topline {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.invoice-balance-topline i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 231, 0, 0.34);
    border-radius: 10px;
    color: var(--ink);
    background: rgba(255, 231, 0, 0.18);
}

.invoice-balance-value {
    display: block;
    margin-top: 18px;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: clamp(32px, 4.2vw, 48px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.06em;
    line-height: 0.95;
}

.invoice-balance-card p {
    max-width: 420px;
    margin: 10px 0 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.invoice-progress {
    position: relative;
    z-index: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.invoice-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.35s ease;
}

.invoice-balance-foot {
    position: relative;
    z-index: 1;
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.invoice-primary-action {
    position: relative;
    z-index: 1;
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 17px;
    padding: 0 13px;
    border: 1px solid rgba(31, 35, 48, 0.15);
    border-radius: 9px;
    color: #242128;
    background: var(--accent);
    font-size: 12px;
    font-weight: 900;
    transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

.invoice-primary-action:hover {
    box-shadow: 0 9px 18px rgba(255, 231, 0, 0.18);
    filter: brightness(0.98);
    transform: translateY(-1px);
}

.invoice-primary-action:active {
    transform: scale(0.98);
}

.invoice-stat-stack {
    display: grid;
    gap: 14px;
}

.invoice-stat-card {
    min-height: 110px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
}

.invoice-stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 16px;
}

.invoice-stat-card.paid .invoice-stat-icon {
    color: var(--green);
    border-color: rgba(17, 151, 109, 0.22);
    background: rgba(17, 151, 109, 0.1);
}

.invoice-stat-card.issued .invoice-stat-icon {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.09);
}

.invoice-stat-card div {
    min-width: 0;
}

.invoice-stat-card small,
.invoice-stat-card strong,
.invoice-stat-card em {
    display: block;
}

.invoice-stat-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.invoice-stat-card strong {
    margin-top: 6px;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.invoice-stat-card em {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-ledger-panel {
    overflow: hidden;
    border-radius: 20px;
}

.invoice-ledger-head,
.invoice-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.invoice-ledger-head {
    padding: 21px 22px 17px;
}

.invoice-ledger-eyebrow {
    color: var(--muted);
    font-size: 10px;
}

.invoice-ledger-head h3 {
    margin: 5px 0 0;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 21px;
    letter-spacing: -0.03em;
}

.invoice-ledger-count {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.invoice-filter-bar {
    min-height: 58px;
    padding: 9px 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(128, 143, 160, 0.05);
}

.invoice-filters {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.invoice-filters button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 900;
    transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}

.invoice-filters button span {
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 6px;
    color: var(--muted);
    background: rgba(128, 143, 160, 0.12);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.invoice-filters button:hover {
    color: var(--ink);
    background: rgba(128, 143, 160, 0.08);
}

.invoice-filters button.active {
    border-color: rgba(255, 231, 0, 0.38);
    color: var(--ink);
    background: rgba(255, 231, 0, 0.17);
}

.invoice-filters button.active span {
    color: #5e5500;
    background: rgba(255, 231, 0, 0.38);
}

.invoice-filters button:active {
    transform: scale(0.98);
}

.invoice-filter-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.invoice-filter-note i {
    color: var(--green);
}

.invoice-list {
    display: grid;
    padding: 0 22px 18px;
}

.invoice-list .invoice-row {
    min-height: 86px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.invoice-list .invoice-row:first-child {
    border-top: 0;
}

.invoice-row-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.invoice-row-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    font-size: 13px;
}

.invoice-row-icon.pending {
    color: #756800;
    background: rgba(255, 231, 0, 0.2);
}

.invoice-row-icon.paid {
    color: var(--green);
    background: rgba(17, 151, 109, 0.11);
}

.invoice-row-copy {
    min-width: 0;
}

.invoice-row-copy strong,
.invoice-row-copy span {
    display: block;
}

.invoice-row-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-row-copy span {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-row-amount {
    min-width: 132px;
    text-align: right;
}

.invoice-row-amount small,
.invoice-row-amount strong,
.invoice-row-amount em {
    display: block;
}

.invoice-row-amount small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.invoice-row-amount strong {
    margin-top: 3px;
    color: var(--ink);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.invoice-row-amount em {
    margin-top: 3px;
    color: var(--rose);
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.invoice-row-amount em.settled {
    color: var(--green);
}

.invoice-list .invoice-actions {
    display: flex;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.invoice-list .invoice-actions .status-pill {
    min-width: 82px;
}

.invoice-list .icon-action {
    min-width: 34px;
    min-height: 32px;
    border: 1px solid var(--line);
    background: transparent;
}

.invoice-list .icon-action span {
    display: inline;
    margin: 0;
    color: inherit;
    font-size: 11px;
}

.invoice-list .icon-action:hover {
    border-color: rgba(255, 231, 0, 0.48);
    background: var(--accent);
}

.invoice-empty-state,
.invoice-filter-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 38px 20px 28px;
    text-align: center;
}

.invoice-empty-icon {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
    border-radius: 13px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.1);
    font-size: 17px;
}

.invoice-empty-state strong,
.invoice-filter-empty strong {
    color: var(--ink);
    font-size: 14px;
}

.invoice-empty-state p,
.invoice-filter-empty p {
    max-width: 390px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

html.portal-theme-light .invoice-account-state,
html.portal-theme-light .invoice-balance-card,
html.portal-theme-light .invoice-stat-card,
html.portal-theme-light .invoice-ledger-panel {
    box-shadow: 0 12px 30px rgba(37, 49, 64, 0.07);
}

html.portal-theme-light .invoice-account-state.attention {
    border-color: rgba(205, 177, 0, 0.45);
    background: rgba(244, 213, 0, 0.1);
}

html.portal-theme-light .invoice-account-state.clear {
    border-color: rgba(8, 127, 96, 0.22);
    background: rgba(8, 127, 96, 0.07);
}

html.portal-theme-light .invoice-balance-card {
    background:
        radial-gradient(circle at 92% 4%, rgba(244, 213, 0, 0.19), transparent 13rem),
        #ffffff;
}

html.portal-theme-light .invoice-balance-topline i {
    color: #5d5100;
}

html.portal-theme-light .invoice-row-icon.pending {
    color: #756100;
    background: rgba(244, 213, 0, 0.2);
}

html.portal-theme-light .invoice-filters button.active span {
    color: #695900;
}

@media (max-width: 820px) {
    .invoice-section-intro,
    .invoice-overview-grid {
        grid-template-columns: 1fr;
    }

    .invoice-account-state {
        min-height: auto;
    }
}

@media (max-width: 680px) {
    .invoice-ledger-head,
    .invoice-filter-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .invoice-ledger-head {
        gap: 8px;
    }

    .invoice-filter-bar {
        gap: 9px;
        padding: 12px 16px;
    }

    .invoice-filters {
        width: 100%;
    }

    .invoice-filters button {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 7px;
    }

    .invoice-filter-note {
        padding-left: 3px;
    }

    .invoice-list {
        padding: 0 16px 14px;
    }

    .invoice-list .invoice-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 14px;
        padding: 16px 0;
    }

    .invoice-row-amount {
        min-width: 96px;
    }

    .invoice-list .invoice-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 50px;
    }
}

@media (max-width: 420px) {
    .invoice-section-intro {
        gap: 15px;
    }

    .invoice-intro-copy h2 {
        font-size: 32px;
    }

    .invoice-balance-card {
        padding: 18px;
    }

    .invoice-balance-value {
        font-size: 36px;
    }

    .invoice-row-amount {
        min-width: 84px;
    }

    .invoice-list .icon-action span {
        display: none;
    }

    .invoice-list .icon-action {
        width: 34px;
        padding: 0;
    }
}

/* =====================================================================
   Portal Familias · pagos y comprobantes
   ===================================================================== */

.invoice-row-icon,
.invoice-row-icon i,
.invoice-row-icon svg {
    line-height: 1;
    vertical-align: middle;
}

.invoice-row-icon {
    overflow: hidden;
}

.history-row .invoice-row-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-top: 0;
    font-size: 13px;
    line-height: 1;
}

.invoice-row-icon i,
.invoice-row-icon svg {
    display: block;
}

.invoice-row-icon i {
    width: 1em;
    height: 1em;
    display: grid;
    place-items: center;
    font-style: normal;
    text-align: center;
}

.invoice-row-icon i::before {
    display: block;
    line-height: 1;
    transform: translateY(1px);
}

.invoice-row-icon svg {
    width: 1em;
    height: 1em;
    overflow: hidden;
}

.payment-section-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
    gap: 24px;
    align-items: stretch;
    padding: 4px 2px 0;
}

.payment-intro-copy {
    min-width: 0;
    padding: 8px 0 3px;
}

.payment-eyebrow,
.payment-guide-eyebrow,
.payment-panel-head > div > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.payment-eyebrow i {
    color: var(--accent);
}

.payment-intro-copy h2 {
    margin: 9px 0 7px;
    color: var(--ink);
    font-size: clamp(28px, 4vw, 43px);
    letter-spacing: -0.055em;
    line-height: 0.98;
    text-wrap: balance;
}

.payment-intro-copy p {
    max-width: 670px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.payment-methods-card {
    min-width: 0;
    padding: 15px 16px 14px;
    border: 1px solid rgba(205, 177, 0, 0.32);
    border-radius: 18px;
    background: rgba(255, 231, 0, 0.09);
    box-shadow: 0 12px 30px rgba(31, 35, 48, 0.06);
}

.payment-methods-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-privacy-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    color: #5d5100;
    background: rgba(255, 231, 0, 0.28);
    font-size: 15px;
}

.payment-methods-head > div,
.payment-method-row {
    min-width: 0;
}

.payment-methods-head strong,
.payment-methods-head small {
    display: block;
}

.payment-methods-head strong {
    color: var(--ink);
    font-size: 13px;
}

.payment-methods-head small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.payment-method-list {
    display: grid;
    gap: 7px;
    margin-top: 13px;
}

.payment-method-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 7px;
    border-top: 1px solid rgba(128, 143, 160, 0.2);
}

.payment-method-row span,
.payment-method-row strong {
    display: block;
}

.payment-method-row span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.payment-method-row span i {
    width: 14px;
    margin-right: 4px;
    color: #756800;
    text-align: center;
}

.payment-method-row strong {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 12px;
    text-align: right;
}

.payment-methods-card.is-empty .payment-method-row strong {
    color: var(--muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
}

.payment-method-note {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-top: 11px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.payment-method-note i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: #756800;
}

.payment-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    gap: 14px;
}

.payment-due-card,
.payment-guide-card,
.payment-queue-panel,
.payment-reports-panel {
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 14px 34px rgba(31, 35, 48, 0.08);
}

.payment-due-card {
    position: relative;
    min-height: 226px;
    overflow: hidden;
    padding: 22px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 92% 2%, rgba(255, 231, 0, 0.2), transparent 13rem),
        var(--paper);
}

.payment-due-card::after {
    position: absolute;
    right: -55px;
    bottom: -75px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(255, 231, 0, 0.16);
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.payment-due-topline {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.payment-due-topline i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 231, 0, 0.34);
    border-radius: 10px;
    color: var(--ink);
    background: rgba(255, 231, 0, 0.18);
}

.payment-due-value {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 18px;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: clamp(32px, 4.2vw, 48px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.06em;
    line-height: 0.95;
}

.payment-due-card p {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 10px 0 17px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.payment-primary-action {
    position: relative;
    z-index: 1;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(31, 35, 48, 0.15);
    border-radius: 9px;
    color: #242128;
    background: var(--accent);
    font-size: 12px;
    font-weight: 900;
    transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

.payment-primary-action:hover:not(:disabled) {
    box-shadow: 0 9px 18px rgba(255, 231, 0, 0.18);
    filter: brightness(0.98);
    transform: translateY(-1px);
}

.payment-primary-action:active:not(:disabled) {
    transform: scale(0.98);
}

.payment-primary-action:disabled {
    color: var(--muted);
    background: var(--soft);
    border-color: var(--line);
}

.payment-guide-card {
    min-height: 226px;
    padding: 22px;
    border-radius: 20px;
}

.payment-guide-eyebrow {
    color: var(--muted);
    font-size: 10px;
}

.payment-guide-card h3 {
    margin: 7px 0 16px;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 21px;
    letter-spacing: -0.03em;
}

.payment-steps {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.payment-steps li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.payment-steps li > span {
    color: var(--blue);
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

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

.payment-steps strong {
    color: var(--ink);
    font-size: 12px;
}

.payment-steps small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.payment-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 14px;
}

.payment-queue-panel,
.payment-reports-panel {
    overflow: hidden;
    border-radius: 20px;
}

.payment-panel-head {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(128, 143, 160, 0.05);
}

.payment-panel-head > div {
    min-width: 0;
}

.payment-panel-head > div > span {
    color: var(--muted);
    font-size: 10px;
}

.payment-panel-head h3 {
    margin: 5px 0 0;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.payment-panel-head > strong {
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #695f00;
    background: rgba(255, 231, 0, 0.24);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.payment-invoice-list,
.payment-report-list {
    display: grid;
    gap: 9px;
    padding: 16px 20px 20px;
}

.payment-invoice-card {
    width: 100%;
    min-height: 70px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 18px;
    gap: 11px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.payment-invoice-card:hover {
    border-color: rgba(255, 231, 0, 0.58);
    background: rgba(255, 231, 0, 0.08);
    box-shadow: 0 9px 20px rgba(31, 35, 48, 0.07);
    transform: translateY(-1px);
}

.payment-invoice-card:active {
    transform: scale(0.99);
}

.payment-invoice-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #756800;
    background: rgba(255, 231, 0, 0.2);
    font-size: 13px;
}

.payment-invoice-copy,
.payment-invoice-amount {
    min-width: 0;
}

.payment-invoice-copy strong,
.payment-invoice-copy small,
.payment-invoice-amount small,
.payment-invoice-amount strong {
    display: block;
}

.payment-invoice-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-invoice-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.payment-invoice-amount {
    text-align: right;
}

.payment-invoice-amount small {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.payment-invoice-amount strong {
    margin-top: 3px;
    color: var(--rose);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.payment-invoice-arrow {
    color: var(--muted);
    font-size: 11px;
    transition: color 0.18s, transform 0.18s;
}

.payment-invoice-card:hover .payment-invoice-arrow {
    color: var(--ink);
    transform: translateX(2px);
}

.payment-report-row {
    min-height: 73px;
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.payment-report-row:last-child {
    border-bottom: 0;
}

.payment-report-icon {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 12px;
}

.payment-report-icon.pending {
    color: #756800;
    background: rgba(255, 231, 0, 0.2);
}

.payment-report-icon.reviewed {
    color: var(--green);
    background: rgba(17, 151, 109, 0.11);
}

.payment-report-copy {
    min-width: 0;
}

.payment-report-copy strong,
.payment-report-copy span,
.payment-report-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-report-copy strong {
    color: var(--ink);
    font-size: 12px;
}

.payment-report-copy span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.payment-report-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.payment-report-row .status-pill {
    min-width: 76px;
    padding: 6px 7px;
    font-size: 10px;
}

.payment-empty-state {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 32px 18px 28px;
    text-align: center;
}

.payment-empty-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
    border-radius: 12px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.1);
    font-size: 16px;
}

.payment-empty-state strong {
    color: var(--ink);
    font-size: 13px;
}

.payment-empty-state p {
    max-width: 340px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.payment-form {
    gap: 14px;
}

.payment-form-intro {
    display: grid;
    gap: 4px;
    padding: 2px 0 4px;
}

.payment-form-intro span {
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.payment-form-intro strong {
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.payment-form-intro small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.payment-selected-card {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 231, 0, 0.34);
    border-radius: 13px;
    background: rgba(255, 231, 0, 0.11);
}

.payment-selected-card span,
.payment-selected-card strong,
.payment-selected-card small {
    display: block;
}

.payment-selected-card span {
    color: #756800;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.payment-selected-card span i {
    margin-right: 4px;
}

.payment-selected-card strong {
    color: var(--ink);
    font-size: 16px;
}

.payment-selected-card small {
    color: var(--muted);
    font-size: 11px;
}

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

.payment-field,
.payment-upload-field {
    min-width: 0;
}

.payment-field-wide {
    grid-column: 1 / -1;
}

.payment-field > span,
.payment-upload-field > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.payment-field > span small,
.payment-upload-field > span small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.payment-upload-field {
    padding: 12px;
    border: 1px dashed rgba(128, 143, 160, 0.55);
    border-radius: 12px;
    background: rgba(128, 143, 160, 0.05);
}

.payment-upload-field > span {
    justify-content: flex-start;
    margin-bottom: 8px;
}

.payment-upload-field > span i {
    color: var(--blue);
}

.payment-upload-field input[type="file"] {
    width: 100%;
    min-height: 38px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: var(--paper);
    font-size: 11px;
}

.payment-submit-btn {
    min-width: 160px;
}

.payment-form-feedback {
    min-height: 20px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.payment-form-feedback.is-pending { color: var(--blue); }
.payment-form-feedback.is-success { color: var(--green); }
.payment-form-feedback.is-error { color: var(--rose); }

html.portal-theme-light .payment-methods-card,
html.portal-theme-light .payment-due-card,
html.portal-theme-light .payment-guide-card,
html.portal-theme-light .payment-queue-panel,
html.portal-theme-light .payment-reports-panel {
    box-shadow: 0 12px 30px rgba(37, 49, 64, 0.07);
}

html.portal-theme-light .payment-methods-card {
    border-color: rgba(205, 177, 0, 0.32);
    background: rgba(244, 213, 0, 0.12);
}

html.portal-theme-light .payment-due-card {
    background:
        radial-gradient(circle at 92% 2%, rgba(244, 213, 0, 0.19), transparent 13rem),
        #ffffff;
}

html.portal-theme-light .payment-due-topline i {
    color: #5d5100;
}

html.portal-theme-light .payment-panel-head {
    background: #f6f8fa;
}

html.portal-theme-light .payment-invoice-card:hover {
    background: rgba(244, 213, 0, 0.09);
}

html.portal-theme-light .payment-selected-card {
    border-color: rgba(205, 177, 0, 0.35);
    background: rgba(244, 213, 0, 0.12);
}

html.portal-theme-dark .payment-panel-head > strong {
    border: 1px solid rgba(255, 231, 0, 0.32);
    color: var(--accent);
    background: rgba(255, 231, 0, 0.14);
}

html.portal-theme-dark .payment-methods-card {
    border-color: rgba(255, 231, 0, 0.32);
    background: rgba(255, 231, 0, 0.1);
}

html.portal-theme-dark .payment-privacy-icon {
    color: #242128;
    background: var(--accent);
}

html.portal-theme-dark .primary-btn,
html.portal-theme-dark .invoice-primary-action,
html.portal-theme-dark .athlete-carnet-action,
html.portal-theme-dark .payment-primary-action {
    color: #242128;
}

html.portal-theme-dark .payment-primary-action:disabled {
    color: var(--muted);
}

/* La tarjeta de resumen tiene menos ancho que el historial completo. */
.history-list .invoice-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(84px, auto);
    align-items: center;
    gap: 10px 12px;
    padding: 13px 0;
}

.history-list .invoice-row-main,
.history-list .invoice-row-copy {
    min-width: 0;
}

.history-list .invoice-row-amount {
    min-width: 0;
    max-width: 150px;
}

.history-list .invoice-row-amount strong,
.history-list .invoice-row-amount em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-list .invoice-actions {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.history-list .invoice-actions .status-pill {
    min-width: 0;
}

.history-list .invoice-actions .icon-action {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 820px) {
    .payment-section-intro,
    .payment-overview-grid,
    .payment-workspace {
        grid-template-columns: 1fr;
    }

    .payment-methods-card {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .payment-section-intro {
        gap: 15px;
    }

    .payment-due-card,
    .payment-guide-card {
        padding: 18px;
    }

    .payment-panel-head,
    .payment-invoice-list,
    .payment-report-list {
        padding-left: 16px;
        padding-right: 16px;
    }

    .payment-invoice-card {
        grid-template-columns: 35px minmax(0, 1fr) 16px;
        gap: 9px;
    }

    .payment-invoice-amount {
        grid-column: 2 / 3;
        text-align: left;
    }

    .payment-invoice-arrow {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .payment-form-grid {
        grid-template-columns: 1fr;
    }

    .payment-submit-btn {
        min-width: 0;
    }

    .history-list .invoice-actions {
        justify-content: flex-start;
    }

    .history-list .invoice-actions .icon-action span {
        display: none;
    }

    .history-list .invoice-actions .icon-action {
        width: 34px;
        padding: 0;
    }
}

/* Portal Familias · actividad interactiva */

.family-activity-interactive {
    width: 100%;
    grid-template-columns: 34px minmax(0, 1fr) auto 14px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    color: var(--ink);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.family-activity-interactive:hover {
    background: rgba(255, 231, 0, 0.08);
}

.family-activity-interactive:active {
    transform: scale(0.995);
}

.family-activity-interactive:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.family-activity-arrow {
    justify-self: end;
    color: var(--muted);
    font-size: 11px;
    transition: color 0.18s ease, transform 0.18s ease;
}

.family-activity-interactive:hover .family-activity-arrow {
    color: var(--ink);
    transform: translateX(2px);
}

.activity-detail {
    display: grid;
    gap: 15px;
}

.activity-detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
}

.activity-detail-hero > div {
    min-width: 0;
}

.activity-detail-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.activity-detail-hero h3 {
    margin: 6px 0 3px;
    color: var(--ink);
    font-family: Outfit, Inter, sans-serif;
    font-size: 24px;
    letter-spacing: -0.04em;
    line-height: 1;
}

.activity-detail-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.activity-detail-hero .status-pill {
    flex: 0 0 auto;
}

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

.activity-detail-field {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--paper);
}

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

.activity-detail-field span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.activity-detail-field strong {
    margin-top: 4px;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-detail-note,
.activity-detail-user-note {
    padding: 13px 14px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.08);
}

.activity-detail-note.rejected {
    border-color: rgba(214, 79, 98, 0.28);
    background: rgba(214, 79, 98, 0.09);
}

.activity-detail-note > span,
.activity-detail-user-note > span {
    display: block;
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.activity-detail-note.rejected > span {
    color: var(--rose);
}

.activity-detail-note p,
.activity-detail-user-note p {
    margin: 6px 0 0;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.activity-detail-user-note {
    border-color: var(--line);
    background: var(--soft);
}

.activity-detail-user-note > span {
    color: var(--muted);
}

.activity-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}

.activity-detail-link {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: var(--soft);
    font-size: 11px;
    font-weight: 900;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.activity-detail-link:hover {
    border-color: rgba(255, 231, 0, 0.55);
    background: var(--accent);
    transform: translateY(-1px);
}

.activity-detail-unavailable {
    align-self: center;
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 620px) {
    .family-activity-interactive {
        grid-template-columns: 34px minmax(0, 1fr) 14px;
    }

    .family-activity-interactive .status-pill {
        grid-column: 2;
        justify-self: start;
    }

    .family-activity-interactive .family-activity-arrow {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .activity-detail-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

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

    .activity-detail-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .activity-detail-actions > * {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================================
   Portal Familias · navegación móvil alineada con el ERP
   ===================================================================== */

.portal-mobile-bottom-nav,
.portal-mobile-menu-overlay,
.portal-mobile-menu-drawer {
    display: none;
}

@media (max-width: 980px) {
    .portal-page.modal-open .portal-mobile-bottom-nav {
        display: none;
    }

    .portal-page.portal-mobile-menu-open {
        overflow: hidden;
    }

    .portal-page .portal-main {
        padding-bottom: calc(112px + env(safe-area-inset-bottom));
    }

    .portal-page .menu-toggle {
        display: none !important;
    }

    .portal-page .portal-navigation {
        display: none !important;
    }

    .portal-mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 140;
        display: block;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid rgba(220, 227, 235, 0.95);
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(18px);
    }

    .portal-mobile-bottom-nav-inner {
        height: 64px;
        display: flex;
        align-items: flex-end;
        justify-content: space-around;
        padding: 12px 8px 8px;
    }

    .portal-mobile-nav-item {
        width: auto;
        min-height: 44px;
        display: flex;
        min-width: 0;
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        max-width: 64px;
        padding: 0;
        border: 0;
        color: #9aa2ae;
        background: transparent;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .portal-mobile-nav-item i {
        margin-bottom: 2px;
        font-size: 20px;
    }

    .portal-mobile-nav-item:hover,
    .portal-mobile-nav-item:focus-visible,
    .portal-mobile-nav-item.active {
        color: #242128;
    }

    .portal-mobile-nav-item:active {
        transform: scale(0.92);
    }

    .portal-mobile-nav-item.active i {
        color: #242128;
    }

    .portal-mobile-primary-wrap {
        position: relative;
        top: -24px;
        width: auto;
        height: 64px;
        display: flex;
        min-width: 0;
        flex: 1 1 0;
        align-items: center;
        justify-content: center;
        max-width: 64px;
    }

    .portal-mobile-primary {
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 999px;
        color: #242128;
        background: linear-gradient(135deg, var(--accent), #b2b5bc);
        box-shadow: 0 10px 20px rgba(255, 231, 0, 0.34);
        outline: 4px solid #f9fafb;
        font-size: 20px;
        transition: transform 0.2s ease, filter 0.2s ease;
    }

    .portal-mobile-primary:hover {
        filter: brightness(0.98);
        transform: translateY(-1px);
    }

    .portal-mobile-primary:active {
        transform: scale(0.95);
    }

    .portal-mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 150;
        display: block;
        opacity: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .portal-mobile-menu-overlay[hidden] {
        display: none;
    }

    .portal-mobile-menu-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .portal-mobile-menu-drawer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 160;
        display: block;
        max-height: 85dvh;
        overflow-y: auto;
        border-top: 1px solid #e5e7eb;
        border-radius: 24px 24px 0 0;
        background: #fff;
        box-shadow: 0 -16px 35px rgba(0, 0, 0, 0.2);
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .portal-mobile-menu-drawer.is-open {
        transform: translateY(0);
    }

    .portal-mobile-menu-handle {
        width: 100%;
        min-height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: sticky;
        top: 0;
        z-index: 1;
        padding: 12px 0;
        border: 0;
        background: #fff;
    }

    .portal-mobile-menu-handle span {
        width: 48px;
        height: 6px;
        display: block;
        border-radius: 999px;
        background: #dfe3e8;
    }

    .portal-mobile-menu-content {
        padding: 0 24px calc(28px + env(safe-area-inset-bottom));
    }

    .portal-mobile-athlete-card {
        display: grid;
        gap: 12px;
        margin-bottom: 22px;
        padding: 14px;
        border: 1px solid #eef0f3;
        border-radius: 16px;
        background: #f8fafc;
    }

    .portal-mobile-athlete-heading {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .portal-mobile-athlete-heading > div {
        min-width: 0;
        display: grid;
        gap: 2px;
    }

    .portal-mobile-athlete-heading span:not(.portal-mobile-athlete-avatar) {
        color: #788494;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .portal-mobile-athlete-heading strong {
        overflow: hidden;
        color: #242128;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-mobile-athlete-avatar {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        border-radius: 10px;
        color: #242128;
        background: var(--accent);
        font-size: 15px;
    }

    .portal-mobile-athlete-card select {
        width: 100%;
        min-height: 40px;
        border: 1px solid #dfe4ea;
        border-radius: 10px;
        color: #242128;
        background: #fff;
        font-size: 12px;
        font-weight: 800;
    }

    .portal-mobile-menu-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px 16px;
        padding-bottom: 24px;
    }

    .portal-mobile-menu-item {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 0;
        border: 0;
        color: #6f7480;
        background: transparent;
        font-size: 10px;
        font-weight: 600;
        line-height: 1.15;
        text-align: center;
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .portal-mobile-menu-item > span {
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        border: 1px solid #eef0f3;
        border-radius: 16px;
        color: #6f7480;
        background: #f8fafc;
        box-shadow: 0 2px 6px rgba(31, 35, 48, 0.04);
        font-size: 18px;
        transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }

    .portal-mobile-menu-item strong {
        max-width: 76px;
        font-size: 10px;
        font-weight: 600;
    }

    .portal-mobile-menu-item:hover,
    .portal-mobile-menu-item:focus-visible,
    .portal-mobile-menu-item.active {
        color: #242128;
    }

    .portal-mobile-menu-item:hover > span,
    .portal-mobile-menu-item:focus-visible > span,
    .portal-mobile-menu-item.active > span {
        border-color: rgba(255, 231, 0, 0.35);
        color: #242128;
        background: rgba(255, 231, 0, 0.2);
        transform: translateY(-1px);
    }

    .portal-mobile-menu-item:active > span {
        transform: scale(0.94);
    }

    .portal-mobile-menu-actions {
        display: grid;
        gap: 12px;
        padding: 16px 0 0;
        border-top: 1px solid #eef0f3;
    }

    .portal-mobile-install,
    .portal-mobile-menu-action {
        width: 100%;
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border: 0;
        border-radius: 12px;
        color: #6f7480;
        background: transparent;
        font-size: 13px;
        font-weight: 800;
    }

    .portal-mobile-install {
        color: #242128;
        background: rgba(255, 231, 0, 0.2);
        border: 1px solid rgba(255, 231, 0, 0.35);
    }

    .portal-mobile-menu-action > span {
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border: 1px solid #e2e6eb;
        border-radius: 999px;
        background: #fff;
    }

    .portal-mobile-menu-action:hover {
        color: #242128;
        background: #f5f7f9;
    }

    .portal-mobile-menu-action.danger {
        color: #d64f62;
    }

    .portal-mobile-menu-action.danger > span {
        color: #d64f62;
        background: #fff5f6;
        border-color: #f4d8dd;
    }

    html.portal-theme-dark .portal-mobile-bottom-nav {
        border-top-color: rgba(255, 255, 255, 0.05);
        background: rgba(36, 33, 40, 0.95);
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.18);
    }

    html.portal-theme-dark .portal-mobile-nav-item,
    html.portal-theme-dark .portal-mobile-menu-item {
        color: #8f939d;
    }

    html.portal-theme-dark .portal-mobile-nav-item:hover,
    html.portal-theme-dark .portal-mobile-nav-item:focus-visible,
    html.portal-theme-dark .portal-mobile-nav-item.active,
    html.portal-theme-dark .portal-mobile-menu-item:hover,
    html.portal-theme-dark .portal-mobile-menu-item:focus-visible,
    html.portal-theme-dark .portal-mobile-menu-item.active {
        color: #fff;
    }

    html.portal-theme-dark .portal-mobile-nav-item.active i {
        color: var(--accent);
    }

    html.portal-theme-dark .portal-mobile-menu-drawer,
    html.portal-theme-dark .portal-mobile-menu-handle {
        border-top-color: rgba(255, 255, 255, 0.1);
        background: #2f2b34;
    }

    html.portal-theme-dark .portal-mobile-primary {
        outline-color: #242128;
    }

    html.portal-theme-dark .portal-mobile-menu-handle span {
        background: rgba(255, 255, 255, 0.12);
    }

    html.portal-theme-dark .portal-mobile-athlete-card {
        border-color: rgba(255, 255, 255, 0.08);
        background: rgba(0, 0, 0, 0.16);
    }

    html.portal-theme-dark .portal-mobile-athlete-heading span:not(.portal-mobile-athlete-avatar) {
        color: #9da1aa;
    }

    html.portal-theme-dark .portal-mobile-athlete-heading strong,
    html.portal-theme-dark .portal-mobile-menu-item.active > span {
        color: #fff;
    }

    html.portal-theme-dark .portal-mobile-athlete-card select {
        border-color: rgba(255, 255, 255, 0.1);
        color: #fff;
        background: #242128;
    }

    html.portal-theme-dark .portal-mobile-menu-item > span {
        border-color: rgba(255, 255, 255, 0.07);
        color: #b2b5bc;
        background: rgba(255, 255, 255, 0.05);
        box-shadow: none;
    }

    html.portal-theme-dark .portal-mobile-menu-item:hover > span,
    html.portal-theme-dark .portal-mobile-menu-item:focus-visible > span,
    html.portal-theme-dark .portal-mobile-menu-item.active > span {
        border-color: rgba(255, 231, 0, 0.3);
        color: var(--accent);
        background: rgba(255, 231, 0, 0.14);
    }

    html.portal-theme-dark .portal-mobile-menu-actions {
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    html.portal-theme-dark .portal-mobile-menu-action:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.06);
    }

    html.portal-theme-dark .portal-mobile-menu-action > span {
        border-color: rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.05);
    }
}

/* =====================================================================
   Portal Familias · login web renovado
   ===================================================================== */

.auth-shell {
    position: relative;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1.12fr) minmax(430px, 520px);
    overflow: hidden;
    background: #242128;
}

.auth-brand {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    justify-content: center;
    overflow: hidden;
    padding: clamp(48px, 8vw, 112px);
    background: #242128;
}

.auth-brand::before {
    content: "";
    position: absolute;
    z-index: -2;
    width: min(54vw, 720px);
    height: min(54vw, 720px);
    right: -18%;
    bottom: -28%;
    border-radius: 50%;
    background: rgba(255, 231, 0, 0.16);
    filter: blur(2px);
}

.auth-brand::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: 0.26;
    background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-position: 0 0, 0 0;
    background-size: 54px 54px;
    mask-image: linear-gradient(135deg, black 0%, transparent 72%);
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.brand-mark {
    width: 76px;
    height: 76px;
    margin-bottom: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
}

.brand-mark img {
    width: 54px;
    height: 54px;
}

.auth-brand .eyebrow {
    margin-bottom: 16px;
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 0.2em;
}

.auth-brand h1 {
    max-width: 650px;
    font-size: clamp(52px, 7vw, 96px);
    line-height: 0.94;
    letter-spacing: -0.065em;
    text-wrap: balance;
}

.auth-brand h1 em {
    color: var(--accent);
    font-style: normal;
}

.brand-copy {
    max-width: 500px;
    margin-top: 28px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.65;
}

.brand-points {
    gap: 8px;
    margin-top: 28px;
}

.brand-points span {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.07);
    font-size: 11px;
    letter-spacing: 0.01em;
}

.brand-points span i {
    color: var(--accent);
    font-size: 10px;
}

.auth-brand-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    max-width: 650px;
    margin-top: clamp(44px, 8vh, 90px);
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.auth-brand-footer span:first-child {
    color: rgba(255, 255, 255, 0.72);
}

.auth-brand-footer i {
    margin-right: 5px;
    color: var(--accent);
}

.auth-panel {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    justify-content: center;
    padding: clamp(30px, 5vw, 68px) clamp(24px, 5vw, 56px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background: #2f2b34;
}

.auth-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
}

.auth-panel-header,
.auth-panel > .auth-tabs,
.auth-panel > .auth-form,
.auth-panel > .install-btn,
.auth-panel > .auth-security-note {
    width: min(100%, 420px);
    margin-right: auto;
    margin-left: auto;
}

.auth-panel-header {
    margin-bottom: 28px;
}

.auth-panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-panel-kicker i {
    font-size: 10px;
}

.auth-panel-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(28px, 3vw, 36px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.auth-panel-header p {
    max-width: 350px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.auth-tabs {
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    border-color: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.05);
}

.auth-tabs button {
    min-height: 43px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-tabs button:hover {
    color: var(--ink);
}

.auth-tabs button:active {
    transform: scale(0.98);
}

.auth-tabs button.active {
    color: #242128;
    background: var(--accent);
    box-shadow: 0 9px 20px rgba(255, 231, 0, 0.14);
}

.auth-form {
    gap: 16px;
}

.auth-field {
    gap: 8px;
    color: var(--ink);
    font-size: 11px;
    letter-spacing: 0.02em;
}

.auth-input-wrap {
    position: relative;
    display: block;
}

.auth-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    color: var(--muted);
    font-size: 13px;
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-input-wrap input {
    min-height: 52px;
    padding: 0 15px 0 42px;
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--ink);
    background: #242128;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.12);
}

.auth-input-wrap input:focus {
    border-color: rgba(255, 231, 0, 0.72);
    box-shadow: 0 0 0 3px rgba(255, 231, 0, 0.11), inset 0 1px 1px rgba(0, 0, 0, 0.12);
}

.auth-input-wrap:focus-within > i {
    color: var(--accent);
}

.primary-btn {
    min-height: 52px;
    margin-top: 5px;
    border-radius: 12px;
    font-size: 13px;
    box-shadow: 0 14px 28px rgba(255, 231, 0, 0.14);
}

.remember-row {
    margin-top: -2px;
    font-size: 11px;
}

.form-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-top: 2px;
    font-size: 11px;
    line-height: 1.5;
}

.form-note i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--accent);
}

.auth-text-btn {
    justify-self: center;
    min-height: 36px;
    padding: 4px 8px;
    border: 0;
    color: var(--accent);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.auth-text-btn:hover,
.auth-text-btn:focus-visible {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-text-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.auth-feedback {
    min-height: 18px;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.auth-feedback.is-error { color: #fca5a5; }
.auth-feedback.is-success { color: #86efac; }

.auth-form button:disabled {
    cursor: wait;
    opacity: .65;
}

.auth-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 20px;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

.auth-security-note i {
    color: var(--green);
}

html.portal-theme-light .auth-panel {
    border-left-color: #dce3eb;
    background: #ffffff;
}

html.portal-theme-light .auth-panel::before {
    background: #f4d500;
}

html.portal-theme-light .auth-tabs {
    border-color: #dce3eb;
    background: #f1f4f7;
}

html.portal-theme-light .auth-tabs button.active {
    color: #242128;
    background: #f4d500;
}

html.portal-theme-light .auth-input-wrap input {
    border-color: #dce3eb;
    color: #20252d;
    background: #f7f9fb;
    box-shadow: none;
}

html.portal-theme-light .auth-input-wrap input:focus {
    border-color: #c7aa00;
    box-shadow: 0 0 0 3px rgba(244, 213, 0, 0.16);
}

html.portal-theme-light .auth-text-btn { color: #826a00; }
html.portal-theme-light .auth-text-btn:hover,
html.portal-theme-light .auth-text-btn:focus-visible { color: #20252d; }
html.portal-theme-light .auth-feedback.is-error { color: #b42318; }
html.portal-theme-light .auth-feedback.is-success { color: #177245; }

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

    .auth-brand {
        min-height: auto;
        padding: 52px 28px 42px;
    }

    .auth-brand h1 {
        font-size: clamp(48px, 11vw, 76px);
    }

    .auth-brand-footer {
        margin-top: 42px;
    }

    .auth-panel {
        min-height: auto;
        padding: 42px 28px 52px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-left: 0;
    }
}

@media (max-width: 560px) {
    .auth-brand {
        padding: 38px 20px 34px;
    }

    .brand-mark {
        width: 64px;
        height: 64px;
        margin-bottom: 26px;
        border-radius: 18px;
    }

    .brand-mark img {
        width: 46px;
        height: 46px;
    }

    .auth-brand h1 {
        font-size: 52px;
    }

    .brand-copy {
        margin-top: 20px;
        font-size: 14px;
    }

    .brand-points {
        margin-top: 22px;
    }

    .brand-points span {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
        padding: 0 8px;
    }

    .auth-brand-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        margin-top: 30px;
    }

    .auth-panel {
        padding: 34px 20px 44px;
    }

    .auth-panel-header {
        margin-bottom: 22px;
    }

    .auth-panel-header h2 {
        font-size: 30px;
    }
}

/* =====================================================================
   Portal Familias · mensajería alineada con el ERP
   ===================================================================== */

#erpMessagingPage {
    --messaging-line: rgba(36, 33, 40, .1);
    --messaging-muted: #6f7480;
    --messaging-paper: #fff;
    --messaging-soft: #f5f7fb;
    --messaging-accent: #ffe700;
}

#erpMessagingPage .family-message-toolbar-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid var(--messaging-line);
    border-radius: 11px;
    color: #4d5360;
    background: #fff;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, filter .18s ease;
}

#erpMessagingPage .family-message-toolbar-btn:hover,
#erpMessagingPage .family-message-toolbar-btn:focus-visible {
    border-color: rgba(216, 189, 0, .65);
    background: #fffdf0;
    transform: translateY(-1px);
}

#erpMessagingPage .family-message-toolbar-btn.accent {
    border-color: rgba(255, 231, 0, .45);
    color: #242128;
    background: var(--messaging-accent);
    box-shadow: 0 8px 20px rgba(255, 231, 0, .16);
}

#erpMessagingPage .family-message-toolbar-btn.accent:hover,
#erpMessagingPage .family-message-toolbar-btn.accent:focus-visible {
    filter: brightness(.97);
    background: var(--messaging-accent);
}

#erpMessagingPage .family-message-search-label {
    position: relative;
    display: block;
}

#erpMessagingPage .family-message-search-label > i {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: var(--messaging-muted);
    font-size: 11px;
    transform: translateY(-50%);
    pointer-events: none;
}

#erpMessagingPage .family-message-search-label input {
    min-height: 42px;
    padding: 0 12px 0 35px;
    border-color: var(--messaging-line) !important;
    border-radius: 11px;
    background: rgba(255, 255, 255, .72) !important;
    color: #242128;
    font-size: 12px;
}

#erpMessagingPage .family-message-search-label input:focus {
    border-color: rgba(216, 189, 0, .75) !important;
    box-shadow: 0 0 0 3px rgba(255, 231, 0, .14);
}

#erpMessagingPage .erp-messaging-inbox-list > button.family-message-conversation {
    width: 100%;
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 12px;
    border: 1px solid transparent !important;
    color: var(--ink);
    background: transparent;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

#erpMessagingPage .family-message-conversation:hover,
#erpMessagingPage .family-message-conversation:focus-visible {
    border-color: var(--messaging-line) !important;
    background: rgba(255, 255, 255, .72);
    transform: translateY(-1px);
}

#erpMessagingPage .family-message-conversation.is-active {
    border-color: rgba(255, 231, 0, .42) !important;
    background: rgba(255, 231, 0, .12);
}

#erpMessagingPage .family-message-avatar {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 231, 0, .4);
    border-radius: 12px;
    color: #242128;
    background: rgba(255, 231, 0, .72);
    font-size: 13px;
}

#erpMessagingPage .family-message-row-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

#erpMessagingPage .family-message-row-copy strong,
#erpMessagingPage .family-message-row-copy small,
#erpMessagingPage .family-message-row-copy em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#erpMessagingPage .family-message-row-copy strong {
    display: flex;
    align-items: center;
    min-width: 0;
    color: #242128;
    font-size: 12px;
    font-weight: 900;
}

#erpMessagingPage .family-message-row-copy small {
    color: var(--messaging-muted);
    font-size: 11px;
}

#erpMessagingPage .family-message-row-copy em {
    color: var(--messaging-muted);
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
}

#erpMessagingPage .family-message-conversation > time {
    align-self: start;
    color: var(--messaging-muted);
    font-size: 9px;
    white-space: nowrap;
}

#erpMessagingPage .family-message-unread {
    min-width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 99px;
    color: #242128;
    background: var(--messaging-accent);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

#erpMessagingPage .family-message-empty-list,
#erpMessagingPage .family-message-loading {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 2.5rem 1rem;
    color: var(--messaging-muted);
    text-align: center;
    font-size: 12px;
}

#erpMessagingPage .family-message-empty-list i,
#erpMessagingPage .family-message-loading i {
    margin-bottom: 4px;
    color: var(--messaging-accent);
    font-size: 24px;
}

#erpMessagingPage .family-message-empty-list p {
    margin: 0;
    color: #242128;
    font-weight: 900;
}

#erpMessagingPage .family-message-empty-list small {
    max-width: 24ch;
    line-height: 1.45;
}

#erpMessagingPage .family-message-empty-list.is-error i {
    color: #d64f62;
}

#erpMessagingPage .family-message-empty-list.is-error p {
    color: #b42318;
}

#erpMessagingPage .erp-thread-empty p {
    margin: 0;
    color: #242128;
    font-size: .86rem;
    font-weight: 900;
}

#erpMessagingPage .erp-thread-empty span:not(.erp-thread-empty-mark) {
    display: block;
    margin-top: 5px;
    color: var(--messaging-muted);
    font-size: .72rem;
}

#erpMessagingPage .erp-thread-readonly i {
    margin-right: 5px;
    color: var(--messaging-accent);
}

#erpMessagingPage .family-message-send {
    display: grid;
    place-items: center;
    color: #242128;
    background: var(--messaging-accent);
    box-shadow: 0 8px 18px rgba(255, 231, 0, .14);
    transition: transform .18s ease, filter .18s ease;
}

#erpMessagingPage .family-message-send:hover,
#erpMessagingPage .family-message-send:focus-visible {
    filter: brightness(.96);
    transform: translateY(-1px);
}

.family-message-composer-form {
    display: grid;
    gap: 15px;
}

.family-message-compose-context {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--soft);
}

.family-message-compose-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    color: #242128;
    background: var(--accent);
}

.family-message-compose-context > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.family-message-compose-context span:not(.family-message-compose-icon) {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.family-message-compose-context strong {
    color: var(--ink);
    font-size: 14px;
}

.family-message-compose-context small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.family-message-confirm {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 8px 0 2px;
    text-align: center;
}

.family-message-confirm-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #b42318;
    background: rgba(214, 79, 98, .12);
    font-size: 20px;
}

.family-message-confirm h3,
.family-message-confirm p {
    margin: 0;
}

.family-message-confirm h3 {
    color: var(--ink);
    font-size: 17px;
}

.family-message-confirm p {
    max-width: 42ch;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.family-message-confirm .modal-actions {
    width: 100%;
    margin-top: 6px;
}

.family-message-confirm .danger-action {
    color: #fff;
    background: #d64f62;
    box-shadow: 0 8px 18px rgba(214, 79, 98, .16);
}

html.portal-theme-dark #erpMessagingPage {
    --messaging-line: rgba(255, 255, 255, .1);
    --messaging-muted: #b2b5bc;
    --messaging-paper: #2f2b34;
    --messaging-soft: rgba(0, 0, 0, .18);
}

html.portal-theme-dark #erpMessagingPage .family-message-toolbar-btn,
html.portal-theme-dark #erpMessagingPage .family-message-search-label input {
    color: #fff;
    background: rgba(255, 255, 255, .05) !important;
}

html.portal-theme-dark #erpMessagingPage .family-message-toolbar-btn:hover,
html.portal-theme-dark #erpMessagingPage .family-message-toolbar-btn:focus-visible {
    border-color: rgba(255, 231, 0, .55);
    background: rgba(255, 231, 0, .1) !important;
}

html.portal-theme-dark #erpMessagingPage .family-message-toolbar-btn.accent {
    color: #242128;
    background: var(--messaging-accent) !important;
}

html.portal-theme-dark #erpMessagingPage .family-message-row-copy strong,
html.portal-theme-dark #erpMessagingPage .family-message-empty-list p,
html.portal-theme-dark #erpMessagingPage .erp-thread-empty p,
html.portal-theme-dark #erpMessagingPage .erp-messaging-pagebar-copy h1,
html.portal-theme-dark #erpMessagingPage .erp-messaging-inbox-head strong,
html.portal-theme-dark #erpMessagingPage .erp-thread-copy h2 {
    color: #fff;
}

html.portal-theme-dark #erpMessagingPage .family-message-conversation:hover,
html.portal-theme-dark #erpMessagingPage .family-message-conversation:focus-visible {
    background: rgba(255, 255, 255, .06);
}

html.portal-theme-dark #erpMessagingPage .erp-thread-messages {
    background-color: #242128;
    background-image: radial-gradient(rgba(255, 255, 255, .035) .7px, transparent .7px);
}

html.portal-theme-dark #erpMessagingPage .erp-thread-message-bubble {
    background: rgba(255, 255, 255, .07);
    box-shadow: none;
}

html.portal-theme-dark #erpMessagingPage .erp-thread-message-bubble p {
    color: #f8f9fc;
}

html.portal-theme-dark #erpMessagingPage .erp-thread-composer textarea {
    color: #fff;
    background: rgba(0, 0, 0, .18) !important;
}

html.portal-theme-dark .family-message-compose-context {
    border-color: var(--line);
    background: rgba(255, 255, 255, .05);
}

html.portal-theme-dark .family-message-compose-context strong,
html.portal-theme-dark .family-message-confirm h3 {
    color: #fff;
}

html.portal-theme-dark .family-message-confirm-icon {
    color: #f08b8b;
    background: rgba(240, 139, 139, .13);
}

@media (max-width: 640px) {
    #erpMessagingPage .family-message-toolbar-btn {
        flex: 1 1 0;
        padding: 0 10px;
    }

    #erpMessagingPage .erp-messaging-shell {
        min-height: 460px;
    }
}

/* =====================================================================
   Portal Familias · navegación lateral independiente
   ===================================================================== */

.portal-sidebar-brand {
    display: none;
}

.portal-boot-screen {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #fff;
    background: #242128;
}

.portal-boot-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.portal-boot-mark {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.portal-boot-mark img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.portal-boot-card strong {
    font-family: Outfit, Inter, sans-serif;
    font-size: 17px;
}

.portal-boot-card small {
    color: rgba(255, 255, 255, 0.56);
    font-size: 12px;
}

html.portal-theme-light .portal-boot-screen {
    color: #242128;
    background: #f1f4f7;
}

html.portal-theme-light .portal-boot-mark {
    border-color: #dce3eb;
    background: #fff;
}

html.portal-theme-light .portal-boot-card small {
    color: #788494;
}

@media (min-width: 981px) {
    .portal-page {
        --portal-sidebar-width: 264px;
    }

    .portal-topbar {
        width: calc(100% - var(--portal-sidebar-width));
        margin-left: var(--portal-sidebar-width);
    }

    .portal-topbar-inner {
        min-height: 78px;
        padding-right: clamp(20px, 3vw, 38px);
        padding-left: clamp(20px, 3vw, 38px);
    }

    .portal-topbar .topbar-brand {
        display: none;
    }

    .portal-topbar .topbar-page-context {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    .portal-navigation {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 120;
        width: var(--portal-sidebar-width);
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        border-top: 0;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: 0;
        background: #242128;
        box-shadow: 10px 0 28px rgba(18, 16, 21, 0.1);
    }

    .portal-navigation-inner {
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        margin: 0;
        padding: 22px 14px 18px;
    }

    .portal-sidebar-brand {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 2px 8px;
        color: #fff;
        text-decoration: none;
    }

    .portal-sidebar-brand-mark {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.07);
    }

    .portal-sidebar-brand-mark img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }

    .portal-sidebar-brand-copy {
        min-width: 0;
        display: grid;
        gap: 3px;
    }

    .portal-sidebar-brand-copy strong {
        overflow: hidden;
        color: #fff;
        font-family: Outfit, Inter, sans-serif;
        font-size: 15px;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-sidebar-brand-copy small {
        color: rgba(255, 255, 255, 0.5);
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .portal-sidebar-divider {
        height: 1px;
        margin: 22px 8px 16px;
        background: rgba(255, 255, 255, 0.1);
    }

    .portal-top-nav {
        width: 100%;
        display: grid;
        flex: 0 0 auto;
        gap: 5px;
        overflow: visible;
    }

    .portal-top-nav button {
        width: 100%;
        min-height: 45px;
        justify-content: flex-start;
        padding: 0 13px;
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.58);
        font-size: 12px;
    }

    .portal-top-nav button::after {
        display: none;
    }

    .portal-top-nav button i {
        width: 19px;
        color: rgba(255, 255, 255, 0.46);
        font-size: 14px;
    }

    .portal-top-nav button:hover,
    .portal-top-nav button:focus-visible {
        color: #fff;
        background: rgba(255, 255, 255, 0.07);
    }

    .portal-top-nav button:hover i,
    .portal-top-nav button:focus-visible i,
    .portal-top-nav button.active i {
        color: var(--accent);
    }

    .portal-top-nav button.active {
        color: #fff;
        background: rgba(255, 231, 0, 0.14);
        box-shadow: inset 3px 0 0 var(--accent);
    }

    .portal-nav-athlete-context {
        width: 100%;
        max-width: none;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 9px;
        margin: auto 0 0;
        padding: 17px 4px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 0;
    }

    .portal-nav-athlete-label,
    .portal-nav-athlete-context select,
    .portal-nav-count {
        grid-column: 1 / -1;
    }

    .portal-nav-athlete-context select {
        width: 100%;
        height: 40px;
        border-radius: 10px;
        background-color: rgba(255, 255, 255, 0.08);
    }

    .portal-nav-count {
        text-align: right;
    }

    .portal-layout {
        min-height: calc(100vh - 78px);
        margin-left: var(--portal-sidebar-width);
    }

    .portal-main {
        max-width: 1360px;
        padding-top: 32px;
    }

    html.portal-theme-light .portal-navigation {
        border-right-color: #dce3eb;
        background: #fff;
        box-shadow: 10px 0 28px rgba(37, 49, 64, 0.07);
    }

    html.portal-theme-light .portal-sidebar-brand {
        color: var(--ink);
    }

    html.portal-theme-light .portal-sidebar-brand-mark {
        border-color: #dce3eb;
        background: #f4f6f8;
    }

    html.portal-theme-light .portal-sidebar-brand-copy strong {
        color: var(--ink);
    }

    html.portal-theme-light .portal-sidebar-brand-copy small {
        color: #788494;
    }

    html.portal-theme-light .portal-sidebar-divider {
        background: #e3e8ee;
    }

    html.portal-theme-light .portal-top-nav button {
        color: #687383;
    }

    html.portal-theme-light .portal-top-nav button i {
        color: #8b97a5;
    }

    html.portal-theme-light .portal-top-nav button:hover,
    html.portal-theme-light .portal-top-nav button:focus-visible {
        color: var(--ink);
        background: #f3f6f8;
    }

    html.portal-theme-light .portal-top-nav button.active {
        color: var(--ink);
        background: rgba(244, 213, 0, 0.17);
    }

    html.portal-theme-light .portal-nav-athlete-context {
        border-top-color: #dce3eb;
    }
}
/* =====================================================================
   Portal Familias · mensajería sin desplazamiento de página
   ===================================================================== */

.portal-page.portal-messages-active {
    overflow: hidden;
}

.portal-page .portal-floating-messaging-dock {
    z-index: 181;
}

.portal-page .portal-messaging-widget {
    z-index: 180;
}

.portal-messaging-widget .erp-widget-compose label {
    color: #6f7480;
    font-size: .68rem;
    font-weight: 800;
}

.portal-messaging-widget .erp-widget-compose .primary {
    color: #242128;
    background: #ffe700;
}

.portal-messaging-widget .erp-widget-compose .secondary {
    color: #6f7480;
    background: rgba(36, 33, 40, .07);
}

.portal-messaging-widget .erp-widget-thread-readonly {
    flex: 0 0 auto;
    padding: .65rem .8rem;
    border-top: 1px solid rgba(36, 33, 40, .09);
    color: #6f7480;
    background: #fff;
    font-size: .65rem;
}

.portal-messaging-widget .erp-widget-thread-readonly i {
    margin-right: .3rem;
    color: #d8bd00;
}

html.portal-theme-dark .portal-messaging-widget .erp-widget-compose label,
html.portal-theme-dark .portal-messaging-widget .erp-widget-compose .secondary {
    color: #b2b5bc;
}

html.portal-theme-dark .portal-messaging-widget .erp-widget-thread-readonly {
    border-top-color: rgba(255, 255, 255, .09);
    color: #b2b5bc;
    background: #2f2b34;
}

@media (min-width: 981px) {
    .portal-page.portal-messages-active .portal-main {
        height: calc(100dvh - 78px);
        max-width: 1440px;
        overflow: hidden;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .portal-page.portal-messages-active .family-messaging-page {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .portal-page.portal-messages-active .family-messaging-page .erp-messaging-pagebar {
        flex: 0 0 auto;
        margin-bottom: 12px;
    }

    .portal-page.portal-messages-active .family-messaging-page .erp-messaging-shell {
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
    }
}

@media (max-width: 980px) {
    .portal-page.portal-messages-active .portal-main {
        height: calc(100dvh - 64px);
        overflow: hidden;
        padding: 14px 12px calc(80px + env(safe-area-inset-bottom));
    }

    .portal-page.portal-messages-active .family-messaging-page {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .portal-page.portal-messages-active .family-messaging-page .erp-messaging-pagebar {
        flex: 0 0 auto;
        margin-bottom: 10px;
    }

    .portal-page.portal-messages-active .family-messaging-page .erp-messaging-shell {
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
    }

    .portal-page .portal-floating-messaging-dock {
        right: .8rem;
        bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }

    .portal-page .portal-messaging-widget {
        bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 680px) {
    .portal-page .portal-messaging-widget {
        right: .5rem;
        width: calc(100vw - 1rem);
        height: calc(100dvh - 6.8rem - env(safe-area-inset-bottom));
        min-height: 0;
        border-radius: 1.15rem;
    }

    .portal-page.portal-messages-active .family-messaging-page .erp-messaging-pagebar-actions {
        width: 100%;
    }
}



/* =====================================================================
   Portal Familias · autenticación y recuperación
   ===================================================================== */

:root {
    --auth-bg: #07111f;
    --auth-surface: rgba(10, 19, 33, 0.84);
    --auth-primary: var(--accent, #ffe500);
    --auth-text: #ffffff;
    --auth-muted: #b5bfce;
    --auth-border: rgba(255, 255, 255, 0.16);
    --auth-success: #83e9b0;
}

#authView.auth-shell {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(420px, 1fr);
    gap: clamp(20px, 4vw, 68px);
    min-height: 100dvh;
    padding: clamp(24px, 4vw, 72px);
    overflow: hidden;
    color: var(--auth-text);
    background-color: var(--auth-bg);
    background-image: url("../img/portal-familias-auth-bg.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

#authView.auth-shell::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(7, 17, 31, 0.24) 0%, rgba(7, 17, 31, 0.18) 42%, rgba(7, 17, 31, 0.38) 62%, rgba(7, 17, 31, 0.2) 100%),
        linear-gradient(0deg, rgba(7, 17, 31, 0.35), transparent 32%, transparent 76%, rgba(7, 17, 31, 0.14));
}

#authView.auth-shell > * { position: relative; z-index: 1; }

#authView .auth-brand {
    min-width: 0;
    min-height: 0;
    padding: clamp(24px, 4vw, 64px);
    color: var(--auth-text);
    background: linear-gradient(90deg, rgba(7, 17, 31, 0.26), rgba(7, 17, 31, 0.02) 88%);
}

#authView .auth-brand::before,
#authView .auth-brand::after { display: none; }

#authView .brand-mark {
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
    margin-top: auto;
    margin-bottom: 22px;
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    background: rgba(10, 19, 33, 0.55);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#authView .brand-mark img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

#authView .auth-brand .eyebrow {
    margin-bottom: 14px;
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.22em;
}

#authView .auth-brand h1 {
    max-width: 560px;
    color: var(--auth-text);
    font-family: 'Outfit', Inter, sans-serif;
    font-size: clamp(58px, 6.8vw, 96px);
    font-weight: 800;
    line-height: 0.94;
    letter-spacing: -0.065em;
    text-wrap: balance;
}

#authView .auth-brand h1 em {
    color: var(--auth-primary);
    font-style: normal;
}

#authView .brand-copy {
    max-width: 500px;
    margin: 22px 0 0;
    color: rgba(235, 241, 250, 0.84);
    font-size: clamp(15px, 1.35vw, 18px);
    line-height: 1.58;
}

#authView .brand-points {
    gap: 9px;
    margin-top: 22px;
}

#authView .brand-points span {
    min-height: 44px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.94);
    background: rgba(10, 19, 33, 0.54);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12px;
}

#authView .brand-points span i {
    color: var(--auth-primary);
    font-size: 14px;
}

#authView .auth-brand-footer {
    width: 100%;
    max-width: 650px;
    margin-top: auto;
    padding-top: 15px;
    border-top-color: rgba(255, 255, 255, 0.2);
    color: rgba(235, 241, 250, 0.76);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
}

#authView .auth-brand-footer span:first-child { color: rgba(255, 255, 255, 0.94); }
#authView .auth-brand-footer i { color: var(--auth-primary); }

#authView .auth-panel {
    align-self: center;
    width: min(100%, 600px);
    min-width: 0;
    min-height: 0;
    max-height: calc(100dvh - 48px);
    justify-self: center;
    overflow-y: auto;
    padding: clamp(34px, 4vw, 56px);
    border: 1px solid var(--auth-border);
    border-radius: 28px;
    background: var(--auth-surface);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
}

#authView .auth-panel::before {
    top: 0;
    right: 0;
    left: auto;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--auth-primary));
    box-shadow: 0 0 20px rgba(255, 229, 0, 0.72);
}

#authView .auth-panel-header,
#authView .auth-panel > .auth-tabs,
#authView .auth-panel > .auth-form,
#authView .auth-panel > .install-btn,
#authView .auth-panel > .auth-security-note {
    width: 100%;
    max-width: 480px;
}

#authView .auth-panel-header { margin-bottom: 28px; }

#authView .auth-panel-kicker {
    margin-bottom: 13px;
    color: var(--auth-primary);
    font-size: 11px;
    letter-spacing: 0.18em;
}

#authView .auth-panel-kicker i { display: none; }

#authView .auth-panel-header h2 {
    color: var(--auth-text);
    font-family: 'Outfit', Inter, sans-serif;
    font-size: clamp(32px, 3vw, 40px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.045em;
}

#authView .auth-panel-header p {
    max-width: 420px;
    margin-top: 14px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.65;
}

#authView .auth-field { color: var(--auth-text); font-size: 13px; }

#authView .auth-input-wrap input {
    min-height: 58px;
    border: 1px solid rgba(181, 191, 206, 0.46);
    border-radius: 12px;
    color: var(--auth-text);
    background: rgba(7, 17, 31, 0.56);
    font-size: 15px;
}

#authView .auth-input-wrap input:focus-visible {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(255, 229, 0, 0.16);
}

#authView .auth-input-wrap > i { color: #b5bfce; }
#authView .auth-input-wrap:focus-within > i { color: var(--auth-primary); }

#authView .primary-btn {
    min-height: 58px;
    margin-top: 3px;
    border-radius: 12px;
    color: #111827;
    background: var(--auth-primary);
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(255, 229, 0, 0.19);
    transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

#authView .primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.025);
    box-shadow: 0 16px 36px rgba(255, 229, 0, 0.25);
}

#authView .primary-btn:active:not(:disabled) { transform: scale(0.99); }
#authView .primary-btn:disabled { cursor: wait; opacity: 0.76; }

#authView .auth-recovery-note {
    margin: -2px 0 0;
    color: var(--auth-success);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

#authView .auth-feedback {
    min-height: 18px;
    margin: 0;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.55;
}

#authView .auth-feedback.is-success { color: var(--auth-success); }
#authView .auth-feedback.is-error { color: #ff9da8; }

#authView #passwordRecoveryForm [data-auth-return] {
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--auth-primary);
    font-size: 14px;
}

#authView .auth-text-btn:focus-visible,
#authView .primary-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 4px;
}

#authView .auth-security-note {
    margin-top: 24px;
    color: rgba(235, 241, 250, 0.78);
    font-size: 12px;
    line-height: 1.5;
}

#authView .auth-security-note i { color: var(--auth-success); }

#authView .auth-brand > *,
#authView .auth-panel {
    animation: auth-enter 560ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

#authView .auth-brand > *:not(.auth-brand-footer) { animation-delay: 50ms; }
#authView .auth-panel { animation-delay: 100ms; }

@keyframes auth-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

html.portal-theme-light #authView .auth-panel {
    border-color: var(--auth-border);
    background: var(--auth-surface);
}

html.portal-theme-light #authView .auth-panel-header h2,
html.portal-theme-light #authView .auth-field,
html.portal-theme-light #authView .auth-security-note { color: var(--auth-text); }

html.portal-theme-light #authView .auth-panel-header p { color: var(--auth-muted); }

html.portal-theme-light #authView .auth-input-wrap input {
    border-color: rgba(181, 191, 206, 0.46);
    color: var(--auth-text);
    background: rgba(7, 17, 31, 0.56);
}

html.portal-theme-light #authView .auth-recovery-note { color: var(--auth-success); }
html.portal-theme-light #authView .auth-feedback.is-success { color: var(--auth-success); }
html.portal-theme-light #authView .auth-feedback.is-error { color: #ff9da8; }

@media (max-width: 980px) {
    #authView.auth-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 24px clamp(18px, 6vw, 56px);
        overflow: visible;
        background-position: 68% center;
    }

    #authView .auth-brand {
        min-height: 0;
        padding: 34px clamp(8px, 4vw, 36px) 28px;
    }

    #authView .brand-mark { margin-top: 0; }
    #authView .auth-brand-footer { margin-top: 30px; }

    #authView .auth-panel {
        width: min(100%, 600px);
        max-height: none;
        margin: 0 auto 24px;
    }
}

@media (max-width: 767px) {
    #authView.auth-shell {
        min-height: 100dvh;
        padding: 16px 14px max(18px, env(safe-area-inset-bottom));
        background-position: 73% top;
    }

    #authView.auth-shell::before {
        background:
            linear-gradient(180deg, rgba(7, 17, 31, 0.25), rgba(7, 17, 31, 0.68) 27%, rgba(7, 17, 31, 0.5)),
            linear-gradient(90deg, rgba(7, 17, 31, 0.18), rgba(7, 17, 31, 0.2));
    }

    #authView .auth-brand { padding: 14px 10px 20px; }
    #authView .brand-mark {
        width: 56px;
        height: 56px;
        margin-bottom: 17px;
        border-radius: 16px;
    }
    #authView .brand-mark img { width: 42px; height: 42px; }
    #authView .auth-brand .eyebrow { margin-bottom: 10px; font-size: 10px; }
    #authView .auth-brand h1 { max-width: 400px; font-size: clamp(42px, 12vw, 58px); }
    #authView .brand-copy { max-width: 440px; margin-top: 14px; font-size: 14px; }
    #authView .brand-points { gap: 6px; margin-top: 15px; }
    #authView .brand-points span { min-height: 36px; padding: 0 10px; border-radius: 11px; font-size: 10px; }
    #authView .brand-points span i { font-size: 11px; }
    #authView .auth-brand-footer { display: none; }
    #authView .auth-panel {
        width: 100%;
        margin: 0;
        padding: 28px 22px 25px;
        border-radius: 22px;
        background: rgba(7, 17, 31, 0.93);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    #authView .auth-panel-header { margin-bottom: 22px; }
    #authView .auth-panel-header h2 { font-size: clamp(29px, 8vw, 36px); }
    #authView .auth-panel-header p { margin-top: 10px; font-size: 14px; }
    #authView .auth-form { gap: 14px; }
    #authView .auth-input-wrap input,
    #authView .primary-btn { min-height: 54px; }
    #authView .auth-security-note { margin-top: 19px; font-size: 11px; }
}

@media (max-width: 380px) {
    #authView .auth-panel { padding-right: 18px; padding-left: 18px; }
    #authView .brand-points span { flex: 1 1 calc(50% - 6px); justify-content: center; }
    #authView .brand-points span:last-child { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    #authView .auth-brand > *,
    #authView .auth-panel { animation: none; }
    #authView .primary-btn { transition: none; }
}

@media (min-width: 981px) {
    #authView.auth-shell[data-auth-screen="login"],
    #authView.auth-shell[data-auth-screen="register"] {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
    }

    #authView[data-auth-screen="login"] .auth-brand,
    #authView[data-auth-screen="register"] .auth-brand {
        position: absolute;
        inset: 0;
        width: 100%;
        min-height: 0;
        padding: clamp(24px, 3vw, 52px);
    }

    #authView[data-auth-screen="login"] .auth-brand > *,
    #authView[data-auth-screen="register"] .auth-brand > * {
        max-width: min(24vw, 390px);
    }

    #authView[data-auth-screen="login"] .auth-brand h1,
    #authView[data-auth-screen="register"] .auth-brand h1 {
        font-size: clamp(40px, 4vw, 66px);
    }

    #authView[data-auth-screen="login"] .brand-copy,
    #authView[data-auth-screen="register"] .brand-copy {
        max-width: min(24vw, 380px);
    }

    #authView[data-auth-screen="login"] .auth-panel,
    #authView[data-auth-screen="register"] .auth-panel {
        z-index: 3;
        width: min(100%, 540px);
        flex: 0 1 540px;
        margin: 0;
    }
}

@media (min-width: 981px) and (max-width: 1100px) {
    #authView[data-auth-screen="login"] .auth-brand > *,
    #authView[data-auth-screen="register"] .auth-brand > * {
        max-width: 21vw;
    }

    #authView[data-auth-screen="login"] .auth-brand h1,
    #authView[data-auth-screen="register"] .auth-brand h1 {
        font-size: clamp(34px, 3.6vw, 40px);
    }

    #authView[data-auth-screen="login"] .brand-copy,
    #authView[data-auth-screen="register"] .brand-copy {
        max-width: 21vw;
        font-size: 14px;
    }
}

/* =====================================================================
   Portal Familias · dashboard institucional Cumbre Alta
   ===================================================================== */

#appView {
    --ink: #f5f7fb;
    --muted: #b7c1d0;
    --line: rgba(184, 198, 217, 0.13);
    --paper: #121c2b;
    --soft: #0d1725;
    --accent: #ffe500;
    --green: #9be6a0;
    --rose: #ff8787;
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
    color: var(--ink);
    background: #080f1c;
}

html.portal-theme-light #appView {
    --ink: #172131;
    --muted: #6d7a8b;
    --line: rgba(24, 39, 58, 0.13);
    --paper: #ffffff;
    --soft: #f3f6fa;
    --green: #12895f;
    --rose: #c64055;
    background: #f3f6fa;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 130;
    width: 100%;
    min-height: 70px;
    margin: 0;
    color: #10151d;
    border: 0;
    border-bottom: 1px solid rgba(29, 31, 34, 0.12);
    background: #ffe500;
    box-shadow: 0 6px 22px rgba(3, 9, 17, 0.2);
}

.portal-topbar-inner {
    min-height: 70px;
    gap: 12px;
    padding: 0 clamp(12px, 1.4vw, 24px);
}

.portal-topbar .topbar-brand {
    display: inline-flex;
    flex: 0 0 auto;
    color: #11151c;
}

.topbar-brand-mark {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
}

.topbar-brand-mark img { width: 34px; height: 34px; }
.topbar-brand-copy strong { color: #11151c; font-family: Inter, sans-serif; font-size: 14px; }
.topbar-brand-copy small { color: rgba(17, 21, 28, 0.68); font-size: 9px; letter-spacing: 0.06em; }

.portal-topbar .menu-toggle {
    display: inline-flex;
    width: 34px;
    min-height: 34px;
    order: 2;
    color: #17191d;
    border-color: rgba(20, 25, 31, 0.2);
    background: rgba(255, 255, 255, 0.16);
}

.portal-topbar .menu-toggle:hover,
.portal-topbar .menu-toggle:focus-visible,
.portal-topbar .topbar-icon:hover,
.portal-topbar .topbar-icon:focus-visible,
.portal-topbar .topbar-action:hover,
.portal-topbar .topbar-action:focus-visible {
    color: #080f1c;
    border-color: rgba(20, 25, 31, 0.4);
    background: rgba(255, 255, 255, 0.35);
}

.topbar-account-context {
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: clamp(10px, 1.3vw, 22px);
    margin: 0;
}

.topbar-account-copy { gap: 1px 10px; }
.topbar-account-eyebrow { color: rgba(17, 21, 28, 0.72) !important; }
.topbar-account-eyebrow i { color: #14191f; }
.topbar-account-copy strong { color: #10151d; font-size: 20px; }
.topbar-account-copy small { color: rgba(17, 21, 28, 0.72); }
.topbar-account-state,
.topbar-current-page,
.topbar-user { border-color: rgba(17, 21, 28, 0.2); }
.topbar-account-state .portal-balance-status { color: #7e2931; }
.topbar-account-state .portal-balance-status.clear { color: #176446; }
.topbar-account-state .portal-balance-link {
    min-height: 30px;
    color: #17191d;
    border-color: rgba(17, 21, 28, 0.22);
    background: rgba(255, 255, 255, 0.22);
}
.topbar-account-state .portal-balance-link:hover { background: rgba(255, 255, 255, 0.48); }
.topbar-current-page span { color: rgba(17, 21, 28, 0.65) !important; }
.topbar-current-page strong { color: #10151d; }

.topbar-actions { gap: 8px; margin-left: auto; }
.portal-topbar .topbar-icon,
.portal-topbar .topbar-action {
    min-height: 38px;
    color: #17191d;
    border-color: rgba(17, 21, 28, 0.2);
    background: rgba(255, 255, 255, 0.16);
}
.portal-topbar .topbar-icon { width: 38px; }
.portal-topbar .topbar-logout { margin-left: 4px; }
.notification-badge { border-color: #ffe500; }

.topbar-account-menu { position: relative; }
.topbar-account-menu .topbar-user {
    min-height: 42px;
    display: flex;
    padding: 0 3px 0 12px;
    border: 0;
    border-left: 1px solid rgba(17, 21, 28, 0.2);
    border-radius: 0;
    color: #11151c;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.topbar-avatar { width: 34px; height: 34px; color: #ffe500; background: #10151d; }
.topbar-user-copy small { color: rgba(17, 21, 28, 0.66); }
.topbar-user-copy strong { max-width: clamp(110px, 12vw, 190px); color: #10151d; }
.topbar-user-chevron { margin-left: 2px; font-size: 10px; }
.topbar-account-menu-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 150;
    width: 220px;
    display: grid;
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(184, 198, 217, 0.18);
    border-radius: 13px;
    color: #f5f7fb;
    background: #121c2b;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}
#appView .topbar-account-menu-panel[hidden] { display: none !important; }
#appView .topbar-account-menu-panel:not([hidden]) { display: grid; }
#appView .topbar-account-menu-panel button {
    width: 100%;
    min-width: 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}
.topbar-account-menu-panel button {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: inherit;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.topbar-account-menu-panel button:hover,
.topbar-account-menu-panel button:focus-visible { color: #ffe500; background: rgba(255, 229, 0, 0.1); }
.topbar-account-menu-panel button i { width: 16px; text-align: center; }

.portal-navigation {
    border: 0;
    background: #0b1421;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.18);
}
.portal-sidebar-brand { display: none !important; }
.portal-navigation-overlay { display: none; }
.portal-navigation-overlay[hidden] { display: none; }
.portal-top-nav button.active {
    color: #fff;
    background: rgba(255, 229, 0, 0.13);
    box-shadow: inset 3px 0 0 #ffe500;
}
.portal-top-nav button.active i,
.portal-top-nav button:hover i,
.portal-top-nav button:focus-visible i { color: #ffe500; }
.portal-top-nav button:hover,
.portal-top-nav button:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.07); }
.portal-nav-athlete-context { border-color: rgba(184, 198, 217, 0.13); }
.portal-nav-athlete-label { color: #b7c1d0; }
.portal-nav-athlete-label i { color: #ffe500; }
.portal-nav-athlete-context select {
    color: #f5f7fb;
    border-color: rgba(184, 198, 217, 0.18);
    background-color: #121c2b;
}
.portal-nav-count { color: #93a0b1; }
.portal-nav-count strong { color: #f5f7fb; }

.portal-layout {
    min-height: calc(100vh - 70px);
    margin-left: 0;
    background:
        radial-gradient(ellipse at 0% 55%, rgba(255, 180, 0, 0.1), transparent 25rem),
        radial-gradient(ellipse at 100% 100%, rgba(255, 200, 0, 0.1), transparent 26rem),
        #080f1c;
}
.portal-main {
    width: 100%;
    max-width: 1600px;
    min-height: calc(100vh - 70px);
    margin: 0 auto;
    padding: 20px clamp(18px, 4.2vw, 66px) 52px;
}

.athlete-header {
    position: relative;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    margin-bottom: 14px;
    padding: 24px clamp(22px, 3vw, 40px);
    border: 1px solid rgba(191, 209, 231, 0.16);
    border-radius: 24px;
    background-image:
        linear-gradient(90deg, rgba(8, 15, 28, 0.98) 0%, rgba(8, 15, 28, 0.89) 35%, rgba(8, 15, 28, 0.36) 68%, rgba(8, 15, 28, 0.72) 100%),
        url('../img/portal-familias-dashboard-athlete.png');
    background-position: center, center 45%;
    background-size: cover;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24), 0 0 34px rgba(255, 184, 0, 0.06);
}
.athlete-header::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    content: '';
    pointer-events: none;
    background: linear-gradient(0deg, rgba(8, 15, 28, 0.25), transparent 46%);
}
.athlete-profile,
.athlete-header-side { position: relative; z-index: 1; }
.athlete-profile { gap: 18px; }
.profile-photo {
    width: 80px;
    height: 80px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(5, 12, 23, 0.84);
}
.athlete-header .profile-copy .eyebrow { color: #ffe500; }
.athlete-header h2 {
    margin: 5px 0 8px;
    color: #fff;
    font-family: Outfit, Inter, sans-serif;
    font-size: clamp(25px, 3.3vw, 38px);
    font-weight: 800;
    line-height: 1.05;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}
.athlete-header .profile-badges { gap: 7px; }
.athlete-header .profile-badges span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border: 1px solid rgba(211, 221, 234, 0.1);
    border-radius: 999px;
    color: #f4f6fa;
    background: rgba(153, 168, 188, 0.15);
}
.athlete-header .profile-badges .athlete-sport-status { color: #fff; background: rgba(138, 63, 68, 0.4); }
.athlete-header-side { min-width: 175px; gap: 9px; }
.athlete-active-badge { color: #9be6a0; }
.athlete-active-badge.is-inactive { color: #ffadad; }
.athlete-header-side small { color: rgba(238, 243, 250, 0.82); }
.athlete-carnet-action {
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid #ffe500;
    border-radius: 12px;
    color: #10151d;
    background: #ffe500;
    box-shadow: 0 8px 21px rgba(255, 229, 0, 0.17);
}

.family-dashboard-head {
    align-items: center;
    padding: 0 0 16px;
    border-bottom: 0;
}
.family-dashboard-head .eyebrow { color: #ffe500; }
.family-dashboard-head h2 {
    margin-top: 4px;
    color: #f6f8fc;
    font-size: clamp(26px, 3.1vw, 36px);
}
.family-dashboard-head h2 em { color: #ffe500; font-style: normal; }
.family-dashboard-head p { margin-top: 6px; color: #c1c9d4; }
.family-live-chip,
.family-context-chip {
    min-height: 32px;
    color: #e8edf4;
    border: 1px solid rgba(185, 199, 218, 0.1);
    background: rgba(18, 28, 43, 0.9);
}
.family-context-chip { color: #baf18c; border-color: rgba(255, 229, 0, 0.38); background: rgba(255, 229, 0, 0.04); }
.family-context-chip i { color: #ffe500; }

.family-signal-grid { gap: 14px; }
.family-signal-card {
    position: relative;
    width: 100%;
    min-height: 88px;
    padding: 13px 50px 13px 17px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}
.family-signal-card:hover:not(:disabled),
.family-signal-card:focus-visible:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.family-signal-card.billing { background: linear-gradient(115deg, #102c3f, #153a50); border-color: rgba(43, 150, 194, 0.42); }
.family-signal-card.attention { background: linear-gradient(115deg, #3b2028, #4a252e); border-color: rgba(193, 86, 99, 0.42); }
.family-signal-card.billing .family-signal-icon { color: #e3f6ff; background: rgba(51, 145, 190, 0.4); }
.family-signal-card.attention .family-signal-icon { color: #fff1f1; background: rgba(214, 117, 127, 0.25); }
.family-signal-card span { color: rgba(255, 255, 255, 0.76); }
.family-signal-card strong { color: #fff; font-size: clamp(19px, 2vw, 25px); }
.family-signal-card small { color: rgba(235, 240, 247, 0.79); }
.family-signal-arrow { position: absolute; right: 18px; top: 50%; color: rgba(255, 255, 255, 0.88); transform: translateY(-50%); }

.family-summary-grid { gap: 12px; margin-top: 13px; }
.family-dashboard-kpi {
    min-height: 105px;
    padding: 15px 17px;
    border: 1px solid rgba(184, 198, 217, 0.1);
    border-radius: 16px;
    background: linear-gradient(135deg, #131e2c, #111a27);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.family-dashboard-kpi > span {
    min-height: 17px;
    padding: 0;
    color: #d9e0e9;
    background: transparent;
    font-size: 10px;
    letter-spacing: 0.035em;
}
.family-dashboard-kpi > strong { margin-top: 2px; color: #fff; font-size: 26px; }
.family-dashboard-kpi .metric-money { font-size: clamp(21px, 2vw, 27px); }
.family-dashboard-kpi > small { margin-top: 2px; color: #c4ccd7; }
.family-dashboard-kpi.kpi-athletes > span,
.family-dashboard-kpi.kpi-balance > span,
.family-dashboard-kpi.kpi-invoices > span,
.family-dashboard-kpi.kpi-review > span { color: #d9e0e9; background: transparent; }
.family-kpi-watermark { right: 18px; bottom: 12px; color: #ffe500; opacity: 0.21; }

.family-dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.13fr) minmax(0, 0.94fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
}
.family-dashboard-panels > .family-pulse-overview,
.family-dashboard-panels > .family-overview-panel {
    min-width: 0;
    min-height: 240px;
    padding: 17px;
    border: 1px solid rgba(184, 198, 217, 0.13);
    border-radius: 17px;
    color: #f5f7fb;
    background: linear-gradient(145deg, rgba(20, 30, 44, 0.98), rgba(15, 24, 36, 0.98));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
.family-dashboard-panels > .family-pulse-overview { display: flex; flex-direction: column; }
.family-pulse-heading h2 { color: #f5f7fb; font-size: 22px; }
.family-pulse-heading p { color: #c0c9d5; }
.family-health-badge { padding: 7px 10px; color: #ff9e9e; background: rgba(190, 63, 79, 0.2); }
.family-health-badge.ok { color: #a7e899; background: rgba(59, 142, 91, 0.18); }
.family-pulse-stat-grid { gap: 7px; margin-top: 15px; }
.family-pulse-stat-grid > div { min-height: 58px; padding: 9px 10px; border-color: rgba(184, 198, 217, 0.1); border-radius: 11px; background: rgba(5, 12, 21, 0.45); }
.family-pulse-stat-grid span { color: #b8c3d1; font-size: 8px; }
.family-pulse-stat-grid strong { margin-top: 3px; color: #f6f8fb; font-size: 19px; }
.family-pulse-footer { margin-top: auto; padding-top: 12px; color: #b4bfcd; border-color: rgba(184, 198, 217, 0.1); font-size: 9px; }
.family-pulse-footer i { color: #ffe500; }
.family-dashboard-panels .family-overview-panel { display: flex; flex-direction: column; }
.family-dashboard-panels .family-overview-panel .card-head { margin: 0; }
.family-dashboard-panels .family-overview-panel h3 { margin: 0; color: #f6f8fb; font-family: Outfit, Inter, sans-serif; font-size: 16px; }
.family-dashboard-panels .family-overview-panel .panel-note { color: #bec8d5; font-size: 11px; }
.family-dashboard-panels .family-panel-count { color: #ff9d9d; background: rgba(190, 63, 79, 0.22); }
.family-dashboard-panels .family-overview-panel > .fa-people-group { color: #ffe500; }
.family-alert-list,
.family-athlete-list { margin-top: 11px; }
.family-alert-list,
.family-athlete-list { max-height: 270px; overflow-y: auto; overscroll-behavior: contain; padding-right: 3px; }
.family-alert-row,
.family-athlete-row { min-height: 58px; border-color: rgba(184, 198, 217, 0.1); color: #f4f6fa; }
.family-alert-row { grid-template-columns: 32px minmax(0, 1fr) 12px; gap: 9px; padding: 8px 0; }
.family-alert-row:not(div):hover,
.family-athlete-row:hover { background: rgba(255, 229, 0, 0.07); }
.family-alert-icon { color: #ffe500; background: rgba(255, 229, 0, 0.16); }
.family-alert-copy strong,
.family-athlete-copy strong { color: #f4f6fa; font-size: 11px; }
.family-alert-copy small,
.family-athlete-copy small,
.family-athlete-balance small { color: #bdc6d2; font-size: 9px; }
.family-row-arrow { color: #d7dee7; }
.family-athlete-row { grid-template-columns: 34px minmax(0, 1fr) auto 12px; gap: 8px; padding: 8px 0; }
.family-athlete-row .avatar { width: 34px; height: 34px; border-radius: 50%; color: #f4f6fa; background: #080f1c; }
.family-athlete-balance { max-width: 130px; }
.family-athlete-balance strong { color: #ff9292; font-size: 11px; }
.family-athlete-balance.clear strong { color: #a7e899; }
.family-overview-empty { display: flex; align-items: center; gap: 11px; min-height: 74px; color: #a7e899; }
.family-overview-empty > div { display: grid; gap: 4px; }
.family-overview-empty strong { color: #f4f6fa; font-size: 12px; }
.family-overview-empty span { color: #bdc6d2; font-size: 10px; }

.family-activity-panel,
#tab-resumen > .selected-athlete-heading,
#tab-resumen > .athlete-summary-grid,
#tab-resumen > .form-columns {
    color: #f5f7fb;
}
.family-activity-panel,
#tab-resumen .metric-card:not(.family-dashboard-kpi),
#tab-resumen .form-columns > .panel-card {
    border-color: rgba(184, 198, 217, 0.13);
    background: #121c2b;
}
.family-activity-panel { margin-top: 13px; }
.family-activity-panel h3,
#tab-resumen .metric-card strong,
#tab-resumen .form-columns h3 { color: #f5f7fb; }
.family-activity-copy small,
#tab-resumen .metric-card small,
#tab-resumen .selected-athlete-heading > span { color: #b7c1d0; }
.family-activity-row { border-color: rgba(184, 198, 217, 0.1); }
.family-secondary-details { margin-top: 14px; }

html.portal-theme-light .portal-navigation { border-right: 1px solid #dce3eb; background: #0b1421; }
html.portal-theme-light .portal-sidebar-brand-copy strong { color: #fff; }
html.portal-theme-light .portal-nav-athlete-label { color: #b7c1d0; }
html.portal-theme-light .portal-nav-count { color: #93a0b1; }
html.portal-theme-light .portal-nav-count strong { color: #f5f7fb; }
html.portal-theme-light .family-dashboard-head h2 { color: #172131; }
html.portal-theme-light .family-dashboard-head p { color: #6d7a8b; }
html.portal-theme-light .family-live-chip { color: #344156; background: #fff; }
html.portal-theme-light .family-dashboard-kpi { border-color: #dce3eb; background: #fff; }
html.portal-theme-light .family-dashboard-kpi > span,
html.portal-theme-light .family-dashboard-kpi.kpi-athletes > span,
html.portal-theme-light .family-dashboard-kpi.kpi-balance > span,
html.portal-theme-light .family-dashboard-kpi.kpi-invoices > span,
html.portal-theme-light .family-dashboard-kpi.kpi-review > span { color: #536174; }
html.portal-theme-light .family-dashboard-kpi > strong { color: #172131; }
html.portal-theme-light .family-dashboard-kpi > small { color: #6d7a8b; }
html.portal-theme-light .family-dashboard-panels > .family-pulse-overview,
html.portal-theme-light .family-dashboard-panels > .family-overview-panel,
html.portal-theme-light .family-activity-panel,
html.portal-theme-light #tab-resumen .metric-card:not(.family-dashboard-kpi),
html.portal-theme-light #tab-resumen .form-columns > .panel-card { border-color: #dce3eb; color: #172131; background: #fff; }
html.portal-theme-light .family-pulse-heading h2,
html.portal-theme-light .family-dashboard-panels .family-overview-panel h3,
html.portal-theme-light .family-alert-copy strong,
html.portal-theme-light .family-athlete-copy strong,
html.portal-theme-light .family-overview-empty strong,
html.portal-theme-light .family-activity-panel h3,
html.portal-theme-light #tab-resumen .metric-card strong,
html.portal-theme-light #tab-resumen .form-columns h3 { color: #172131; }
html.portal-theme-light .family-pulse-heading p,
html.portal-theme-light .family-pulse-stat-grid span,
html.portal-theme-light .family-dashboard-panels .family-overview-panel .panel-note,
html.portal-theme-light .family-alert-copy small,
html.portal-theme-light .family-athlete-copy small,
html.portal-theme-light .family-athlete-balance small,
html.portal-theme-light .family-overview-empty span,
html.portal-theme-light .family-activity-copy small,
html.portal-theme-light #tab-resumen .metric-card small { color: #6d7a8b; }
html.portal-theme-light .family-pulse-stat-grid > div { border-color: #e3e8ee; background: #f3f6fa; }
html.portal-theme-light .family-pulse-stat-grid strong { color: #172131; }
html.portal-theme-light .family-pulse-footer { color: #6d7a8b; border-color: #e3e8ee; }
html.portal-theme-light .portal-layout { background: radial-gradient(ellipse at 100% 100%, rgba(255, 205, 0, 0.08), transparent 26rem), #f3f6fa; }
html.portal-theme-light .family-alert-row,
html.portal-theme-light .family-athlete-row,
html.portal-theme-light .family-activity-row { border-color: #e3e8ee; }
html.portal-theme-light .portal-navigation .portal-top-nav button { color: rgba(255, 255, 255, 0.64); }
html.portal-theme-light .portal-navigation .portal-top-nav button.active { color: #fff; }
html.portal-theme-light #tab-resumen .selected-athlete-heading > span { color: #6d7a8b; }

@media (min-width: 981px) {
    :root { --portal-sidebar-width: 236px; }
    .portal-topbar-inner { min-height: 70px; gap: 8px; padding-left: 17px; }
    .portal-topbar .topbar-brand { width: 170px; }
    .portal-topbar .menu-toggle { margin-left: 0; }
    .portal-account-context { margin-left: 0; }
    .portal-navigation {
        position: fixed;
        inset: 70px auto 0 0;
        z-index: 100;
        width: var(--portal-sidebar-width);
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        border-right: 1px solid rgba(184, 198, 217, 0.13);
    }
    .portal-navigation-inner { min-height: 100%; padding: 22px 13px 16px; }
    .portal-top-nav { gap: 5px; }
    .portal-top-nav button { min-height: 44px; }
    .portal-nav-athlete-context { margin-top: auto; }
    .portal-layout { min-height: calc(100vh - 70px); margin-left: var(--portal-sidebar-width); }
    .portal-main { max-width: 1600px; padding-top: 20px; }
    .app-shell.nav-collapsed { --portal-sidebar-width: 76px; }
    .app-shell.nav-collapsed .portal-topbar-inner { gap: 4px; padding-left: 2px; }
    .app-shell.nav-collapsed .portal-topbar .topbar-brand { width: 36px; gap: 0; }
    .app-shell.nav-collapsed .topbar-brand-copy { display: none; }
    .app-shell.nav-collapsed .topbar-brand-mark { width: 34px; height: 34px; }
    .app-shell.nav-collapsed .topbar-brand-mark img { width: 32px; height: 32px; }
    .app-shell.nav-collapsed .portal-topbar .menu-toggle { width: 30px; min-height: 34px; flex-basis: 30px; }
    .app-shell.nav-collapsed .portal-navigation-inner { padding-right: 10px; padding-left: 10px; }
    .app-shell.nav-collapsed .portal-top-nav button { justify-content: center; padding: 0; }
    .app-shell.nav-collapsed .portal-top-nav button span,
    .app-shell.nav-collapsed .portal-nav-athlete-label,
    .app-shell.nav-collapsed .portal-nav-athlete-context select,
    .app-shell.nav-collapsed .portal-nav-count { display: none; }
    .app-shell.nav-collapsed .portal-top-nav button i { width: auto; font-size: 16px; }
    .app-shell.nav-collapsed .portal-nav-athlete-context { display: flex; justify-content: center; padding-top: 15px; }
    .app-shell.nav-collapsed .portal-nav-athlete-context::before { content: '\f70c'; font: var(--fa-font-solid); color: #ffe500; }
}

@media (max-width: 1180px) {
    .family-dashboard-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .family-dashboard-panels > .family-pulse-overview { grid-column: 1 / -1; }
    .family-dashboard-panels > .family-overview-panel { min-height: 210px; }
    .topbar-account-state { gap: 7px; padding-left: 10px; }
    .topbar-account-state .portal-balance-link { padding: 0 7px; }
}

@media (max-width: 980px) {
    .portal-topbar-inner { min-height: 66px; }
    .portal-topbar { min-height: 66px; }
    .portal-topbar .menu-toggle { display: inline-flex; order: -1; flex: 0 0 44px; width: 44px; min-height: 44px; }
    .portal-topbar .topbar-brand { width: auto; margin-right: 4px; }
    .portal-topbar .topbar-brand-mark { width: 36px; height: 36px; }
    .portal-topbar .topbar-brand-mark img { width: 32px; height: 32px; }
    .portal-topbar .topbar-brand-copy { display: none; }
    .topbar-account-context { gap: 8px; }
    .topbar-account-copy { display: grid; grid-template-columns: 1fr; }
    .topbar-account-eyebrow { font-size: 8px !important; }
    .topbar-account-copy strong { font-size: 17px; }
    .topbar-account-copy small,
    .topbar-account-state,
    .topbar-current-page { display: none; }
    .portal-navigation {
        position: fixed;
        inset: 66px auto 0 0;
        z-index: 110;
        width: min(310px, 86vw);
        display: block;
        min-height: 0;
        overflow: auto;
        border: 0;
        border-right: 1px solid rgba(184, 198, 217, 0.15);
        background: #0b1421;
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.34);
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }
    .app-shell.nav-open .portal-navigation { display: block; transform: translateX(0); }
    .portal-navigation-inner { min-height: 100%; padding: 20px 13px 16px; }
    .portal-sidebar-brand { display: flex !important; }
    .portal-sidebar-divider { margin-top: 17px; }
    .portal-top-nav { display: grid; grid-template-columns: 1fr; gap: 5px; }
    .portal-top-nav button { min-height: 46px; justify-content: flex-start; padding: 0 13px; }
    .portal-top-nav button span { display: inline; }
    .portal-top-nav button::after { display: none; }
    .portal-nav-athlete-context { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-top: auto; }
    .portal-nav-athlete-label,
    .portal-nav-athlete-context select,
    .portal-nav-count { grid-column: 1 / -1; }
    .portal-navigation-overlay:not([hidden]) {
        position: fixed;
        inset: 66px 0 0;
        z-index: 105;
        display: block;
        width: 100%;
        height: calc(100dvh - 66px);
        border: 0;
        background: rgba(2, 7, 14, 0.62);
        backdrop-filter: blur(2px);
    }
    .portal-layout { min-height: calc(100vh - 66px); margin: 0; }
    .portal-main { max-width: none; padding: 18px clamp(16px, 3vw, 28px) 44px; }
}

@media (max-width: 720px) {
    .topbar-actions { gap: 5px; }
    .topbar-account-menu .topbar-user { gap: 0; padding: 0 0 0 7px; }
    .topbar-user-copy,
    .topbar-user-chevron { display: none; }
    .topbar-account-menu .topbar-user { border-left: 0; }
    .topbar-avatar { width: 34px; height: 34px; }
    #topbarInstallBtn { display: none !important; }
    .portal-topbar .topbar-icon { width: 44px; min-height: 44px; }
    .portal-topbar .topbar-logout { display: none; }
    .portal-topbar-inner { gap: 8px; padding: 0 10px; }
    .athlete-header {
        min-height: 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 17px;
        padding: 20px;
        background-position: center, 62% center;
    }
    .athlete-profile { width: 100%; align-items: flex-start; gap: 12px; }
    .profile-photo { width: 58px; height: 58px; font-size: 20px; }
    .athlete-header h2 { font-size: clamp(21px, 7vw, 29px); overflow-wrap: anywhere; }
    .athlete-header .profile-badges span { min-height: 30px; font-size: 10px; }
    .athlete-header-side { width: 100%; min-width: 0; justify-items: start; text-align: left; }
    .athlete-header-side small { max-width: 100%; }
    .athlete-carnet-action { min-height: 46px; }
    .family-dashboard-head { gap: 12px; }
    .family-dashboard-head h2 { font-size: 29px; line-height: 1.05; }
    .family-dashboard-meta { justify-items: start; display: flex; gap: 7px; }
    .family-signal-grid,
    .family-summary-grid,
    .family-dashboard-panels { grid-template-columns: 1fr; }
    .family-dashboard-panels > .family-pulse-overview { grid-column: auto; }
    .family-dashboard-panels > .family-pulse-overview,
    .family-dashboard-panels > .family-overview-panel { min-height: 0; padding: 15px; }
    .family-alert-list,
    .family-athlete-list { max-height: 360px; }
    .family-pulse-footer { margin-top: 16px; }
    .family-athlete-row { grid-template-columns: 34px minmax(0, 1fr) auto 12px; }
    .family-athlete-balance { max-width: 115px; }
    .family-alert-copy strong,
    .family-athlete-copy strong { font-size: 11px; }
    .family-activity-panel { overflow: hidden; }
    .family-activity-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 7px; }
    #tab-resumen > .form-columns { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .portal-topbar .menu-toggle { flex-basis: 44px; width: 44px; min-height: 44px; }
    .topbar-account-copy strong { max-width: 96px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; }
    .topbar-account-eyebrow { font-size: 7px !important; }
    .family-signal-card { gap: 10px; padding-right: 38px; }
    .family-signal-icon { width: 39px; height: 39px; }
    .family-athlete-row { grid-template-columns: 32px minmax(0, 1fr) 12px; }
    .family-athlete-balance { grid-column: 2; max-width: none; text-align: left; }
    .family-athlete-row > .family-row-arrow { grid-column: 3; grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-navigation,
    .family-signal-card { transition: none !important; }
}

#appView .athlete-header {
    border-color: rgba(191, 209, 231, 0.16);
    background-color: #080f1c;
    background-image:
        linear-gradient(90deg, rgba(8, 15, 28, 0.98) 0%, rgba(8, 15, 28, 0.89) 35%, rgba(8, 15, 28, 0.36) 68%, rgba(8, 15, 28, 0.72) 100%),
        url('../img/portal-familias-dashboard-athlete.png');
    background-position: center, center 45%;
    background-repeat: no-repeat;
    background-size: cover;
}
#appView .athlete-header h2 { color: #fff; }
html.portal-theme-light .portal-topbar { color: #10151d; background: #ffe500; border: 0; border-bottom: 1px solid rgba(29, 31, 34, 0.12); }
html.portal-theme-light .topbar-current-page span { color: rgba(17, 21, 28, 0.65) !important; }
html.portal-theme-light .topbar-current-page strong,
html.portal-theme-light .topbar-account-copy strong,
html.portal-theme-light .topbar-brand-copy strong,
html.portal-theme-light .topbar-user-copy strong { color: #10151d; }

@media (max-width: 980px) {
    .portal-page .menu-toggle { display: inline-flex !important; }
    .portal-page .portal-navigation { display: block !important; }
    .portal-page .app-shell.nav-open .portal-navigation { display: block !important; }
    .portal-topbar .menu-toggle { flex-basis: 44px; width: 44px; min-height: 44px; }
    .topbar-account-menu .topbar-user { min-width: 44px; min-height: 44px; justify-content: center; }
}

.topbar-settings-menu { position: relative; }
.portal-settings-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 150;
    width: 220px;
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(184, 198, 217, 0.18);
    border-radius: 13px;
    color: #f5f7fb;
    background: #121c2b;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}
.portal-settings-panel[hidden] { display: none; }
.portal-settings-panel > strong { padding: 1px 3px 5px; color: #bdc8d6; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.portal-theme-choice {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: #f5f7fb;
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.portal-theme-choice:hover,
.portal-theme-choice:focus-visible { color: #ffe500; background: rgba(255, 229, 0, 0.1); }
.portal-theme-choice > i { width: 16px; text-align: center; }

.portal-dashboard-loading,
.portal-dashboard-error {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 0 12px;
    padding: 11px 14px;
    border: 1px solid rgba(184, 198, 217, 0.14);
    border-radius: 13px;
    color: #dce4ee;
    background: rgba(18, 28, 43, 0.96);
    font-size: 12px;
}
.portal-dashboard-loading > i { color: #ffe500; }
.portal-dashboard-error {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    border-color: rgba(229, 113, 113, 0.34);
    color: #f2dfe0;
    background: rgba(59, 28, 36, 0.92);
}
.portal-dashboard-error-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #ffb0b0;
    background: rgba(222, 95, 104, 0.16);
}
.portal-dashboard-error strong { color: #fff; font-size: 12px; }
.portal-dashboard-error p { margin: 3px 0 0; color: #e6c9cb; font-size: 11px; line-height: 1.45; }
.portal-dashboard-retry {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid rgba(255, 229, 0, 0.34);
    border-radius: 10px;
    color: #ffe500;
    background: rgba(255, 229, 0, 0.08);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.portal-dashboard-retry:hover,
.portal-dashboard-retry:focus-visible { background: rgba(255, 229, 0, 0.16); }
html.portal-theme-light .portal-dashboard-loading { color: #344156; background: #fff; }
html.portal-theme-light .portal-dashboard-error { color: #673039; background: #fff4f4; }
html.portal-theme-light .portal-dashboard-error strong { color: #44262b; }
html.portal-theme-light .portal-dashboard-error p { color: #7d5055; }

@media (max-width: 620px) {
    .portal-dashboard-error { grid-template-columns: 36px minmax(0, 1fr); }
    .portal-dashboard-retry { grid-column: 1 / -1; width: 100%; }
}

.athlete-active-badge.is-unknown { color: #f5d66b; }
@media (max-width: 390px) {
    .portal-topbar .notification-trigger { display: none; }
    .topbar-account-copy strong { max-width: 84px; }
}
@media (max-width: 720px) {
    #appView .athlete-header { background-position: center, 62% center; }
}

/* Encabezados locales retirados: conserva acciones y datos de estado en formato compacto. */
.portal-page-actions {
    display: flex;
    justify-content: flex-end;
}

.family-message-page-actions {
    margin-bottom: 12px;
}

.invoice-status-row {
    display: flex;
    justify-content: flex-end;
}

.invoice-status-row .invoice-account-state {
    width: min(100%, 360px);
    min-height: 0;
    padding: 14px 16px;
}

.payment-methods-row {
    display: flex;
    justify-content: flex-end;
}

.payment-methods-row .payment-methods-card {
    width: min(100%, 380px);
}

.portal-attendance-copy .portal-attendance-instruction {
    max-width: 48ch;
    margin: 0;
    color: #fff;
    font-size: clamp(17px, 2vw, 21px);
    font-weight: 700;
    line-height: 1.4;
}

.portal-attendance-copy .portal-attendance-instruction strong {
    color: #ffe500;
}

html.portal-theme-light .portal-attendance-copy .portal-attendance-instruction {
    color: #242128;
}

html.portal-theme-light .portal-attendance-copy .portal-attendance-instruction strong {
    color: #756800;
}

@media (max-width: 820px) {
    .invoice-status-row,
    .payment-methods-row {
        justify-content: flex-start;
    }

    .invoice-status-row .invoice-account-state,
    .payment-methods-row .payment-methods-card {
        width: 100%;
    }
}

/* Navegación lateral negra con el amarillo superior como acento. */
body.portal-page .portal-navigation {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: #080f1c;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.24);
}

.portal-page .portal-navigation .portal-sidebar-brand,
.portal-page .portal-navigation .portal-sidebar-brand-copy strong {
    color: #fff;
}

.portal-page .portal-navigation .portal-sidebar-brand-mark {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
}

.portal-page .portal-navigation .portal-sidebar-brand-copy small,
.portal-page .portal-navigation .portal-nav-athlete-label,
.portal-page .portal-navigation .portal-nav-count {
    color: rgba(255, 255, 255, 0.62);
}

.portal-page .portal-navigation .portal-sidebar-divider,
.portal-page .portal-navigation .portal-nav-athlete-context {
    border-color: rgba(255, 255, 255, 0.12);
}

.portal-page .portal-navigation .portal-sidebar-divider {
    background: rgba(255, 255, 255, 0.12);
}

.portal-page .portal-navigation .portal-nav-athlete-label i {
    color: #ffe500;
}

.portal-page .portal-navigation .portal-nav-count strong {
    color: #fff;
}

.portal-page .portal-navigation .portal-nav-athlete-context select {
    color: #f5f7fb;
    border-color: rgba(255, 255, 255, 0.18);
    background-color: rgba(255, 255, 255, 0.08);
}

.portal-page .portal-navigation .portal-nav-athlete-context select option {
    color: #f5f7fb;
    background: #10151d;
}

.portal-page .portal-navigation .portal-top-nav button {
    color: rgba(255, 255, 255, 0.72);
}

.portal-page .portal-navigation .portal-top-nav button i {
    color: rgba(255, 255, 255, 0.52);
}

.portal-page .portal-navigation .portal-top-nav button:hover,
.portal-page .portal-navigation .portal-top-nav button:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.portal-page .portal-navigation .portal-top-nav button:hover i,
.portal-page .portal-navigation .portal-top-nav button:focus-visible i {
    color: #ffe500;
}

.portal-page .portal-navigation .portal-top-nav button.active,
.portal-page .portal-navigation .portal-top-nav button.active:hover,
.portal-page .portal-navigation .portal-top-nav button.active:focus-visible {
    color: #fff;
    background: rgba(255, 229, 0, 0.13);
    box-shadow: inset 3px 0 0 #ffe500;
}

.portal-page .portal-navigation .portal-top-nav button.active i {
    color: #ffe500;
}

.portal-page .portal-navigation .portal-top-nav button:focus-visible,
.portal-page .portal-navigation .portal-nav-athlete-context select:focus-visible {
    outline: 2px solid #ffe500;
    outline-offset: 2px;
}

/* Centro de notificaciones del topbar, alineado al patrón del ERP. */
.portal-notifications-wrap {
    position: relative;
    flex: 0 0 auto;
}

.portal-topbar .portal-notifications-trigger {
    position: relative;
    width: 41px;
    min-width: 41px;
    min-height: 41px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid #203149;
    border-radius: 11px;
    color: #91a0b4;
    background: #0e1a2a;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.portal-topbar .portal-notifications-trigger:hover,
.portal-topbar .portal-notifications-trigger:focus-visible,
.portal-topbar .portal-notifications-trigger[aria-expanded="true"] {
    border-color: rgba(255, 212, 0, .5);
    color: #ffd400;
    background: #132238;
}

.portal-topbar .portal-notifications-trigger:focus-visible {
    outline: 2px solid #ffd400;
    outline-offset: 2px;
}

.portal-topbar .portal-notifications-trigger > i {
    font-size: 15px;
}

.portal-notifications-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #0e1a2a;
    border-radius: 999px;
    color: #fff;
    background: #ef4444;
    font: 800 10px/1 Inter, sans-serif;
    font-variant-numeric: tabular-nums;
}

.portal-notifications-popover {
    --portal-notice-bg: #0e1a2a;
    --portal-notice-raised: #132238;
    --portal-notice-line: #203149;
    --portal-notice-text: #f2f5f8;
    --portal-notice-muted: #91a0b4;
    --portal-notice-yellow: #ffd400;
    --portal-notice-soft: rgba(255, 212, 0, .08);
    position: absolute;
    top: calc(100% + 11px);
    right: 0;
    z-index: 170;
    width: min(496px, calc(100vw - 16px));
    display: none;
    animation: portal-notification-pop .18s ease-out both;
}

.portal-notifications-popover.hidden {
    display: none !important;
}

.portal-notifications-popover.is-open {
    display: block;
}

.portal-notifications-popover .erp-notifications-shell {
    display: flex;
    max-height: min(608px, calc(100dvh - 90px));
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--portal-notice-line);
    border-radius: 15px;
    color: var(--portal-notice-text);
    background: var(--portal-notice-bg);
    box-shadow: 0 22px 52px rgba(0, 0, 0, .34);
}

.portal-notifications-popover .erp-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--portal-notice-line);
    background: linear-gradient(135deg, rgba(255, 212, 0, .1), transparent 65%), var(--portal-notice-raised);
}

.portal-notifications-popover .erp-notifications-heading {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.portal-notifications-popover .erp-notifications-emblem {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    color: #111925;
    background: #ffd400;
    box-shadow: 0 8px 18px rgba(255, 212, 0, .16);
}

.portal-notifications-popover .erp-notifications-heading-copy {
    min-width: 0;
}

.portal-notifications-popover .erp-notifications-kicker {
    margin: 0 0 2px;
    color: var(--portal-notice-yellow);
    font: 800 9px/1.3 Inter, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portal-notifications-popover .erp-notifications-heading h2 {
    margin: 0;
    color: var(--portal-notice-text);
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 800;
}

.portal-notifications-popover .erp-notifications-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: var(--portal-notice-muted);
    font-size: 10px;
}

.portal-notifications-popover .erp-notifications-live::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #20cf8a;
    box-shadow: 0 0 0 4px rgba(32, 207, 138, .12);
    content: '';
}

.portal-notifications-popover .erp-notifications-head-action {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--portal-notice-line);
    border-radius: 10px;
    color: var(--portal-notice-muted);
    background: var(--portal-notice-bg);
    cursor: pointer;
}

.portal-notifications-popover .erp-notifications-head-action:hover,
.portal-notifications-popover .erp-notifications-head-action:focus-visible {
    border-color: rgba(255, 212, 0, .45);
    color: var(--portal-notice-yellow);
    background: var(--portal-notice-raised);
}

.portal-notifications-popover .erp-notifications-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--portal-notice-line);
}

.portal-notifications-popover .erp-notifications-summary-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.portal-notifications-popover .erp-notifications-summary-copy strong,
.portal-notifications-popover .erp-notifications-summary-copy span {
    display: block;
}

.portal-notifications-popover .erp-notifications-summary-copy strong {
    color: var(--portal-notice-text);
    font-size: 12px;
}

.portal-notifications-popover .erp-notifications-summary-copy span {
    margin-top: 3px;
    color: var(--portal-notice-muted);
    font-size: 10px;
}

.portal-notifications-popover .erp-notifications-count {
    min-width: 29px;
    height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 9px;
    color: #111925;
    background: var(--portal-notice-yellow);
    font-size: 11px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.portal-notifications-popover .erp-notifications-mark-all {
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--portal-notice-yellow);
    background: transparent;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.portal-notifications-popover .erp-notifications-mark-all:hover,
.portal-notifications-popover .erp-notifications-mark-all:focus-visible {
    border-color: rgba(255, 212, 0, .35);
    background: var(--portal-notice-soft);
}

.portal-notifications-popover .erp-notifications-mark-all:disabled {
    opacity: .45;
    cursor: default;
}

.portal-notifications-popover .erp-notifications-filters {
    display: flex;
    gap: 6px;
    padding: 10px 15px 0;
}

.portal-notifications-popover .erp-notifications-filter {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--portal-notice-muted);
    background: transparent;
    font: 800 10px/1 Inter, sans-serif;
    cursor: pointer;
}

.portal-notifications-popover .erp-notifications-filter:hover,
.portal-notifications-popover .erp-notifications-filter.is-active {
    border-color: rgba(255, 212, 0, .34);
    color: var(--portal-notice-yellow);
    background: var(--portal-notice-soft);
}

.portal-notifications-popover .erp-notifications-list {
    min-height: 0;
    flex: 1 1 auto;
    max-height: min(350px, 42dvh);
    overflow-y: auto;
    padding: 10px 15px 13px;
}

.portal-notification-card {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px;
    border: 1px solid var(--portal-notice-line);
    border-radius: 11px;
    color: var(--portal-notice-text);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease;
}

.portal-notification-card + .portal-notification-card {
    margin-top: 8px;
}

.portal-notification-card:hover,
.portal-notification-card:focus-visible {
    border-color: rgba(255, 212, 0, .38);
    background: var(--portal-notice-raised);
}

.portal-notification-card.unread {
    background: rgba(255, 212, 0, .06);
}

.portal-notification-card.unread::before {
    position: absolute;
    inset: 10px auto 10px 0;
    width: 3px;
    border-radius: 99px;
    background: var(--portal-notice-yellow);
    content: '';
}

.portal-notification-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--portal-notice-yellow);
    background: var(--portal-notice-soft);
}

.portal-notification-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.portal-notification-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.portal-notification-title-row strong {
    overflow: hidden;
    color: var(--portal-notice-text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-notification-unread-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--portal-notice-yellow);
}

.portal-notification-message {
    display: block;
    margin-top: 4px;
    color: var(--portal-notice-muted);
    font-size: 10px;
    line-height: 1.5;
}

.portal-notification-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 7px;
    color: var(--portal-notice-muted);
    font-size: 9px;
}

.portal-notification-meta > span {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portal-notification-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    color: var(--portal-notice-yellow);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.portal-notification-empty {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 28px 14px;
    color: var(--portal-notice-muted);
    text-align: center;
}

.portal-notification-empty > span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--portal-notice-yellow);
    background: var(--portal-notice-soft);
}

.portal-notification-empty strong {
    color: var(--portal-notice-text);
    font-size: 12px;
}

.portal-notification-empty p {
    max-width: 280px;
    margin: 0;
    font-size: 10px;
    line-height: 1.45;
}

.portal-notifications-popover .erp-notification-push-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px 15px;
    padding: 10px;
    border: 1px solid rgba(255, 212, 0, .28);
    border-radius: 11px;
    background: var(--portal-notice-soft);
}

.portal-notification-push-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    color: var(--portal-notice-yellow);
    background: rgba(255, 212, 0, .16);
}

.portal-notification-push-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.portal-notification-push-copy strong,
.portal-notification-push-copy small {
    display: block;
}

.portal-notification-push-copy strong {
    color: var(--portal-notice-text);
    font-size: 10px;
}

.portal-notification-push-copy small {
    margin-top: 2px;
    color: var(--portal-notice-muted);
    font-size: 9px;
    line-height: 1.35;
}

.portal-notifications-popover .erp-notification-push-action {
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(255, 212, 0, .35);
    border-radius: 8px;
    color: #111925;
    background: var(--portal-notice-yellow);
    font: 800 9px/1 Inter, sans-serif;
    cursor: pointer;
}

html.portal-theme-light .portal-notifications-popover {
    --portal-notice-bg: #fff;
    --portal-notice-raised: #f5f7fa;
    --portal-notice-line: #d8e0e9;
    --portal-notice-text: #172234;
    --portal-notice-muted: #627187;
    --portal-notice-yellow: #9b7800;
    --portal-notice-soft: rgba(255, 212, 0, .12);
}

@keyframes portal-notification-pop {
    from { opacity: 0; transform: translateY(-4px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
    .portal-notifications-popover {
        width: min(496px, calc(100vw - 14px));
    }

    .portal-notifications-popover .erp-notifications-head,
    .portal-notifications-popover .erp-notifications-summary {
        padding-right: 12px;
        padding-left: 12px;
    }

    .portal-notifications-popover .erp-notifications-filters,
    .portal-notifications-popover .erp-notifications-list {
        padding-right: 12px;
        padding-left: 12px;
    }

    .portal-notifications-popover .erp-notification-push-card {
        margin-right: 12px;
        margin-left: 12px;
    }
}

@media (max-width: 390px) {
    .portal-notifications-popover {
        position: fixed;
        top: 70px;
        right: 8px;
        left: 8px;
        width: auto;
    }
}

.topbar-current-page {
    position: relative;
    align-content: center;
}

.topbar-athlete-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: min(30vw, 340px);
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: #10151d;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.topbar-athlete-trigger:focus-visible {
    outline: 2px solid #10151d;
    outline-offset: 4px;
}

.topbar-athlete-trigger:disabled {
    cursor: default;
}

.topbar-current-page .topbar-athlete-trigger strong {
    display: block;
    max-width: none;
    overflow: visible;
    color: #10151d;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.topbar-athlete-trigger > i {
    flex: 0 0 auto;
    font-size: 10px;
    transition: transform .16s ease;
}

.topbar-athlete-trigger[aria-expanded="true"] > i {
    transform: rotate(180deg);
}

.topbar-athlete-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 170;
    width: min(340px, calc(100vw - 20px));
    max-height: min(52vh, 420px);
    overflow: auto;
    padding: 6px;
    border: 1px solid rgba(184, 198, 217, .2);
    border-radius: 13px;
    background: #101a28;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

.topbar-athlete-menu[hidden] {
    display: none;
}

.topbar-athlete-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #f6f8fc;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.topbar-athlete-option:hover,
.topbar-athlete-option:focus-visible,
.topbar-athlete-option.is-active {
    border-color: rgba(255, 229, 0, .22);
    background: rgba(255, 229, 0, .1);
}

.topbar-athlete-option:focus-visible {
    outline: 2px solid #ffe500;
    outline-offset: 1px;
}

.topbar-athlete-option-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-athlete-option-copy strong {
    color: #f6f8fc;
    font: 700 12px/1.3 Inter, sans-serif;
    overflow-wrap: anywhere;
}

.topbar-athlete-option-copy small {
    color: #aeb9c9;
    font: 500 10px/1.3 Inter, sans-serif;
}

.topbar-athlete-option > i {
    flex: 0 0 auto;
    color: #ffe500;
    opacity: 0;
}

.topbar-athlete-option.is-active > i {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .portal-topbar .portal-notifications-trigger,
    .portal-notification-card,
    .topbar-athlete-trigger > i {
        transition: none;
    }

    .portal-notifications-popover.is-open {
        animation: none;
    }
}

/* Portal Familias · diálogos accesibles con la identidad actual del portal */
html.portal-theme-dark body.portal-page #portalActionModal,
html.portal-theme-dark body.portal-page #portalCarnetModal {
    --ink: #f5f7fb;
    --muted: #b7c1d0;
    --line: rgba(184, 198, 217, .16);
    --paper: #121c2b;
    --soft: #0d1725;
    --accent: #ffe500;
    --blue: #ffe500;
}

html.portal-theme-light body.portal-page #portalActionModal,
html.portal-theme-light body.portal-page #portalCarnetModal {
    --ink: #172131;
    --muted: #6d7a8b;
    --line: rgba(24, 39, 58, .15);
    --paper: #fff;
    --soft: #f3f6fa;
    --accent: #f4d500;
    --blue: #41658d;
}

.portal-modal {
    overscroll-behavior: contain;
}

.portal-modal-backdrop {
    background: rgba(4, 8, 18, .76);
}

.portal-modal-card {
    border-radius: 22px;
    border-color: var(--line);
    background: var(--paper);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
    transform: translateY(8px) scale(.97);
}

.portal-modal-head {
    flex: 0 0 auto;
    border-color: var(--line);
    background: var(--soft);
}

.portal-modal-head p,
.portal-modal-head h2 {
    color: var(--ink);
}

.portal-modal-head p {
    color: var(--accent);
    font-size: 10px;
    letter-spacing: .08em;
}

.portal-modal-head h2 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.025em;
}

.portal-modal-body {
    min-height: 0;
    flex: 1 1 auto;
    overscroll-behavior: contain;
}

.portal-modal .modal-summary-card,
.portal-modal .payment-selected-card {
    border-color: var(--line);
    background: var(--soft);
}

.portal-modal input:focus,
.portal-modal select:focus,
.portal-modal textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 229, 0, .2);
}

.portal-modal .modal-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--soft);
    cursor: pointer;
}

.portal-modal .modal-close:hover {
    border-color: var(--rose);
    color: var(--rose);
    background: rgba(240, 139, 139, .13);
}

.portal-modal .modal-close:focus-visible,
.portal-modal .modal-actions button:focus-visible,
.portal-modal .activity-detail-actions button:focus-visible,
.portal-carnet-modal button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.portal-modal .ghost-btn {
    border-color: var(--line);
    color: var(--ink);
    background: var(--soft);
}

.portal-modal .ghost-btn:hover {
    border-color: var(--accent);
    background: rgba(255, 229, 0, .1);
}

.portal-modal .primary-btn {
    color: #11151c;
    background: var(--accent);
}

.portal-modal .primary-btn.danger-action {
    border-color: var(--rose);
    color: #fff;
    background: var(--rose);
    box-shadow: 0 8px 18px rgba(214, 79, 98, .16);
}

.portal-modal .primary-btn.danger-action:hover:not(:disabled) {
    filter: brightness(1.08);
}

html.portal-theme-light .portal-modal-card {
    border-color: var(--line);
    background: var(--paper);
    box-shadow: 0 28px 80px rgba(17, 31, 49, .24);
}

html.portal-theme-light .portal-modal-head,
html.portal-theme-light .portal-modal .modal-summary-card,
html.portal-theme-light .portal-modal .payment-selected-card {
    border-color: var(--line);
    background: var(--soft);
}

html.portal-theme-light .portal-modal .modal-close:hover {
    background: #fff0f3;
}

html.portal-theme-light .portal-modal .ghost-btn:hover {
    background: rgba(244, 213, 0, .14);
}

.portal-carnet-modal {
    overscroll-behavior: contain;
}

.portal-carnet-backdrop {
    background: rgba(4, 8, 18, .76);
    opacity: 0;
    transition: opacity .18s ease;
}

.portal-carnet-dialog {
    display: flex;
    flex-direction: column;
    border-color: var(--line);
    color: #f5f7fb;
    background: #121c2b;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px) scale(.97);
    transition: opacity .18s ease, transform .18s ease;
    overscroll-behavior: contain;
}

.portal-carnet-modal.is-open .portal-carnet-backdrop {
    opacity: 1;
}

.portal-carnet-modal.is-open .portal-carnet-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.portal-carnet-dialog-head {
    border-color: rgba(184, 198, 217, .16);
    background: #121c2b;
}

.portal-carnet-preview {
    min-height: 0;
    flex: 1 1 auto;
    background: #0d1725;
}

.portal-carnet-actions {
    border-top: 1px solid rgba(184, 198, 217, .13);
    background: #121c2b;
}

.portal-carnet-actions .secondary-btn {
    border-color: rgba(184, 198, 217, .2);
    color: #f5f7fb;
    background: rgba(255, 255, 255, .06);
    cursor: pointer;
}

.portal-carnet-actions .primary-btn {
    border: 1px solid #ffe500;
    color: #11151c;
    background: #ffe500;
    cursor: pointer;
}

.portal-carnet-dialog .modal-close {
    border: 1px solid rgba(184, 198, 217, .2);
    color: #f5f7fb;
    background: rgba(255, 255, 255, .07);
    cursor: pointer;
}

@media (max-width: 620px) {
    .portal-modal-card {
        max-height: min(92dvh, 820px);
        border-radius: 20px 20px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .portal-modal-head {
        padding: 16px;
    }

    .portal-modal-body {
        padding: 16px;
    }

    .portal-carnet-modal {
        align-items: end;
        padding: 0;
    }

    .portal-carnet-dialog {
        width: 100%;
        max-height: min(94dvh, 900px);
        border-radius: 20px 20px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
}

@media (max-width: 480px) {
    .portal-modal {
        padding: 0;
    }

    .portal-modal-card {
        max-height: min(94dvh, 820px);
    }

    .portal-modal .modal-actions {
        flex-direction: column-reverse;
    }

    .portal-modal .modal-actions > button {
        width: 100%;
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-modal-backdrop,
    .portal-modal-card,
    .portal-carnet-backdrop,
    .portal-carnet-dialog {
        transition: none;
    }
}
