/* ============================================================
   portal/assets/portal.css — Portal de Atletas
   Diseño mobile-first, claro y accesible
   ============================================================ */



:root {

    --p-primary:     #FF6B35;

    --p-primary-dk:  #E8521A;

    --p-dark:        #1A1A2E;

    --p-bg:          #F0F2F8;

    --p-card:        #FFFFFF;

    --p-border:      #E2E6F0;

    --p-text:        #1A1A2E;

    --p-text-2:      #4A4A6A;

    --p-text-3:      #8888AA;

    --p-success:     #2ECC71;

    --p-danger:      #E74C3C;

    --p-warning:     #F39C12;

    --p-info:        #3498DB;

    --p-radius:      14px;

    --p-radius-sm:   8px;

    --p-shadow:      0 2px 20px rgba(26,26,46,0.08);

    --p-shadow-lg:   0 8px 40px rgba(26,26,46,0.12);

    --p-font:        'Outfit', sans-serif;

    --p-header-h:    64px;

    --p-nav-h:       60px;

}



*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior:smooth; }



body {

    font-family: var(--p-font);

    background: var(--p-bg);

    color: var(--p-text);

    min-height: 100vh;

    -webkit-font-smoothing: antialiased;

}



/* ── Scrollbar ── */

::-webkit-scrollbar { width:4px; }

::-webkit-scrollbar-track { background:transparent; }

::-webkit-scrollbar-thumb { background:var(--p-border); border-radius:99px; }



/* ── Header ── */

.p-header {

    position: fixed;

    top: 0; left: 0; right: 0;

    height: var(--p-header-h);

    background: var(--p-dark);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 1.25rem;

    z-index: 100;

    box-shadow: 0 2px 12px rgba(0,0,0,0.15);

}



.p-header-logo {

    display: flex;

    align-items: center;

    gap: 0.625rem;

}



.p-header-logo-mark {

    width: 34px; height: 34px;

    background: var(--p-primary);

    border-radius: 8px;

    display: flex; align-items: center; justify-content: center;

    font-size: 1rem; color: #fff;

}



.p-header-logo-name {

    font-family: 'Bebas Neue', sans-serif;

    font-size: 1.3rem;

    letter-spacing: 2px;

    color: #fff;

}



.p-header-logo-sub {

    font-size: 0.62rem;

    color: rgba(255,255,255,0.45);

    letter-spacing: 1px;

    text-transform: uppercase;

    display: block;

    margin-top: -4px;

}



.p-header-user {

    display: flex;

    align-items: center;

    gap: 0.5rem;

}



.p-avatar-sm {

    width: 34px; height: 34px;

    border-radius: 50%;

    background: var(--p-primary);

    display: flex; align-items: center; justify-content: center;

    font-weight: 700; font-size: 0.8rem; color: #fff;

    overflow: hidden;

    border: 2px solid rgba(255,255,255,0.2);

    flex-shrink: 0;

}

.p-avatar-sm img { width:100%; height:100%; object-fit:cover; }



.p-header-name {

    font-size: 0.82rem;

    color: rgba(255,255,255,0.85);

    font-weight: 500;

    display: none;

}



.p-logout-btn {

    width: 32px; height: 32px;

    border-radius: 8px;

    background: rgba(255,255,255,0.08);

    border: none;

    color: rgba(255,255,255,0.6);

    font-size: 0.85rem;

    cursor: pointer;

    display: flex; align-items: center; justify-content: center;

    text-decoration: none;

    transition: all 0.18s;

}

.p-logout-btn:hover { background:rgba(255,107,53,0.2); color:var(--p-primary); }



/* ── Main ── */

.p-main {

    padding-top: var(--p-header-h);

    padding-bottom: calc(var(--p-nav-h) + 1rem);

    min-height: 100vh;

}



.p-container {

    max-width: 680px;

    margin: 0 auto;

    padding: 1.25rem 1rem;

}



/* ── Bottom Nav (móvil) ── */

.p-bottom-nav {

    position: fixed;

    bottom: 0; left: 0; right: 0;

    height: var(--p-nav-h);

    background: var(--p-card);

    border-top: 1px solid var(--p-border);

    display: flex;

    z-index: 100;

    box-shadow: 0 -4px 20px rgba(26,26,46,0.08);

}



.p-nav-item {

    flex: 1;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 3px;

    text-decoration: none;

    color: var(--p-text-3);

    font-size: 0.62rem;

    font-weight: 500;

    letter-spacing: 0.3px;

    transition: color 0.18s;

    position: relative;

    padding-top: 4px;

}



