/* ============================================
   FAMDEVENDAS — GRÁFICOS (Components/Graficos/FvLinhaChart.razor)
   Mesmo visual do gráfico do Dashboard (dashboard-consultas.css): área suave,
   linhas desenhadas na entrada, guia tracejada, pontos e balão no hover.
   Cores só via tokens --fv-* (trocam sozinhas no modo escuro).
   ============================================ */
.fv-chart {
    --fv-chart-azul: var(--fv-primary);
    --fv-chart-azul-rgb: var(--fv-primary-rgb);
    --fv-chart-verde: var(--fv-success);
    --fv-chart-verde-rgb: var(--fv-success-rgb);
    --fv-chart-laranja: var(--fv-warning);
    --fv-chart-laranja-rgb: var(--fv-warning-rgb);
    --fv-chart-vermelho: var(--fv-error);
    --fv-chart-vermelho-rgb: var(--fv-error-rgb);
    --fv-chart-teal: var(--fv-secondary);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fv-chart-legenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    min-height: 1.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    color: var(--fv-text-muted);
}

.fv-chart-legenda .leg::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 3px;
    margin-right: 0.35rem;
    border-radius: 99px;
    vertical-align: middle;
}

.fv-chart-legenda .leg-azul::before { background: var(--fv-chart-azul); }
.fv-chart-legenda .leg-verde::before { background: var(--fv-chart-verde); }
.fv-chart-legenda .leg-laranja::before { background: var(--fv-chart-laranja); }
.fv-chart-legenda .leg-vermelho::before { background: var(--fv-chart-vermelho); }
.fv-chart-legenda .leg-teal::before { background: var(--fv-chart-teal); }

.fv-chart-dica {
    margin-left: auto;
    font-size: 0.74rem;
}

/* A altura segue a proporção do viewBox: o SVG preenche a caixa e os overlays em % ficam alinhados */
.fv-chart-area {
    position: relative;
    padding: 0 0 1.4rem;
}

.fv-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1000 / 260;
}

.fv-chart-svg .grid {
    stroke: var(--fv-border);
    stroke-width: 1;
}

.fv-chart-svg .area {
    stroke: none;
}

.fv-chart-svg .area-azul { fill: rgba(var(--fv-chart-azul-rgb), 0.10); }
.fv-chart-svg .area-verde { fill: rgba(var(--fv-chart-verde-rgb), 0.12); }
.fv-chart-svg .area-laranja { fill: rgba(var(--fv-chart-laranja-rgb), 0.12); }
.fv-chart-svg .area-vermelho { fill: rgba(var(--fv-chart-vermelho-rgb), 0.12); }

.fv-chart-svg .linha {
    fill: none;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.fv-chart-svg .linha-azul { stroke: var(--fv-chart-azul); stroke-width: 3; }
.fv-chart-svg .linha-verde { stroke: var(--fv-chart-verde); }
.fv-chart-svg .linha-laranja { stroke: var(--fv-chart-laranja); }
.fv-chart-svg .linha-vermelho { stroke: var(--fv-chart-vermelho); }
.fv-chart-svg .linha-teal { stroke: var(--fv-chart-teal); }

.fv-chart-svg .fv-chart-desenho {
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    animation: fv-chart-desenho 0.9s ease forwards;
}

@keyframes fv-chart-desenho {
    to { stroke-dashoffset: 0; }
}

.fv-chart-svg .guide {
    stroke: var(--fv-text-muted);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.fv-chart-svg .dot-azul { fill: var(--fv-chart-azul); }
.fv-chart-svg .dot-verde { fill: var(--fv-chart-verde); }
.fv-chart-svg .dot-laranja { fill: var(--fv-chart-laranja); }
.fv-chart-svg .dot-vermelho { fill: var(--fv-chart-vermelho); }
.fv-chart-svg .dot-teal { fill: var(--fv-chart-teal); }

.fv-chart-svg .grid,
.fv-chart-svg .area,
.fv-chart-svg .linha,
.fv-chart-svg .guide,
.fv-chart-svg .dot {
    pointer-events: none;
}

.fv-chart-y,
.fv-chart-hits {
    position: absolute;
    inset: 0 0 1.4rem 0;
}

.fv-chart-y {
    pointer-events: none;
}

.fv-chart-y span {
    position: absolute;
    left: 0;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: var(--fv-text-muted);
}

.fv-chart-hits .hit {
    position: absolute;
    top: 0;
    bottom: 0;
    cursor: crosshair;
}

.fv-chart-x {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.3rem;
    pointer-events: none;
}

.fv-chart-x span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.72rem;
    color: var(--fv-text-muted);
}

.fv-chart-tooltip {
    position: absolute;
    top: 8px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 132px;
    padding: 0.5rem 0.7rem;
    transform: translateX(-50%);
    border: 1px solid var(--fv-border);
    border-radius: 12px;
    background: var(--fv-surface);
    box-shadow: 0 8px 24px rgba(var(--fv-primary-rgb), 0.12);
    font-size: 0.75rem;
    color: var(--fv-text);
    pointer-events: none;
}

.fv-chart-tooltip strong {
    margin-bottom: 0.15rem;
}

.fv-chart-tooltip .tip-azul { color: var(--fv-chart-azul); }
.fv-chart-tooltip .tip-verde { color: var(--fv-chart-verde); }
.fv-chart-tooltip .tip-laranja { color: var(--fv-chart-laranja); }
.fv-chart-tooltip .tip-vermelho { color: var(--fv-chart-vermelho); }
.fv-chart-tooltip .tip-teal { color: var(--fv-chart-teal); }

@media (max-width: 700px) {
    .fv-chart-dica {
        display: none;
    }
}
