:root {
    --p-bg: #f0f4f8;
    --p-card: #ffffff;
    --p-border: #e2e8f0;
    --p-text: #1a202c;
    --p-muted: #718096;
    --p-accent: #2b6cb0;
    --p-accent-light: #ebf4ff;
    --p-success: #276749;
    --p-success-bg: #f0fff4;
    --p-danger: #c53030;
    --p-danger-bg: #fff5f5;
    --p-warn: #744210;
    --p-warn-bg: #fffaf0;
    --p-sidebar-bg: #1a365d;
    --p-sidebar-active: #2b6cb0;
    --p-sidebar-text: #a0aec0;
    --p-sidebar-text-on: #ffffff;
}

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

body.portal-body {
    font-family: 'Roboto', sans-serif;
    background: var(--p-bg);
    color: var(--p-text);
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.p-sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--p-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
}

.p-sidebar-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.p-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    line-height: 1.2;
}

.p-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--p-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.p-athlete-card {
    margin: 14px 14px 0;
    padding: 14px;
    background: rgba(255, 255, 255, .06);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.p-athlete-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--p-accent);
    background: #2a4a7f;
    flex-shrink: 0;
}

.p-athlete-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--p-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.p-athlete-info { overflow: hidden; }

.p-athlete-name {
    color: #fff;
    font-weight: 500;
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-athlete-meta {
    color: var(--p-sidebar-text);
    font-size: .75rem;
    margin-top: 2px;
}

.p-nav { flex: 1; padding: 16px 0 8px; overflow-y: auto; }

.p-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--p-sidebar-text);
    text-decoration: none;
    font-size: .87rem;
    border-left: 3px solid transparent;
    transition: color .15s, background .15s, border-color .15s;
}

.p-nav a:hover,
.p-nav a.active {
    color: var(--p-sidebar-text-on);
    background: rgba(255, 255, 255, .07);
    border-left-color: var(--p-accent);
}

.p-nav a i { width: 16px; text-align: center; font-size: .85rem; }

.p-sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--p-sidebar-text);
    text-decoration: none;
    font-size: .82rem;
    transition: color .15s;
}

.p-sidebar-footer a:hover { color: #fff; }

/* ── Main ── */
.p-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.p-topbar {
    background: var(--p-card);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--p-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.p-topbar-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: var(--p-text);
}

.p-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .85rem;
    color: var(--p-muted);
}

.p-topbar-actions a {
    color: var(--p-accent);
    text-decoration: none;
}

.p-topbar-actions a:hover { text-decoration: underline; }

.p-content { padding: 24px; flex: 1; }

/* ── Hero / Profile header ── */
.p-profile-header {
    background: linear-gradient(135deg, var(--p-sidebar-bg) 0%, #2c5282 100%);
    border-radius: 12px;
    padding: 28px 28px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.p-profile-header::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
}

.p-profile-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, .3);
    background: #2a4a7f;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.p-profile-photo-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: rgba(255, 255, 255, .7);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.p-profile-info { position: relative; z-index: 1; }

.p-profile-name {
    font-family: 'Oswald', sans-serif;
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.p-profile-meta {
    font-size: .875rem;
    opacity: .8;
    margin-bottom: 10px;
}

.p-profile-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.p-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

/* ── Cards ── */
.p-grid { display: grid; gap: 20px; }
.p-grid-2 { grid-template-columns: repeat(2, 1fr); }
.p-grid-3 { grid-template-columns: repeat(3, 1fr); }

.p-card {
    background: var(--p-card);
    border-radius: 10px;
    border: 1px solid var(--p-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    overflow: hidden;
}

.p-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--p-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.p-card-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    color: var(--p-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.p-card-body { padding: 18px; }

/* ── Info grid ── */
.p-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}

.p-info-item {}

.p-info-label {
    font-size: .75rem;
    color: var(--p-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
}

.p-info-value {
    font-size: .9rem;
    color: var(--p-text);
    font-weight: 500;
}

.p-info-value.redacted {
    filter: blur(5px);
    user-select: none;
    cursor: not-allowed;
}

/* ── Table ── */
.p-table-wrap { overflow-x: auto; }

.p-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.p-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--p-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--p-border);
    white-space: nowrap;
}

.p-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--p-border);
    color: var(--p-text);
    vertical-align: middle;
}

.p-table tr:last-child td { border-bottom: none; }

.p-table tr:hover td { background: var(--p-bg); }

/* ── Match result badges ── */
.result-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 600;
}

.result-vitoria { background: var(--p-success-bg); color: var(--p-success); }
.result-derrota { background: var(--p-danger-bg); color: var(--p-danger); }
.result-empate  { background: var(--p-warn-bg);    color: var(--p-warn); }

