: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;
}

.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: 140;
    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;
    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 {
    color: rgba(255, 255, 255, 0.9);
    font-family: Outfit, Inter, sans-serif;
    font-size: 13px;
    line-height: 1;
}

@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;
}

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-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);
}

@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%;
    }
}
