/* ===== VARIÁVEIS ===== */
:root {
    --copa-verde:      #1a6b3c;
    --copa-verde-dark: #0f4525;
    --copa-verde-deep: #0a2d18;
    --copa-ouro:       #FFD700;
    --copa-ouro-dark:  #e6c200;
    --sidebar-w:       260px;
    --topbar-h:        56px;
    --radius:          12px;
}

/* ===== BASE ===== */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; }

/* ===== LOGIN ===== */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--copa-verde-deep) 0%, var(--copa-verde) 50%, var(--copa-verde-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}
.login-body::before {
    content: '⚽';
    position: absolute;
    font-size: 40vw;
    opacity: .04;
    top: -10%;
    right: -10%;
    transform: rotate(-20deg);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    z-index: 1;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

.login-header {
    background: linear-gradient(135deg, var(--copa-verde-dark), var(--copa-verde));
    color: #fff;
    text-align: center;
    padding: 2.5rem 1.5rem 2rem;
}
.trophy-icon {
    font-size: 3rem;
    color: var(--copa-ouro);
    margin-bottom: .75rem;
    filter: drop-shadow(0 2px 6px rgba(255,215,0,.5));
}
.login-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 .25rem;
    letter-spacing: .5px;
}
.login-header .brand {
    font-size: 1rem;
    color: var(--copa-ouro);
    font-weight: 600;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-body-content { padding: 2rem; }

.login-footer {
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
    padding: .75rem;
    font-size: .85rem;
    color: #777;
}

/* ===== BOTÃO COPA ===== */
.btn-copa {
    background: linear-gradient(135deg, var(--copa-verde), var(--copa-verde-dark));
    color: #fff !important;
    border: none;
    font-weight: 600;
    transition: filter .2s, transform .1s;
}
.btn-copa:hover  { filter: brightness(1.15); color: #fff !important; }
.btn-copa:active { transform: scale(.98); }

.btn-outline-copa {
    border: 2px solid var(--copa-verde);
    color: var(--copa-verde);
    font-weight: 600;
    background: transparent;
    transition: all .2s;
}
.btn-outline-copa:hover {
    background: var(--copa-verde);
    color: #fff !important;
}

/* ===== LAYOUT APP ===== */
.app-body { background: #f0f2f5; min-height: 100vh; }

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--copa-verde-dark) 0%, var(--copa-verde-deep) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand .fa-trophy {
    font-size: 2rem;
    color: var(--copa-ouro);
    filter: drop-shadow(0 0 8px rgba(255,215,0,.4));
}
.brand-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}
.brand-sub {
    display: block;
    font-size: .7rem;
    color: var(--copa-ouro);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: .9;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: .5rem 1rem;
}

.sidebar-nav {
    list-style: none;
    padding: .5rem 0;
    margin: 0;
    flex: 1;
}
.sidebar-section {
    font-size: .68rem;
    color: rgba(255,255,255,.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 1rem 1.25rem .25rem;
    margin-top: .25rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    color: rgba(255,255,255,.82);
    text-decoration: none;
    border-radius: 8px;
    margin: .15rem .6rem;
    font-size: .92rem;
    font-weight: 500;
    transition: background .2s, color .2s;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 1rem; }
.sidebar-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-link.active {
    background: var(--copa-ouro);
    color: var(--copa-verde-dark) !important;
    font-weight: 700;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: auto;
}
.user-avatar {
    width: 36px; height: 36px;
    background: var(--copa-ouro);
    color: var(--copa-verde-dark);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}
.user-details { flex: 1; overflow: hidden; }
.user-name {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role { display: block; font-size: .72rem; color: rgba(255,255,255,.5); }
.btn-logout {
    color: rgba(255,255,255,.6);
    font-size: 1.1rem;
    transition: color .2s;
}
.btn-logout:hover { color: #ff6b6b; }

/* ===== ÁREA PRINCIPAL ===== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--copa-verde);
    height: var(--topbar-h);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.main-content {
    flex: 1;
    padding: 1.75rem;
}

.page-header {
    margin-bottom: 1.75rem;
    border-bottom: 2px solid var(--copa-ouro);
    padding-bottom: .75rem;
}
.page-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--copa-verde-dark);
    margin: 0 0 .35rem;
}
.breadcrumb { font-size: .82rem; }
.breadcrumb-item.active { color: #666; }

/* ===== CARDS DE STAT ===== */
.stat-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    color: #fff;
    font-weight: 600;
}
.stat-blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-green  { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-orange { background: linear-gradient(135deg, #ea580c, #c2410c); }
.stat-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }

.stat-icon { font-size: 2rem; opacity: .85; }
.stat-value { display: block; font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { display: block; font-size: .8rem; opacity: .9; margin-top: .2rem; }

/* ===== CARD COPA ===== */
.card-copa {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    overflow: hidden;
}
.card-copa-header {
    background: linear-gradient(135deg, var(--copa-verde-dark), var(--copa-verde));
    color: #fff;
    padding: .85rem 1.25rem;
    font-weight: 700;
    font-size: .95rem;
}
.card-copa-body { padding: 1.25rem; }

.bg-copa { background: linear-gradient(135deg, var(--copa-verde-dark), var(--copa-verde)); }

/* ===== PRÓXIMO JOGO ===== */
.fase-badge {
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--copa-verde);
    margin-bottom: .75rem;
}
.placar-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
}
.time-box { flex: 1; text-align: center; }
.time-nome {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--copa-verde-dark);
    display: block;
}
.vs-box { text-align: center; flex-shrink: 0; }
.vs {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--copa-verde);
}
.data-hora { display: block; font-size: .78rem; color: #777; margin-top: .25rem; }

/* ===== PONTUAÇÃO ===== */
.pontos-card {
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
}
.pontos-valor { font-size: 1.6rem; font-weight: 900; }
.pontos-desc  { font-size: .78rem; margin-top: .2rem; }
.pontos-ouro   { background: linear-gradient(135deg, #ffd70022, #ffd70055); border: 2px solid var(--copa-ouro); color: #8B6914; }
.pontos-prata  { background: linear-gradient(135deg, #c0c0c022, #c0c0c055); border: 2px solid #C0C0C0; color: #555; }
.pontos-bronze { background: linear-gradient(135deg, #cd7f3222, #cd7f3255); border: 2px solid #CD7F32; color: #7a4a1a; }
.pontos-zero   { background: linear-gradient(135deg, #ff000011, #ff000022); border: 2px solid #ffaaaa; color: #c0392b; }

/* ===== FASE SECTION ===== */
.fase-section {}
.fase-titulo {
    color: var(--copa-verde-dark);
    font-weight: 800;
    font-size: 1rem;
    padding: .6rem 1rem;
    background: linear-gradient(90deg, rgba(26,107,60,.1), transparent);
    border-left: 4px solid var(--copa-verde);
    border-radius: 0 8px 8px 0;
    margin-bottom: .75rem;
}
.grupo-bloco {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.grupo-header {
    background: linear-gradient(90deg, var(--copa-verde), var(--copa-verde-dark));
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    padding: .5rem 1rem;
    letter-spacing: .5px;
}

/* ===== PÓDIO ===== */
.podio-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.5rem 0;
}
.podio-item {
    text-align: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    min-width: 110px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transition: transform .2s;
}
.podio-item:hover { transform: translateY(-3px); }
.podio-ouro   { background: linear-gradient(135deg, #fff9c4, #fff176); border: 2px solid var(--copa-ouro); order: 2; }
.podio-prata  { background: linear-gradient(135deg, #f5f5f5, #e0e0e0); border: 2px solid #C0C0C0; order: 1; }
.podio-bronze { background: linear-gradient(135deg, #fff3e0, #ffe0b2); border: 2px solid #CD7F32; order: 3; }
.podio-icone  { font-size: 2rem; margin-bottom: .4rem; }
.podio-ouro .podio-icone   { color: var(--copa-ouro); }
.podio-prata .podio-icone  { color: #C0C0C0; }
.podio-bronze .podio-icone { color: #CD7F32; }
.podio-pos  { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #777; }
.podio-nome { font-size: .95rem; font-weight: 800; color: #222; margin: .3rem 0 .2rem; }
.podio-pts  { font-size: 1.4rem; font-weight: 900; color: var(--copa-verde-dark); }
.podio-pts small { font-size: .7rem; font-weight: 400; }

/* ===== RANKING TABLE ===== */
.ranking-table { margin: 0; }
.ranking-minha-linha { background: rgba(255,215,0,.12) !important; font-weight: 600; }
.pts-badge {
    background: linear-gradient(135deg, var(--copa-verde-dark), var(--copa-verde));
    color: #fff;
    padding: .25rem .6rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: .9rem;
}
.ranking-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: rgba(255,255,255,.7);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: .84rem;
    color: #555;
}
.stat-mini { display: flex; align-items: center; gap: .5rem; }
.stat-mini .fa { color: var(--copa-verde); }

/* ===== PALPITES ===== */
.fase-tabs {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: .5rem;
}
.fase-tab {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #555;
    padding: .3rem .85rem;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.fase-tab:hover { border-color: var(--copa-verde); color: var(--copa-verde); }
.fase-tab.active {
    background: var(--copa-verde);
    color: #fff;
    border-color: var(--copa-verde);
    font-weight: 700;
}

.palpite-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
    transition: border-color .2s, box-shadow .2s;
}
.palpite-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.palpite-card.encerrado {
    border-color: #d1fae5;
    background: #f0fdf4;
}
.palpite-card.em-andamento {
    border-color: #fef3c7;
    background: #fffbeb;
}

.palpite-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .25rem;
    font-size: .82rem;
    color: #666;
}
.palpite-data { font-weight: 600; }

.jogo-countdown {
    font-size: .78rem;
    white-space: nowrap;
}
.countdown-txt {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-variant-numeric: tabular-nums;
}

.palpite-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    padding: .5rem 0;
}
.palpite-time {
    flex: 1;
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--copa-verde-dark);
}
.palpite-inputs {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
.placar-input {
    width: 60px;
    height: 48px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    border: 2px solid var(--copa-verde);
    border-radius: 8px;
    outline: none;
    color: var(--copa-verde-dark);
    transition: border-color .2s, box-shadow .2s;
}
.placar-input:focus {
    border-color: var(--copa-ouro);
    box-shadow: 0 0 0 3px rgba(255,215,0,.25);
}
.placar-input:disabled {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}
.placar-sep {
    font-size: 1.5rem;
    font-weight: 900;
    color: #9ca3af;
}

.palpite-actions {
    display: flex;
    justify-content: center;
    gap: .75rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed #e5e7eb;
}

.resultado-oficial {
    text-align: center;
    font-size: .85rem;
    color: #16a34a;
    padding-top: .5rem;
    border-top: 1px dashed #d1fae5;
    margin-top: .5rem;
}

/* Badge laranja (deadline próximo) */
.badge.bg-orange { background-color: #ea580c !important; color: #fff; }

/* ===== TOAST ===== */
.toast-container-custom {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.toast-item {
    background: #fff;
    border-left: 5px solid var(--copa-verde);
    border-radius: 8px;
    padding: .75rem 1.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    font-size: .9rem;
    font-weight: 600;
    min-width: 260px;
    max-width: 380px;
    animation: slideIn .3s ease;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.toast-item.success { border-color: #16a34a; }
.toast-item.danger  { border-color: #dc2626; }
.toast-item.warning { border-color: #d97706; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}
.toast-item.saindo { animation: slideOut .3s ease forwards; }

/* ===== OVERLAY MOBILE ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        transform: translateX(-100%);
        height: 100vh;
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .main-area { width: 100%; }
    .main-content { padding: 1.25rem; }
}
@media (max-width: 575.98px) {
    .palpite-time { font-size: .85rem; }
    .placar-input { width: 52px; height: 42px; font-size: 1.1rem; }
    .podio-container { gap: .5rem; }
    .podio-item { min-width: 85px; padding: .75rem 1rem; }
}