.p-nav-item i {

    font-size: 1.1rem;

    transition: transform 0.2s;

}



.p-nav-item.active {

    color: var(--p-primary);

}



.p-nav-item.active i {

    transform: translateY(-2px);

}



.p-nav-item.active::before {

    content: '';

    position: absolute;

    top: 0; left: 20%; right: 20%;

    height: 3px;

    background: var(--p-primary);

    border-radius: 0 0 3px 3px;

}



/* ── Cards ── */

.p-card {

    background: var(--p-card);

    border-radius: var(--p-radius);

    box-shadow: var(--p-shadow);

    overflow: hidden;

    margin-bottom: 1rem;

}



.p-card-header {

    padding: 1rem 1.25rem;

    border-bottom: 1px solid var(--p-border);

    display: flex;

    align-items: center;

    justify-content: space-between;

}



.p-card-title {

    font-size: 0.9rem;

    font-weight: 600;

    color: var(--p-text);

    display: flex;

    align-items: center;

    gap: 0.5rem;

}



.p-card-title i { color: var(--p-primary); font-size: 0.875rem; }



.p-card-body { padding: 1.25rem; }


/* ── buttons personalizados ── */
.p-butts2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
     
}
.p-btt2 {
    text-align: center;
}

/* ── Stat mini cards ── */

.p-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.p-stat {
    background: var(--p-card);
    border-radius: var(--p-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--p-shadow);
}

.p-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--p-text);
    line-height: 1;
    margin-bottom: 0.25rem;
}



.p-stat-label {

    font-size: 0.68rem;

    color: var(--p-text-3);

    text-transform: uppercase;

    letter-spacing: 0.4px;

}



/* ── Badges ── */

.p-badge {

    display: inline-flex;

    align-items: center;

    gap: 0.25rem;

    padding: 0.25rem 0.625rem;

    border-radius: 99px;

    font-size: 0.7rem;

    font-weight: 600;

}



