@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #6200ea; /* Roxo principal */
    --primary-gradient: linear-gradient(135deg, #6200ea 0%, #3700b3 100%);
    --secondary-bg: #f3f4f6; /* Fundo cinza claro */
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --sidebar-width: 260px;
    --card-radius: 20px;
    --shadow: 0 10px 30px -10px rgba(62, 0, 234, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary-bg);
    color: var(--text-dark);
}

/* --- Layout Principal --- */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar (Menu Lateral) --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    padding: 2rem;
    position: fixed;
    height: 100%;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* Logo Estilizada */
.brand {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span {
    color: var(--primary-color);
}

.sidebar h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.sidebar a {
    text-decoration: none;
    color: var(--text-dark);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar a:hover, .sidebar a.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(98, 0, 234, 0.3);
}

/* --- Conteúdo Principal --- */
.content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: 100%;
    max-width: 1600px;
}

/* --- Cards --- */
.card {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.5);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* Card de Boas-vindas (Destaque) */
.welcome-card {
    background: var(--primary-gradient);
    color: var(--white);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.welcome-card p {
    color: rgba(255,255,255,0.8);
}

/* Grid de Estatísticas */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.card p[id^="total"] {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Gráficos e Ranking */
.graph-box {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    grid-column: span 2; /* Ocupa 2 colunas se possível */
}

@media (max-width: 1024px) {
    .graph-box { grid-column: span 1; }
}

/* --- Responsividade Mobile (Estilo App) --- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px;
        border-top: 1px solid #eee;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    }

    .sidebar h3, .brand { display: none; } /* Esconde logo e títulos no mobile */
    
    .sidebar a {
        flex-direction: column;
        font-size: 0.7rem;
        padding: 8px;
        gap: 5px;
        margin: 0;
        background: transparent !important; /* Remove fundo roxo no mobile para ficar clean */
        color: var(--text-light);
    }
    
    .sidebar a.active, .sidebar a:hover {
        color: var(--primary-color);
        box-shadow: none;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: 100px; /* Espaço para o menu inferior */
    }

    .dashboard-grid {
        grid-template-columns: 1fr; /* Um card por linha no celular */
    }
}
/* ================= MENU MOBILE (BOTTOM BAR) ================= */
.bottom-nav {
    display: none; /* Escondido no Desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    justify-content: space-around;
    padding: 10px 0;
    z-index: 9999;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 11px;
    flex: 1; /* Distribui espaço igual */
}

.bottom-nav-item span {
    font-size: 20px;
    margin-bottom: 2px;
}

.bottom-nav-item.active {
    color: #007bff;
    font-weight: bold;
}

/* ================= AJUSTES RESPONSIVOS ================= */
  @media (max-width: 768px) {
        
        /* SIDEBAR COMO GAVETA (DRAWER) */
        .sidebar {
            position: fixed !important;
            top: -29px; left: 0;
            width: 260px; height: 100vh;
            background: white;
            z-index: 9999; /* Acima de tudo */
            box-shadow: 5px 0 20px rgba(0,0,0,0.2);
            padding: 20px;
            overflow-y: auto;
            display: none; /* Escondido por padrão, o JS vai dar display: block */
        }
    
    /* Classe para mostrar a sidebar quando clicar em "Menu" */
    .sidebar.show-menu {
        display: block;
        animation: slideIn 0.3s forwards;
    }

    /* Ajusta o conteúdo para ocupar a tela toda */
    .content {
        margin-left: 0 !important;
        padding-bottom: 80px; /* Espaço para não ficar atrás do menu */
        width: 100%;
    }

    /* Mostra o menu inferior */
    .bottom-nav {
        display: flex;
    }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
/* PLANO CARDS – estilo moderno */

.plans-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 420px;
}

.plan-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 2px solid #e7e7e7;
    transition: 0.25s;
}

.plan-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Título do plano */
.plan-card h3 {
    margin-bottom: 6px;
    font-size: 20px;
    font-weight: 600;
}

/* Preço */
.plan-card p strong {
    font-size: 18px;
    color: #2D77D0;
}

/* Lista */
.plan-card ul {
    margin-top: 10px;
    margin-bottom: 20px;
    padding-left: 20px;
    list-style: none;
}

.plan-card ul li::before {
    content: "• ";
    color: #2D77D0;
    margin-right: 4px;
}

.plan-card ul li {
    margin-bottom: 4px;
    font-size: 15px;
}

/* BOTÕES */
.plan-card button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: 0.25s;
}

/* Botão ativo/free */
.btn-disabled {
    background: #ccc !important;
    color: #464646 !important;
    cursor: not-allowed !important;
}

/* Botão assinar */
.btn-float {
    background: #2D77D0;
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
}

.btn-float:hover {
    background: #1f5ca6;
}

/* PLANO PREMIUM ATIVO */
.plan-card.premium.active {
    border-color: #28a745 !important;
    background: #f5fff7 !important;
}

.plan-card.premium.active h3 {
    color: #28a745;
}

.plan-card.premium.active p strong {
    color: #28a745;
}

