/* WiTheX PDV SaaS — dashboard de estoque. Isolado do CSS homologado. */
.stock-dashboard { display:grid; gap:18px; }
.stock-dashboard .wd-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.stock-dashboard .wd-kpi,.stock-dashboard .wd-card { background:#151c26; border:1px solid #293342; border-radius:16px; min-width:0; }
.stock-dashboard .wd-kpi { padding:20px; display:grid; gap:8px; }
.stock-dashboard .wd-eyebrow { font-size:13px; color:#aebdd0; font-weight:600; }
.stock-dashboard .wd-kpi strong { font-size:clamp(22px,2.1vw,32px); line-height:1.2; font-variant-numeric:tabular-nums; color:#f6f9ff; }
.stock-dashboard .wd-kpi small { font-size:12px; color:#9caabd; line-height:1.4; }
.stock-dashboard .wd-kpi.wd-unavailable { border-style:dashed; }
.stock-dashboard .wd-kpi.wd-unavailable strong { color:#9caabd; }
.stock-dashboard .wd-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(300px,1fr); gap:16px; }
.stock-dashboard .wd-card { padding:20px; }
.stock-dashboard .wd-card h3 { color:#f7f9fe; font-size:19px; margin:0; }
.stock-dashboard .wd-sub { color:#9caabd; margin:5px 0 0; font-size:12px; }
.stock-dashboard .wd-card-head { display:flex; flex-wrap:wrap; align-items:center; gap:14px; justify-content:space-between; margin-bottom:18px; }
.stock-dashboard .wd-modos { display:flex; flex-wrap:wrap; gap:5px; padding:4px; border:1px solid #2b3545; border-radius:11px; }
.stock-dashboard .wd-modos button { border:0; border-radius:8px; padding:8px 11px; color:#d6dfeb; background:transparent; cursor:pointer; font-size:12px; font-weight:700; }
.stock-dashboard .wd-modos button.active { background:#dc328b; color:white; }
.stock-dashboard .wd-modos button:disabled { opacity:.45; cursor:not-allowed; }
.stock-dashboard .wd-chart { display:grid; grid-template-columns:minmax(148px,210px) minmax(0,1fr); gap:20px; align-items:center; }
.stock-dashboard .wd-donut { width:min(100%,205px); aspect-ratio:1; margin:0 auto; border-radius:50%; display:grid; place-items:center; background:#334155; }
.stock-dashboard .wd-donut-core { width:72%; aspect-ratio:1; border-radius:50%; background:#151c26; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; padding:8px; }
.stock-dashboard .wd-donut-core strong { color:#f6f9ff; font-size:clamp(15px,1.4vw,24px); text-align:center; overflow-wrap:anywhere; line-height:1.15; }
.stock-dashboard .wd-donut-core small { color:#aebdd0; font-size:11px; text-align:center; }
.stock-dashboard .wd-categories { display:grid; gap:1px; max-height:290px; overflow:auto; }
.stock-dashboard .wd-cat-row { display:grid; grid-template-columns:10px minmax(0,1fr) auto auto; gap:9px; align-items:center; padding:8px 2px; border-bottom:1px solid #253040; color:#e6edf7; font-size:12px; }
.stock-dashboard .wd-cat-dot { width:9px; height:9px; border-radius:3px; }
.stock-dashboard .wd-cat-nome { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stock-dashboard .wd-cat-row strong { white-space:nowrap; }
.stock-dashboard .wd-cat-percent { color:#a9b8cb; min-width:46px; text-align:right; }
.stock-dashboard .wd-health { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.stock-dashboard .wd-health-box { border:1px solid #2a3546; border-radius:12px; padding:14px 9px; display:flex; align-items:center; flex-direction:column; gap:6px; }
.stock-dashboard .wd-health-box strong { font-size:29px; font-variant-numeric:tabular-nums; }
.stock-dashboard .wd-health-box small { font-size:12px; color:#aebdd0; }
.stock-dashboard .wd-health-box.wd-critico strong { color:#ffbd62; }
.stock-dashboard .wd-health-box.wd-zerado strong { color:#fb7185; }
.stock-dashboard .wd-health-box.wd-normal strong { color:#66d6a5; }
.stock-dashboard .wd-health-footer { color:#94a3b8; font-size:12px; margin:14px 0 0; }
.stock-dashboard .wd-bars { display:grid; gap:14px; }
.stock-dashboard .wd-bar-heading { display:flex; justify-content:space-between; gap:10px; font-size:12px; color:#e5eaf2; margin-bottom:6px; }
.stock-dashboard .wd-bar-heading span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; min-width:0; }
.stock-dashboard .wd-bar-heading strong { white-space:nowrap; }
.stock-dashboard .wd-bar-track { height:10px; border-radius:30px; background:#253041; overflow:hidden; }
.stock-dashboard .wd-bar-fill { height:100%; border-radius:30px; }
.stock-dashboard .wd-footnote { padding:11px 14px; color:#acb8c8; font-size:12px; line-height:1.5; border:1px solid #2a3546; border-radius:11px; }
.stock-dashboard .wd-empty, .stock-dashboard .wd-no-data { color:#aebdd0; padding:24px; text-align:center; }
.stock-dashboard .wd-loading { opacity:.5; pointer-events:none; }
@media(max-width:1120px){.stock-dashboard .wd-kpis {grid-template-columns:repeat(2,minmax(0,1fr));}.stock-dashboard .wd-grid{grid-template-columns:1fr;}}
@media(max-width:650px){.stock-dashboard .wd-chart{grid-template-columns:1fr;}.stock-dashboard .wd-kpis{grid-template-columns:1fr 1fr;}.stock-dashboard .wd-card{padding:14px;}.stock-dashboard .wd-cat-row{grid-template-columns:9px minmax(0,1fr) auto;}.stock-dashboard .wd-cat-percent{display:none;}}

.stock-dashboard.hidden, .stock-dashboard .hidden { display:none !important; }

/* v2 — Fatias interativas: destaque por mouse, teclado e legenda. */
.stock-dashboard .wd-donut { position:relative; background:transparent; isolation:isolate; }
.stock-dashboard .wd-donut-svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.stock-dashboard .wd-donut-core { position:relative; z-index:1; width:64%; pointer-events:none; text-align:center; }
.stock-dashboard .wd-donut-core small { max-width:100%; overflow-wrap:anywhere; font-size:10px; line-height:1.25; }
.stock-dashboard .wd-donut-slice { cursor:pointer; opacity:1; transform-origin:110px 110px; transition:opacity .16s ease, filter .16s ease, transform .16s ease; outline:none; }
.stock-dashboard .wd-hovering .wd-donut-slice:not(.wd-active) { opacity:.32; }
.stock-dashboard .wd-donut-slice.wd-active { filter:brightness(1.22) drop-shadow(0 0 4px rgba(255,255,255,.45)); transform:scale(1.035); }
.stock-dashboard .wd-donut-slice:focus-visible { stroke:#fff; stroke-width:2px; }
.stock-dashboard .wd-cat-row { width:100%; border-top:0; border-right:0; border-left:0; text-align:left; background:transparent; font:inherit; cursor:pointer; border-radius:5px; transition:background .16s ease; }
.stock-dashboard .wd-cat-row:hover, .stock-dashboard .wd-cat-row.wd-active, .stock-dashboard .wd-cat-row:focus-visible { background:#263347; }
.stock-dashboard .wd-cat-row.wd-active .wd-cat-nome, .stock-dashboard .wd-bar-row.wd-active .wd-bar-heading span { color:#fff; font-weight:700; }
.stock-dashboard .wd-cat-row:focus-visible, .stock-dashboard .wd-bar-row:focus-visible { outline:2px solid #f472b6; outline-offset:2px; }
.stock-dashboard .wd-bar-row { border-radius:6px; padding:4px 5px; margin:-4px -5px; cursor:pointer; transition:background .16s ease; }
.stock-dashboard .wd-bar-row:hover, .stock-dashboard .wd-bar-row.wd-active { background:#263347; }
.stock-dashboard .wd-bar-fill { transition:filter .16s ease, box-shadow .16s ease; }
.stock-dashboard .wd-bar-row.wd-active .wd-bar-fill { filter:brightness(1.23); box-shadow:0 0 9px rgba(255,255,255,.22); }
.wd-tooltip { position:fixed; z-index:2147483000; pointer-events:none; min-width:140px; max-width:min(280px,calc(100vw - 24px)); padding:10px 12px; color:#f8fafc; background:#111827; border:1px solid #53637b; border-radius:10px; box-shadow:0 8px 28px rgba(0,0,0,.55); display:grid; gap:4px; font-size:12px; line-height:1.4; }
.wd-tooltip strong { font-size:13px; overflow-wrap:anywhere; }
.wd-tooltip span { color:#d9e2f0; font-variant-numeric:tabular-nums; }
.wd-tooltip[hidden] { display:none !important; }
@media (prefers-reduced-motion: reduce) { .stock-dashboard .wd-donut-slice, .stock-dashboard .wd-cat-row, .stock-dashboard .wd-bar-row { transition:none; } }

/* v3 — Segundo gráfico, por subcategoria, com controles e interação independentes. */
.stock-dashboard .wd-subcategory-card { min-width:0; }
.stock-dashboard .wd-sub-controls { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.stock-dashboard .wd-filter-label { color:#aebdd0; font-size:12px; font-weight:600; }
.stock-dashboard .wd-sub-select { background:#101721; color:#e6edf7; border:1px solid #334155; border-radius:9px; padding:9px 10px; max-width:260px; font:inherit; font-size:12px; }
.stock-dashboard .wd-sub-select:focus-visible { outline:2px solid #f472b6; outline-offset:2px; }
.stock-dashboard .wd-sub-bars-head { margin:23px 0 13px; border-top:1px solid #273244; padding-top:17px; color:#f4f7fc; font-size:14px; font-weight:700; }
.stock-dashboard .wd-sub-note { margin-top:14px; }
.stock-dashboard .wd-subcategory-card .wd-chart { grid-template-columns:minmax(148px,240px) minmax(0,1fr); }
.stock-dashboard .wd-subcategory-card .wd-donut { width:min(100%,225px); }
.stock-dashboard .wd-subcategory-card .wd-categories { max-height:350px; }
.stock-dashboard .wd-subcategory-card .wd-donut-core { width:64%; }
@media (max-width:700px) {
 .stock-dashboard .wd-sub-controls { width:100%; }
 .stock-dashboard .wd-sub-select { max-width:100%; flex:1; }
 .stock-dashboard .wd-subcategory-card .wd-chart { grid-template-columns:1fr; }
}
