/* =====================================================================
   Protótipo do Estoque · Painel (alerta de prazo e movimento)
   ===================================================================== */

.e-painel { display: grid; gap: 1rem; }

/* Botão de alerta: o número grande à direita é o mesmo do texto */
.e-alerta {
    display: flex; align-items: center; gap: .9rem;
    width: 100%;
    padding: .85rem 1rem;
    border: 1px solid #efb5b5; border-left: 5px solid var(--p-vermelho);
    border-radius: var(--p-raio);
    background: var(--p-vermelho-claro);
    color: var(--p-vermelho-escuro);
    font-family: inherit; text-align: left; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.e-alerta:hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(181, 8, 8, .14); }
.e-alerta[disabled] { cursor: default; }
.e-alerta-icone {
    display: grid; place-items: center;
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
    background: var(--p-vermelho); color: #fff;
}
.e-alerta-icone .p-icone { width: 19px; height: 19px; }
.e-alerta.critico .e-alerta-icone { animation: e-pulso 2s ease-out infinite; }
@keyframes e-pulso {
    0% { box-shadow: 0 0 0 0 rgba(181, 8, 8, .45); }
    70%, 100% { box-shadow: 0 0 0 12px rgba(181, 8, 8, 0); }
}
.e-alerta-texto { flex: 1; min-width: 0; display: grid; }
.e-alerta-texto strong { font-size: .9rem; color: inherit; }
.e-alerta-texto span { font-size: .76rem; color: var(--p-texto); }
.e-alerta-numero { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--p-vermelho); font-variant-numeric: tabular-nums; }
.e-alerta.atencao { background: var(--p-ambar-claro); border-color: #f2d59a; border-left-color: var(--p-ambar); color: #7a4a00; }
.e-alerta.atencao .e-alerta-icone { background: var(--p-ambar); }
.e-alerta.atencao .e-alerta-numero { color: var(--p-ambar); }
.e-alerta.tranquilo { background: var(--p-verde-claro); border-color: #a8ecc3; border-left-color: var(--p-verde-escuro); color: var(--p-verde-escuro); }
.e-alerta.tranquilo .e-alerta-icone { background: var(--p-verde-escuro); }
.e-alerta.tranquilo .e-alerta-numero { color: var(--p-verde-escuro); }
.proto .e-modal-intro { font-size: .78rem; color: var(--p-cinza); margin-bottom: .6rem; }
.e-acoes-linha { white-space: nowrap; text-align: right; }
.e-acoes-linha .p-btn + .p-btn { margin-left: .25rem; }

/* Gráfico */
.e-periodos { display: inline-flex; border: 1px solid var(--p-borda-forte); border-radius: 6px; overflow: hidden; }
.e-periodos button {
    border: 0; background: #fff; color: var(--p-cinza);
    padding: .3rem .65rem; font-family: inherit; font-size: .72rem; font-weight: 600; cursor: pointer;
}
.e-periodos button + button { border-left: 1px solid var(--p-borda-forte); }
.e-periodos button[aria-pressed="true"] { background: var(--p-preto); color: #fff; }

.e-totais { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-bottom: .6rem; font-size: .78rem; color: var(--p-cinza); }
.e-total {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .5rem; border: 1px solid transparent; border-radius: 6px; background: none;
    font-family: inherit; font-size: .78rem; color: var(--p-cinza); cursor: pointer;
}
.e-total:hover { border-color: var(--p-borda-forte); }
.e-total strong { color: var(--p-preto); font-size: 1rem; font-variant-numeric: tabular-nums; }
.e-total::before { content: ""; width: 12px; height: 3px; border-radius: 2px; background: var(--p-vermelho); }
.e-total.saidas::before { background: var(--p-preto); }
.e-total[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.e-caixa-valores { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; font-size: .74rem; cursor: pointer; }
.e-caixa-valores input { accent-color: var(--p-vermelho); margin: 0; }

.e-grafico { position: relative; min-height: 240px; touch-action: pan-y; }
.e-grafico svg { display: block; overflow: visible; }
.e-grade { stroke: var(--p-borda); stroke-width: 1; }
.e-eixo { fill: var(--p-cinza); font-size: 10.5px; font-family: inherit; }
.e-eixo.forte { fill: var(--p-preto); font-weight: 700; }
.e-area { fill: url(#eAreaGrad); opacity: 0; transition: opacity .8s ease .5s; }
.e-linha { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.e-linha.entradas { stroke: var(--p-vermelho); }
.e-linha.saidas { stroke: var(--p-preto); stroke-width: 2; }
.desenhado .e-linha { stroke-dashoffset: 0; transition: stroke-dashoffset 1.3s cubic-bezier(.65, 0, .35, 1); }
.desenhado .e-linha.saidas { transition-delay: .15s; }
.desenhado .e-area { opacity: 1; }
.e-ponto { stroke: #fff; stroke-width: 1.5; opacity: 0; transition: opacity .3s 1.1s; }
.e-ponto.entradas { fill: var(--p-vermelho); }
.e-ponto.saidas { fill: var(--p-preto); }
.e-valor { font-size: 10.5px; font-weight: 700; font-family: inherit; opacity: 0; transition: opacity .3s 1.2s; }
.e-valor.miudo { font-size: 7.5px; }
.e-valor.entradas { fill: var(--p-vermelho); }
.e-valor.saidas { fill: var(--p-preto); }
.desenhado .e-ponto, .desenhado .e-valor { opacity: 1; }
.e-mira { stroke: var(--p-cinza-claro); stroke-dasharray: 3 3; }
.e-captura { fill: transparent; cursor: crosshair; }
.e-dica {
    position: absolute; top: 0;
    transform: translate(-50%, -6px);
    display: grid; gap: .05rem;
    padding: .4rem .6rem;
    background: var(--p-preto); color: #fff;
    border-radius: 6px; font-size: .72rem; white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--p-sombra-g);
}
.e-dica strong { font-size: .72rem; text-transform: capitalize; }
.e-dica b { font-variant-numeric: tabular-nums; }
.e-dica .entradas b { color: #ff8a8a; }
.proto .e-resumo { margin-top: .5rem; font-size: .76rem; color: var(--p-cinza); }
.e-resumo strong { color: var(--p-preto); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .e-alerta.critico .e-alerta-icone { animation: none; }
}
