
/* --- Bento Grid Dashboard --- */
.dashboard-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    padding-right: 10px;
    padding-bottom: 20px;   
   
}

/* Permite o scroll correto dentro do .main-wrapper (overflow: hidden no menu.css) */
.dashboard .main-wrapper {
    min-height: 0;
}

/* Scrollbar suave para o conteúdo principal */
.dashboard-content::-webkit-scrollbar { width: 6px; }
.dashboard-content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    grid-auto-rows: minmax(min-content, max-content);
}

.bento-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    position: relative;
    /* visible: evita cortar mini-charts e grade de 12 meses nos cards estreitos */
    overflow: visible;
}

/* Definição das áreas na grelha */
.card-sales { grid-column: span 4; }
.card-expenses { grid-column: span 4; }
.card-lucro { grid-column: span 6;  }
.card-customer { grid-column: span 4; grid-row: span 2; }
.card-period { grid-column: span 8; }
.card-analytics { grid-column: span 12; height: 270px; }
.card-ai { 
    grid-column: span 4; 
    height: 250px;
    background: linear-gradient(160deg, #111827 0%, #1a2a40 50%, #4c1d95 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Elementos dos Cartões */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-size: var(--text-2);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: var(--text);
    color: var(--text-muted);
}

.card-value-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 6px;
}

.card-margem-pct-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

.pill-trend {
    font-size: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--text-main); }
.trend-down { color: var(--text-muted); }

.pill-value {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: var(--text);
    font-weight: 600;
}

.pill-green { background: var(--verde-claro); color: #059669; }
.pill-red { background: var(--soft-pink-light); color: #e11d48; }




.dash-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* SVG Mini Charts para Sales/Expenses */
.mini-chart {
    width: 100%;
    height: 40px;
    margin-top: auto;
}

.mini-chart-soft {
    height: 60px;
}

/* Meses exibidos abaixo do mini-chart (usinas últimos 12 meses) */
.mini-chart-months {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2px;
    margin-top: 6px;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.mini-chart-month-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    flex: 1 1 0;
}

.mini-chart-month {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.mini-chart-month-val {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

/* Card: Period of Time */
.period-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.calendar-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-main);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.period-text p { font-size: 11px; color: var(--text-muted); margin-bottom: 2px;}
.period-text h4 { font-size: 14px; font-weight: 600; }

.progress-bars-container {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.bar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-group p { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.bar-group h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }

.progress-bar-thick {
    height: 32px;
    border-radius: 16px;
    width: 100%;
}

.bg-gradient-dark { background: linear-gradient(90deg, #d1d5db, #374151, #111827); flex: 3; }
.bg-gradient-green { background: linear-gradient(90deg, var(--verde-claro), var(--verde)); flex: 1.5; }
.bg-gradient-pink { background: linear-gradient(90deg, var(--rosa-claro), var(--rosa)); flex: 1; }

/* Card: Customer Satisfaction */
.satisfaction-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--text-muted);
}
.legend-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot-green { background: var(--verde); }
.dot-pink { background: var(--rosa); }

.horizontal-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 6px;
}

.h-bar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.h-bar-label {
    width: 30px;
    font-size: 12px;
    color: var(--text-muted);
}

.h-bar-track {
    flex: 1;
    height: 16px;
    background: var(--bg-main);
    border-radius: 8px;
    display: flex;
    overflow: hidden;
    position: relative;
}

.h-bar-fill-green { background: var(--verde); height: 100%; border-radius: 8px 0 0 8px;}
.h-bar-fill-pink { background: var(--rosa); height: 100%; border-radius: 0 8px 8px 0;}

/* Tooltip flutuante no gráfico */
.chart-tooltip {
    position: absolute;
    background: var(--preto);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}
.chart-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: var(--preto) transparent transparent transparent;
}

.axis-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    padding-left: 46px; /* alinha com as barras */
}

/* Card: Sales Analytics (Vertical Bars) */
.vertical-chart-area {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-bottom: 24px; /* espaço para as labels em baixo */
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-bottom: 24px;
    font-size: 11px;
    color: var(--text-muted);
    width: 30px;
}

.y-axis span:first-child { color: var(--rosa); font-weight: 600; }

.v-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex: 1;
    height: 100%;
    position: relative;
}

.v-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.v-bar {
    width: 60%;
    background: var(--vermelho);
    border-radius: 6px 6px 0 0;
    min-height: 10px;
    transition: all 0.3s;
}

.v-bar-wrapper.active .v-bar {
    background: repeating-linear-gradient(
        45deg,
        var(--vermelho),
        var(--vermelho) 10px,
        var(--vermelho) 10px,
        var(--vermelho) 20px
    );
}

.v-bar-label {
    position: absolute;
    bottom: -24px;
    font-size: 11px;
    color: var(--text-muted);
}
.v-bar-value {
    position: absolute;
    bottom: 6px;
    font-size: 10px;
    color: var(--text-main);
    font-weight: 600;
    line-height: 1;
}
.v-bar-sub {
    position: absolute;
    bottom: -38px;
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
}
.v-bar-wrapper.active .v-bar-label {
    color: var(--text-main);
    font-weight: 700;
}

/* --- Novos Estilos para os Gráficos de Receita e Visão Geral --- */
.card-revenue {
    grid-column: span 12;
    min-height: 250px;
    height: auto;
    overflow: visible;
}
.card-sales-overview { grid-column: span 4; height: 200px; }

.rev-bar-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    flex: 1;
    z-index: 1;
    position: relative;
}
.rev-bar {
    width: 100%;
    max-width: 32px;
    border-radius: 8px;
    background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 4px, #e5e7eb 4px, #e5e7eb 8px);
    position: relative;
}

.rev-bar-stack {
    width: 100%;
    max-width: 32px;
    height: 150px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 10px;
}

.rev-bar-stack .rev-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
}

.rev-bar-base {
    z-index: 1;
}

.rev-bar-overlay {
    z-index: 2;
}
body.dark-mode .rev-bar {
    background: repeating-linear-gradient(45deg, #374151, #374151 4px, #4b5563 4px, #4b5563 8px);
}
.rev-label {
    position: absolute;
    bottom: 0;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}
.rev-bar.active {
    background: linear-gradient(to bottom, #3b82f6, rgba(147, 197, 253, 0.2));
    z-index: 10;
}
.rev-label-overlay {
    position: absolute;
    bottom: -20px !important;
    left: 40px;
    right: 40px;
    top: -5px;
    font-size: 10px;
    color: var(--text-main);
    font-weight: 600;
    text-align: center;
}
 