/* =========================================
   CORREÇÃO GLOBAL DO FUNDO (Painel)
   ========================================= */
body.page-template-page-painel {
    background-color: #020617 !important; /* Fundo Void */
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body.page-template-page-painel::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px; 
    mask-image: radial-gradient(circle at center top, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center top, black 30%, transparent 100%);
    pointer-events: none; 
    z-index: -1;
}

/* =========================================
   WRAPPER
   ========================================= */
.metria-dashboard-wrapper {
    background: transparent; 
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    width: 100%;
    position: relative;
    padding-top: 110px;
    padding-bottom: 40px;
    
    /* Variáveis Locais */
    --bg-surface: #0f172a; 
    --bg-card: rgba(15, 23, 42, 0.85);
    --border: rgba(255,255,255,0.08);
    --primary: #4f46e5;
    --cyan: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-muted: #94a3b8;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    position: relative;
    z-index: 1;
}

/* CARDS */
.glass-card {
    background: var(--bg-surface); 
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s ease;
}
.glass-card:hover {
    border-color: rgba(255,255,255,0.15);
}

/* SIDEBAR (Col) */
.sidebar-col { display: flex; flex-direction: column; gap: 20px; }
.profile-header { text-align: center; }
.profile-img-wrapper {
    position: relative; width: 100px; height: 100px; margin: 0 auto 15px;
}
.profile-img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border); padding: 3px;
    background: linear-gradient(135deg, var(--cyan), var(--primary));
}
.level-badge {
    position: absolute; bottom: 0; right: 0;
    background: var(--bg-surface); border: 1px solid var(--warning);
    color: var(--warning); font-size: 0.75rem; font-weight: 700;
    padding: 2px 8px; border-radius: 12px;
}
.d-user-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; color: white; letter-spacing: -0.02em; }
.user-plan { font-size: 0.85rem; color: var(--cyan); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.xp-container { margin-top: 20px; }
.xp-info { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.xp-track { width: 100%; height: 6px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--primary)); width: 65%; border-radius: 10px; }

/* Streak */
.streak-card h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: white; font-weight: 600; }
.streak-count { font-size: 2.5rem; font-weight: 800; color: white; line-height: 1; letter-spacing: -0.02em; }
.streak-label { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; }
.week-grid { display: flex; justify-content: space-between; }
.day-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-name { font-size: 0.7rem; color: var(--text-muted); }
.day-circle {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; color: rgba(255,255,255,0.2);
}
.day-circle.active {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
}
.day-circle.today { border-color: var(--cyan); color: var(--cyan); }

/* MAIN */
.main-col { display: flex; flex-direction: column; gap: 25px; }
.welcome-banner { display: flex; justify-content: space-between; align-items: end; margin-bottom: 10px; }
.wb-text h1 { font-size: 2rem; font-weight: 800; margin-bottom: 5px; color: white; letter-spacing: -0.02em; }
.wb-text p { color: var(--text-muted); font-size: 1.05rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }

.stat-card {
    background: var(--bg-surface); 
    border: 1px solid var(--border); 
    border-radius: 12px; padding: 20px;
    display: flex; flex-direction: column; gap: 5px;
}

.stat-icon { font-size: 1.2rem; color: var(--primary); margin-bottom: 5px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: white; letter-spacing: -0.02em; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-trend { font-size: 0.75rem; color: var(--success); margin-top: auto; display: flex; align-items: center; gap: 4px; }

.dashboard-split { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h3 { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; color: white; letter-spacing: -0.01em; }
.btn-sm { font-size: 0.85rem; color: var(--cyan); text-decoration: none; font-weight: 600; cursor: pointer; border:none; background:none; }
.btn-sm:hover { color: #fff; }

.skill-item { margin-bottom: 15px; }
.skill-header { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }
.skill-name { color: white; font-weight: 500; }
.skill-val { color: #f87171; font-weight: 600; }
.skill-track { width: 100%; height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.skill-bar { height: 100%; background: var(--danger); border-radius: 4px; }

.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-item {
    display: flex; align-items: center; gap: 15px;
    padding: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border);
    border-radius: 10px; transition: 0.2s; cursor: pointer;
}
.review-item:hover { background: rgba(255,255,255,0.05); border-color: var(--primary); transform: translateX(2px); }
.ri-icon { 
    width: 40px; height: 40px; border-radius: 8px; background: rgba(79, 70, 229, 0.1); 
    display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.ri-content { flex: 1; }
.ri-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; color: white; }
.ri-meta { font-size: 0.75rem; color: var(--text-muted); }
.ri-action { color: var(--text-muted); }

.mission-box {
    background: 
        linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(6, 182, 212, 0.05)),
        var(--bg-surface); 
    
    border: 1px solid rgba(79, 70, 229, 0.2); border-radius: 12px; padding: 15px 20px;
    display: flex; align-items: center; justify-content: space-between; margin-top: 5px;
}
.mb-content h4 { font-size: 0.95rem; margin-bottom: 4px; color: #c7d2fe; font-weight: 600; }
.mb-content p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.btn-mission {
    background: var(--primary); color: white; border: none; padding: 10px 20px;
    border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.9rem; transition: 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}
.btn-mission:hover { box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4); transform: translateY(-1px); }

/* Loader Otimizado */
#pageLoader {
    position: fixed; inset: 0; background: #020617; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.3s ease;
}
.loader-spinner { font-size: 2rem; color: #4f46e5; }

@media (max-width: 900px) {
    .dashboard-container { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-split { grid-template-columns: 1fr; }
    .sidebar-col { flex-direction: row; flex-wrap: wrap; }
    .glass-card { flex: 1; min-width: 300px; }
    .welcome-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stat-value { font-size: 1.2rem; }
}