:root {
    /* Paleta CicloBikes — usada com moderação: vermelho como ACCENT, não como
       cor de fundo dominante. Design mais clean, ao estilo de painéis SaaS atuais. */
    --brand-red: #d21f1f;
    --brand-red-dark: #a51616;
    --brand-red-soft: #fdecec;
    --brand-red-soft-dark: rgba(210,31,31,.16);
    --ink: #16181d;
    --ink-soft: #6b7280;
    --surface-alt: #f6f7f9;
    --border-soft: #e7e8ec;

    /* Cores semânticas de status — independentes da marca */
    --status-ativa: #1f9d55;
    --status-planejada: #6c757d;
    --status-encerrada: #343a40;
}

[data-bs-theme="dark"] {
    --surface-alt: #24262b;
    --border-soft: #33353b;
    --brand-red-soft: rgba(210,31,31,.18);
}

/* --------------------------------------------------------------
   Recolore o AdminLTE / Bootstrap 5 (botões, links, foco de formulário)
-------------------------------------------------------------- */
:root, [data-bs-theme="light"] {
    --bs-primary: var(--brand-red);
    --bs-primary-rgb: 210, 31, 31;
}
[data-bs-theme="dark"] {
    --bs-primary: #ff6b6b;
    --bs-primary-rgb: 255, 107, 107;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Marca no topo do menu lateral (AdminLTE) */
.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
}

.brand-image-logo { max-width: 100%; max-height: 48px; width: auto; height: auto; }
.topbar-logo { max-height: 28px; width: auto; }
.public-navbar-logo { max-height: 40px; width: auto; }

/* Área pública (layout independente do AdminLTE) — sólida, sem degradê */
.public-navbar {
    background-color: var(--ink);
    border-bottom: 2px solid var(--brand-red);
}

/* Cards de Copa: acento fino no topo, sem borda lateral grossa */
.card-copa {
    border: 1px solid var(--border-soft);
    border-top: 3px solid var(--brand-red);
    transition: transform .15s ease, box-shadow .15s ease;
}

.card-copa:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important;
}

.badge-status-ativa { background-color: var(--status-ativa) !important; }
.badge-status-planejada { background-color: var(--status-planejada) !important; }
.badge-status-encerrada { background-color: var(--status-encerrada) !important; }

.table-classificacao th, .table-classificacao td {
    white-space: nowrap;
}

.pos-1 { background-color: #fff8e1; font-weight: 700; }
.pos-2 { background-color: #f5f5f5; font-weight: 600; }
.pos-3 { background-color: #fdece6; font-weight: 600; }
.pos-4, .pos-5 { background-color: var(--brand-red-soft); font-weight: 600; }

[data-bs-theme="dark"] .pos-1 { background-color: rgba(255,193,7,.14); }
[data-bs-theme="dark"] .pos-2 { background-color: rgba(173,181,189,.14); }
[data-bs-theme="dark"] .pos-3 { background-color: rgba(255,107,107,.12); }
[data-bs-theme="dark"] .pos-4, [data-bs-theme="dark"] .pos-5 { background-color: rgba(255,107,107,.08); }

/* --------------------------------------------------------------
   Tabelas de classificação / ranking — visual clean, sem degradê pesado
-------------------------------------------------------------- */
.table-tech {
    border-collapse: separate;
    border-spacing: 0;
}

.table-tech thead th {
    background-color: var(--surface-alt);
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .74rem;
    font-weight: 700;
    border: none !important;
    border-bottom: 2px solid var(--brand-red) !important;
    padding-top: .7rem;
    padding-bottom: .7rem;
}

.table-tech thead th:first-child { border-top-left-radius: .5rem; }
.table-tech thead th:last-child { border-top-right-radius: .5rem; }

.table-tech tbody tr {
    transition: background-color .12s ease;
}

.table-tech tbody tr:hover {
    background-color: var(--brand-red-soft) !important;
}

/* Coluna de pontos/total em destaque — "chip" leve, sem degradê */
.pontos-destaque { font-variant-numeric: tabular-nums; }

.pontos-destaque .pill {
    display: inline-block;
    min-width: 3rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-weight: 700;
    color: var(--brand-red-dark);
    background-color: var(--brand-red-soft);
}

[data-bs-theme="dark"] .pontos-destaque .pill { color: #ff8a8a; }

/* --------------------------------------------------------------
   Avatares e fotos (atletas / copas)
-------------------------------------------------------------- */
.avatar-atleta {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--border-soft);
}

.avatar-atleta-lg {
    width: 120px; height: 120px; border-radius: 50%;
    object-fit: cover; border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--border-soft), 0 4px 10px rgba(0,0,0,.12);
}

.avatar-placeholder {
    width: 44px; height: 44px; border-radius: 50%;
    background-color: var(--surface-alt); color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center;
}

.avatar-placeholder-lg {
    width: 120px; height: 120px; border-radius: 50%;
    background-color: var(--surface-alt); color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}

.foto-copa { width: 100%; height: 160px; object-fit: cover; border-radius: .5rem .5rem 0 0; }
.foto-copa-hero { width: 100%; max-height: 280px; object-fit: cover; border-radius: .5rem; }

/* --------------------------------------------------------------
   Perfil público do atleta — conquistas, comparação e Strava
-------------------------------------------------------------- */
.conquista-badge {
    text-align: center;
    padding: 1rem .5rem;
    border-radius: .75rem;
    background-color: var(--surface-alt);
    border: 1px solid var(--border-soft);
    transition: transform .15s ease;
}

.conquista-badge:hover { transform: translateY(-3px); }
.conquista-badge.bloqueada { opacity: .4; filter: grayscale(1); }

.conquista-icone {
    font-size: 2rem;
    display: block;
    margin-bottom: .4rem;
    color: var(--brand-red);
}

/* Card de comparação (VS) — clean, com acento em vez de fundo pesado */
.vs-card {
    background-color: #fff;
    border: 1px solid var(--border-soft);
    border-top: 3px solid var(--brand-red);
    border-radius: 1rem;
}

[data-bs-theme="dark"] .vs-card { background-color: var(--surface-alt); }

.vs-badge {
    width: 52px; height: 52px; border-radius: 50%;
    background-color: var(--brand-red-soft); color: var(--brand-red-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem; margin: 0 auto;
}

/* Card de Rider Performance Score (Strava) */
.rps-card {
    background: linear-gradient(180deg, #fff8f0, #fff);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
}
[data-bs-theme="dark"] .rps-card { background: var(--surface-alt); }

.rps-ring {
    width: 110px; height: 110px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--brand-red) calc(var(--rps-pct, 0) * 1%), var(--border-soft) 0);
}

.rps-ring-inner {
    width: 88px; height: 88px; border-radius: 50%;
    background: #fff; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
[data-bs-theme="dark"] .rps-ring-inner { background: #1b1c1f; }

.rps-tier {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .8rem;
}
.rps-tier-bronze { background: #f4e4d4; color: #8a5a2b; }
.rps-tier-prata { background: #e9ecef; color: #495057; }
.rps-tier-ouro { background: #fff3cd; color: #997404; }
.rps-tier-platina { background: #e0f2fe; color: #075985; }

@media print {
    .no-print { display: none !important; }
}
