/* ================================================================
   DASHBOARD.CSS
   Estilos de gráficos, cards, filtros e modal de zoom
   Cards de resumo usam .resumo-cards de layoutGeral.css
   ================================================================ */


/* ================================================================
   1. GRID & CARDS
   ================================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.dashboard-card,
.dashboard-card-full {
    border-top: 4px solid transparent;
    animation: fadeInUp 0.3s ease-out;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 15px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 390px;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}


.dashboard-card h3 {
    font-size: 13px;
    margin-bottom: 12px;
    color: #475569;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}


/* ================================================================
   2. CHART CONTAINERS & CANVAS
   ================================================================ */

.chart-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 180px;
}

.chart-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.chart-icon {
    font-size: 14px;
    flex-shrink: 0;
}

#balanco-chart, #tendencia-chart, #receitas-despesas-chart,
#categorias-barras-chart, #categorias-mensais-chart,
#juros-chart, #parcelamentos-chart, #forma-pagamento-chart,
#media-categorias-chart, #cartoes-usados-chart {
    width: 100%;
    height: 100%;
}


/* ================================================================
   3. ACCENT COLORS — borda superior + ícone colorido
   ================================================================ */

.chart-accent-violet  { border-top-color: #7c3aed; }
.chart-accent-emerald { border-top-color: #059669; }
.chart-accent-amber   { border-top-color: #d97706; }
.chart-accent-cyan    { border-top-color: #0891b2; }
.chart-accent-indigo  { border-top-color: #4f46e5; }
.chart-accent-pink    { border-top-color: #db2777; }
.chart-accent-red     { border-top-color: #dc2626; }
.chart-accent-orange  { border-top-color: #ea580c; }
.chart-accent-teal    { border-top-color: #0d9488; }
.chart-accent-blue    { border-top-color: #2563eb; }

.chart-accent-violet  .chart-icon { color: #7c3aed; }
.chart-accent-emerald .chart-icon { color: #059669; }
.chart-accent-amber   .chart-icon { color: #d97706; }
.chart-accent-cyan    .chart-icon { color: #0891b2; }
.chart-accent-indigo  .chart-icon { color: #4f46e5; }
.chart-accent-pink    .chart-icon { color: #db2777; }
.chart-accent-red     .chart-icon { color: #dc2626; }
.chart-accent-orange  .chart-icon { color: #ea580c; }
.chart-accent-teal    .chart-icon { color: #0d9488; }
.chart-accent-blue    .chart-icon { color: #2563eb; }


/* ================================================================
   4. BARRA DE FILTROS GLOBAL
   ================================================================ */

.dashboard-filtros-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.filtro-periodo-toggle {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}

.filtro-toggle-btn {
    padding: 5px 13px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.filtro-toggle-btn:hover {
    color: #1e293b;
}

.filtro-toggle-btn.active {
    background: white;
    color: #1e293b;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.filtro-bar-sep {
    width: 1px;
    height: 22px;
    background: #cbd5e1;
    flex-shrink: 0;
}

.filtro-selects {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.filtro-select {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: white;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    min-width: 145px;
}

.filtro-select:hover,
.filtro-select:focus {
    border-color: #94a3b8;
    color: #1e293b;
}


/* ================================================================
   5. BOTÃO ZOOM NOS HEADERS DE GRÁFICO
   ================================================================ */

.btn-zoom {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #94a3b8;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.btn-zoom:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}


/* ================================================================
   6. MODAL ZOOM DE GRÁFICO
   ================================================================ */

.modal-zoom-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-zoom-content {
    background-color: #ffffff;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    position: relative;
    padding: 40px 20px 20px 20px;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

#fechar-modal-zoom {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

#fechar-modal-zoom:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

#canvas-zoom-render {
    width: 100% !important;
    height: 100% !important;
}


/* ================================================================
   7. RESPONSIVIDADE
   ================================================================ */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-card {
        height: auto;
        min-height: 300px;
    }

    .chart-container {
        min-height: 250px;
    }
}

@media (max-width: 600px) {
    .dashboard-filtros-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filtro-selects {
        width: 100%;
    }

    .filtro-select {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        padding: 0 8px;
        margin: 0 8px 15px 8px;
    }

    .dashboard-card h3 {
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
    }
}