/* ── Biometrics ── */
.p-bio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.p-bio-item {
    background: var(--p-accent-light);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.p-bio-value {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    color: var(--p-accent);
    font-weight: 600;
}

.p-bio-unit { font-size: .7rem; color: var(--p-accent); }

.p-bio-label {
    font-size: .72rem;
    color: var(--p-muted);
    margin-top: 4px;
}

/* ── Tabs ── */
.p-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--p-border);
    margin-bottom: 20px;
}

.p-tab {
    padding: 10px 16px;
    font-size: .875rem;
    color: var(--p-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.p-tab:hover { color: var(--p-text); }

.p-tab.active {
    color: var(--p-accent);
    border-bottom-color: var(--p-accent);
    font-weight: 500;
}

/* ── Team card ── */
.p-team-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--p-border);
    border-radius: 8px;
    background: var(--p-bg);
}

.p-team-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--p-card);
    border: 1px solid var(--p-border);
    padding: 4px;
}

.p-team-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--p-accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--p-accent);
    font-size: 1.2rem;
}

.p-team-name {
    font-weight: 500;
    font-size: .9rem;
}

.p-team-coach {
    font-size: .8rem;
    color: var(--p-muted);
    margin-top: 2px;
}

/* ── Alert ── */
.p-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 16px;
}

.p-alert-error { background: var(--p-danger-bg); color: var(--p-danger); }

/* ── Empty state ── */
.p-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--p-muted);
}

.p-empty i { font-size: 2rem; margin-bottom: 8px; }

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

/* ── Login page ── */
.p-login-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.p-login-card {
    background: #fff;
    border-radius: 14px;
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.p-login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.p-login-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--p-accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.6rem;
    color: var(--p-accent);
}

.p-login-logo h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    color: var(--p-text);
    margin-bottom: 4px;
}

.p-login-logo p {
    font-size: .85rem;
    color: var(--p-muted);
}

/* ── Form ── */
.p-form { display: flex; flex-direction: column; gap: 14px; }

.fg { display: flex; flex-direction: column; gap: 5px; }

.fg label {
    font-size: .82rem;
    color: var(--p-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fg input {
    padding: 10px 12px;
    border: 1px solid var(--p-border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--p-text);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.fg input:focus {
    border-color: var(--p-accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, .15);
}

.p-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--p-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
    width: 100%;
    margin-top: 6px;
}

.p-btn-primary:hover { background: #2c5282; }

.p-login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: .8rem;
    color: var(--p-muted);
}

.p-login-footer a { color: var(--p-accent); text-decoration: none; }
.p-login-footer a:hover { text-decoration: underline; }

/* ── Section title ── */
.p-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.05rem;
    color: var(--p-text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.p-section-title i { color: var(--p-accent); }

/* ── Divider ── */
.p-divider {
    border: none;
    border-top: 1px solid var(--p-border);
    margin: 20px 0;
}

/* ── Portal do Sócio — componentes adicionais ── */
.p-stat-card {
    background: var(--p-card);
    border: 1px solid var(--p-border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.p-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.p-stat-value {
    font-family: 'Oswald', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
}
.p-stat-label { font-size: .78rem; color: var(--p-muted); text-transform: uppercase; letter-spacing: .5px; }

.p-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.p-status-success { background: #f0fff4; color: #276749; }
.p-status-danger  { background: #fff5f5; color: #c53030; }
.p-status-warn    { background: #fffaf0; color: #744210; }
.p-status-muted   { background: #f7fafc; color: #718096; }

.p-info-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.p-info-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--p-muted); }
.p-info-value { font-size: .92rem; color: var(--p-text); font-weight: 500; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .p-sidebar { width: 200px; }
    .p-main { margin-left: 200px; }
    .p-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Sidebar overlay (mobile) */
.p-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 299;
    cursor: pointer;
}
.p-sidebar-overlay.active { display: block; }

/* Botão mobile toggle no topbar */
.p-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--p-border);
    color: var(--p-muted);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: .9rem;
    line-height: 1;
    min-height: 36px;
    transition: color .15s, background .15s;
}
.p-mobile-toggle:hover { color: var(--p-text); background: var(--p-bg); }

@media (max-width: 680px) {
    body.portal-body { display: block; }
    .p-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 240px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .22s ease;
        z-index: 300;
        min-height: unset;
    }
    .p-sidebar.mobile-open { transform: translateX(0); }
    .p-mobile-toggle { display: flex; }
    .p-main { margin-left: 0; }
    .p-grid-2, .p-grid-3 { grid-template-columns: 1fr; }
    .p-info-grid { grid-template-columns: 1fr; }
    .p-profile-header { flex-direction: column; text-align: center; align-items: center; }
    .p-content { padding: 16px; }
    .p-topbar { padding: 12px 16px; gap: 10px; }
    .p-tabs { overflow-x: auto; padding-bottom: 2px; }
    .p-tab { white-space: nowrap; padding: 10px 12px; font-size: .82rem; }
}