/* MOBILE */
@media (max-width: 480px) {
    .plans-container {
        width: 100%;
    }
    
    .plan-card {
        padding: 20px;
    }
}
    /* =========================================
       1. ESTILOS GERAIS (DESKTOP E MOBILE)
    ========================================= */
    body { background-color: #f4f7f6; } /* Fundo mais suave */

    /* Área Principal */
    .dashboard {
        display: flex;
        min-height: 100vh;
    }

    .content {
        flex: 1;
        padding: 25px;
        padding-bottom: 100px; /* Espaço extra para o rodapé não sumir */
        transition: 0.3s;
    }

    /* Banner de Boas Vindas */
    .welcome-banner {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white; padding: 30px; border-radius: 20px; margin-bottom: 30px;
        box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    }
    .welcome-banner h2 { margin: 0; font-size: 26px; font-weight: 700; }
    .welcome-banner p { margin: 5px 0 0; opacity: 0.9; font-size: 16px; }

    /* Botões de Ação Rápida */
    .action-grid {
        display: grid; 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 20px; margin-bottom: 30px;
    }
    .action-btn {
        background: white; border: none; padding: 20px; border-radius: 16px;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 10px; cursor: pointer; text-decoration: none; color: #555;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03); transition: 0.2s;
    }
    .action-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
    
    .icon-box {
        width: 50px; height: 50px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center; font-size: 24px;
        margin-bottom: 5px;
    }
    .btn-task .icon-box { background: #e3f2fd; color: #2196f3; }
    .btn-dev .icon-box { background: #e8f5e9; color: #4caf50; }
    .btn-child .icon-box { background: #fff3e0; color: #ff9800; }
    .btn-alert .icon-box { background: #ffebee; color: #f44336; }
    .btn-title { font-weight: 600; font-size: 14px; }

    /* Cards e Gráficos */
    .section-title { font-size: 18px; color: #444; margin: 30px 0 15px 0; border-left: 5px solid #667eea; padding-left: 15px; font-weight: 700; }
    
    .dashboard-grid {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    .card {
        background: white; padding: 20px; border-radius: 16px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    }
    .card h3 { margin: 0; font-size: 12px; color: #999; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
    .card p { font-size: 28px; font-weight: 800; color: #333; margin: 5px 0 0 0; }

    .graph-box {
        background: white; border-radius: 16px; padding: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03); grid-column: span 2; margin-bottom: 20px;
    }
    .minimized .graph-content { display: none; }
    .graph-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }

       /* =========================================
       2. AJUSTES MOBILE (MENU GAVETA)
    ========================================= */
    @media (max-width: 768px) {
        
        /* SIDEBAR COMO GAVETA (DRAWER) */
        .sidebar {
            position: fixed !important;
            /* top: 0px; */
            /* left: 0; */
            width: 260px;
            /* height: 80vh; */
            background: white;
            z-index: 9999; /* Acima de tudo */
            box-shadow: 5px 0 20px rgba(0,0,0,0.2);
            padding: -5px;
            overflow-y: auto;
            display: none; /* Escondido por padrão, o JS vai dar display: block */
        }
        /* Overlay Escuro atrás do menu (quando aberto) */
        .sidebar::before {
            content: ''; position: fixed; top: -29px; left: 260px; width: 100vw; height: 100vh;
            background: rgba(0,0,0,0.5); pointer-events: none; opacity: 0; transition: 0.3s;
        }

        /* Títulos do Menu no Mobile */
        .sidebar h3 {
            font-size: 0.8rem; text-transform: uppercase; color: #999;
            margin-bottom: 1rem; letter-spacing: 1px;
        }
        
        /* Links do Menu no Mobile */
        .sidebar a {
            display: flex; flex-direction: row; /* Ícone ao lado do texto */
            align-items: center;
            font-size: 14px; padding: 12px; gap: 10px;
            margin-bottom: 6px;
            background: transparent !important;
            color: #555;
            border-radius: 12px;
            transition: all 0.2s ease;
            text-decoration: none; font-weight: 500;
        }
        
        /* Efeito Hover/Active no Mobile */
        .sidebar a:hover, .sidebar a.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            color: white !important;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }

        /* CONTEÚDO PRINCIPAL NO MOBILE */
        .content { 
            padding: 15px; 
            padding-bottom: 100px; /* Espaço para o menu inferior e footer */
            width: 100%;
        }

        /* Banner Compacto */
        .welcome-banner { padding: 20px; border-radius: 15px; margin-bottom: 20px; }
        .welcome-banner h2 { font-size: 22px; }
        .welcome-banner p { font-size: 14px; }

        /* Grids Responsivos (2 colunas) */
        .action-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
        .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
        .graph-box { grid-column: span 2; }

        /* Fontes Menores */
        .card { padding: 15px; }
        .card p { font-size: 24px; }
        .card h3 { font-size: 11px; }

        /* Rodapé de Texto */
        footer { 
            padding-bottom: 80px !important;
            font-size: 12px; 
            text-align: center;
        }
    }