.p-badge-success { background:#EAFAF1; color:#1A8A4A; }

.p-badge-danger  { background:#FDEDEC; color:#C0392B; }

.p-badge-warning { background:#FEF9E7; color:#B7770D; }

.p-badge-info    { background:#EBF5FB; color:#1A6FA3; }

.p-badge-primary { background:#FFF0EB; color:var(--p-primary); }

.p-badge-gray    { background:#F0F2F8; color:var(--p-text-3); }



/* ── Listas de items ── */

.p-list-item {

    display: flex;

    align-items: center;

    gap: 0.875rem;

    padding: 0.875rem 1.25rem;

    border-bottom: 1px solid var(--p-border);

    transition: background 0.15s;

}



.p-list-item:last-child { border-bottom: none; }

.p-list-item:hover { background: #F8F9FC; }



.p-list-icon {

    width: 38px; height: 38px;

    border-radius: 10px;

    display: flex; align-items: center; justify-content: center;

    font-size: 0.95rem;

    flex-shrink: 0;

}



.p-list-content { flex: 1; min-width: 0; }



.p-list-title {

    font-size: 0.875rem;

    font-weight: 500;

    color: var(--p-text);

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}



.p-list-sub {

    font-size: 0.75rem;

    color: var(--p-text-3);

    margin-top: 1px;

}



/* ── Botones ── */

.p-btn {

    display: inline-flex;

    align-items: center;

    gap: 0.4rem;

    padding: 0.7rem 1.25rem;

    border-radius: var(--p-radius-sm);

    border: none;

    font-family: var(--p-font);

    font-size: 0.875rem;

    font-weight: 600;

    cursor: pointer;

    text-decoration: none;

    transition: all 0.18s;

    white-space: nowrap;

}



.p-btn-primary {

    background: var(--p-primary);

    color: #fff;

    box-shadow: 0 4px 14px rgba(255,107,53,0.3);

}

.p-btn-primary:hover { background: var(--p-primary-dk); transform: translateY(-1px); }



.p-btn-outline {

    background: transparent;

    color: var(--p-primary);

    border: 1.5px solid var(--p-primary);

}

.p-btn-outline:hover { background: #FFF0EB; }



.p-btn-ghost {

    background: #F0F2F8;

    color: var(--p-text-2);

    border: 1px solid var(--p-border);

}

.p-btn-ghost:hover { background: var(--p-border); }



.p-btn-block { width: 100%; justify-content: center; }

.p-btn-sm    { padding: 0.45rem 0.875rem; font-size: 0.78rem; }



/* ── Formularios ── */

.p-form-group { margin-bottom: 1rem; }



.p-label {

    display: block;

    font-size: 0.78rem;

    font-weight: 600;

    color: var(--p-text-2);

    margin-bottom: 0.4rem;

    letter-spacing: 0.2px;

}



.p-input {

    width: 100%;

    padding: 0.8rem 1rem;

    background: #F8F9FC;

    border: 1.5px solid var(--p-border);

    border-radius: var(--p-radius-sm);

    color: var(--p-text);

    font-family: var(--p-font);

    font-size: 0.9rem;

    outline: none;

    transition: border-color 0.18s, box-shadow 0.18s;

    -webkit-appearance: none;

}

.p-input:focus {

    border-color: var(--p-primary);

    box-shadow: 0 0 0 3px rgba(255,107,53,0.12);

    background: #fff;

}

.p-input::placeholder { color: var(--p-text-3); }



.p-input-wrap { position: relative; }

.p-input-icon {

    position: absolute;

    left: 0.875rem; top: 50%;

    transform: translateY(-50%);

    color: var(--p-text-3);

    font-size: 0.875rem;

}

.p-input-wrap .p-input { padding-left: 2.5rem; }



/* ── Alertas ── */

.p-alert {

    padding: 0.875rem 1rem;

    border-radius: var(--p-radius-sm);

    font-size: 0.85rem;

    display: flex;

    align-items: flex-start;

    gap: 0.625rem;

    margin-bottom: 1rem;

}

.p-alert-danger  { background:#FDEDEC; color:#922B21; border-left:3px solid var(--p-danger); }

.p-alert-success { background:#EAFAF1; color:#1A6A3A; border-left:3px solid var(--p-success); }

.p-alert-warning { background:#FEF9E7; color:#7D6608; border-left:3px solid var(--p-warning); }

.p-alert-info    { background:#EBF5FB; color:#1A5276; border-left:3px solid var(--p-info); }



/* ── Barra de progreso ── */

.p-progress { height: 8px; background: var(--p-border); border-radius: 99px; overflow: hidden; }

.p-progress-bar { height: 100%; border-radius: 99px; transition: width 1s ease; }



/* ── Empty state ── */

.p-empty {

    text-align: center;

    padding: 2.5rem 1rem;

    color: var(--p-text-3);

}

.p-empty i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; opacity: 0.35; }

.p-empty h3 { font-size: 0.95rem; font-weight: 600; color: var(--p-text-2); margin-bottom: 0.3rem; }

.p-empty p  { font-size: 0.8rem; }



/* ── Cinturón visual ── */

.belt-visual {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 4px 12px 4px 8px;

    border-radius: 99px;

    font-size: 0.825rem;

    font-weight: 600;

}

.belt-bar { width: 20px; height: 5px; border-radius: 3px; }



/* ── Timeline de grados (versión portal) ── */

.p-timeline { position: relative; padding-left: 2rem; }

.p-timeline::before {

    content: '';

    position: absolute;

    left: 10px; top: 4px; bottom: 4px; width: 2px;

    background: var(--p-border);

}

.p-tl-item { position: relative; padding-bottom: 1.25rem; }

.p-tl-item:last-child { padding-bottom: 0; }

.p-tl-dot {

    position: absolute;

    left: -1.625rem; top: 0.2rem;

    width: 20px; height: 20px;

    border-radius: 50%;

    display: flex; align-items: center; justify-content: center;

    font-size: 0.55rem; color: #fff; font-weight: 700;

    border: 3px solid #fff;

    box-shadow: 0 0 0 2px var(--p-border);

}

.p-tl-card {

    background: #F8F9FC;

    border-radius: var(--p-radius-sm);

    padding: 0.875rem 1rem;

    border: 1px solid var(--p-border);

}

.p-tl-item.actual .p-tl-card {

    background: #FFF0EB;

    border-color: rgba(255,107,53,0.3);

}



/* ── Sidebar: oculto en móvil, visible en desktop ── */

.p-sidebar { display: none; }

/* ── Hamburguesa: oculta por defecto, visible solo en móvil ── */

.p-menu-toggle { display: none; }

@media (max-width: 767px) {
    .p-menu-toggle {
        display: flex;
        align-items: center; justify-content: center;
        width: 34px; height: 34px;
        border-radius: 8px;
        background: rgba(255,255,255,0.1);
        border: none;
        color: rgba(255,255,255,0.85);
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.18s;
        flex-shrink: 0;
    }
    .p-menu-toggle:hover { background: rgba(255,255,255,0.18); }
}

/* ── Drawer overlay ── */

.p-drawer-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    backdrop-filter: blur(2px);
}
.p-drawer-overlay.open { display: block; }

/* ── Drawer panel ── */

.p-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(300px, 85vw);
    background: var(--p-card);
    z-index: 201;
    display: flex; flex-direction: column;
    transform: translateX(110%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -8px 0 40px rgba(26,26,46,0.2);
    overflow-y: auto;
}
.p-drawer.open { transform: translateX(0); }

.p-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1rem .875rem;
    background: var(--p-dark);
    flex-shrink: 0;
    gap: .5rem;
}

.p-drawer-close {
    background: rgba(255,255,255,0.12);
    border: none;
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: .875rem;
    flex-shrink: 0;
    transition: background 0.15s;
}
.p-drawer-close:hover { background: rgba(255,255,255,0.2); }

.p-drawer-nav { display: flex; flex-direction: column; padding: .375rem 0; flex: 1; }

.p-drawer-sep { height: 1px; background: var(--p-border); margin: .375rem .75rem; }

.p-drawer-item {
    display: flex; align-items: center; gap: .875rem;
    padding: .75rem 1.25rem;
    color: var(--p-text-2);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
}
.p-drawer-item i { width: 18px; text-align: center; color: var(--p-text-3); flex-shrink: 0; font-size: .875rem; }
.p-drawer-item span { flex: 1; }
.p-drawer-item:hover { background: #F8F9FC; color: var(--p-text); }
.p-drawer-item.active { color: var(--p-primary); font-weight: 600; background: #FFF0EB; }
.p-drawer-item.active i { color: var(--p-primary); }
.p-drawer-item--danger { color: var(--p-danger) !important; }
.p-drawer-item--danger i { color: var(--p-danger) !important; }

/* Badges unificados (sidebar + drawer) */

.p-nav-badge {
    min-width: 20px; height: 20px; border-radius: 99px;
    font-size: .6rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px;
}
.p-nav-badge--warn   { background: var(--p-warning); color: #fff; }
.p-nav-badge--danger { background: var(--p-danger);  color: #fff; }

/* Perfil en sidebar */

.p-sidebar-profile {
    display: flex; align-items: center; gap: .75rem;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--p-border);
    margin-bottom: .5rem;
}



/* ── Responsive ── */

@media (min-width: 640px) {

    .p-header-name { display: block; }

    .p-container { padding: 1.5rem 1.25rem; }

    .p-stats { grid-template-columns: repeat(3, 1fr); }

}



@media (min-width: 768px) {

    .p-bottom-nav { display: none; }

    .p-main { padding-bottom: 1.5rem; }

    /* Sidebar en desktop */

    .p-sidebar {

        display: block;

        position: fixed;

        top: var(--p-header-h); left: 0; bottom: 0;

        width: 220px;

        background: var(--p-card);

        border-right: 1px solid var(--p-border);

        padding: 1.5rem 0;

        overflow-y: auto;

        z-index: 50;

        box-shadow: 2px 0 12px rgba(26,26,46,0.04);

    }

    .p-sidebar-nav { display: flex; flex-direction: column; }

    .p-sidebar-item {

        display: flex;

        align-items: center;

        gap: 0.75rem;

        padding: 0.75rem 1.5rem;

        color: var(--p-text-2);

        text-decoration: none;

        font-size: 0.875rem;

        font-weight: 400;

        transition: all 0.15s;

        border-right: 3px solid transparent;

    }

    .p-sidebar-item i { width: 16px; text-align: center; font-size: 0.875rem; }

    .p-sidebar-item:hover { background: #F8F9FC; color: var(--p-text); }

    .p-sidebar-item.active {

        color: var(--p-primary);

        background: #FFF0EB;

        border-right-color: var(--p-primary);

        font-weight: 600;

    }

    .p-main-with-sidebar { margin-left: 220px; }

}



/* Print — carnet y recibos */

@media print {

    .p-header, .p-bottom-nav, .p-sidebar,

    .no-print, .p-btn { display: none !important; }

    body { background: #fff; }

    .p-main { padding-top: 0; margin-left: 0 !important; }

}