/* Eliris — Painel de analíticos (colorido e personalizável) */
#dash-mode { margin-right: 10px; }
.vd-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.vd-custom { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.vd-custom.hidden { display: none; }
.vd-custom-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.vd-toggles { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.vd-tog { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.vd-themes { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.vd-theme { width: 54px; height: 22px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; }
.vd-theme.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel); }
.vd-theme[data-theme="vivo"] { background: linear-gradient(90deg, #22c55e, #f59e0b, #06b6d4, #3b82f6, #8b5cf6); }
.vd-theme[data-theme="oceano"] { background: linear-gradient(90deg, #14b8a6, #38bdf8, #2563eb, #6366f1); }
.vd-theme[data-theme="por-do-sol"] { background: linear-gradient(90deg, #f97316, #f43f5e, #c026d3, #f59e0b); }
.vd-theme[data-theme="corporativo"] { background: linear-gradient(90deg, #004087, #1e488f, #2f6fd1, #8db6ea); }

.vd-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.vw { padding: 12px 14px 14px; min-width: 0; transition: transform .15s, box-shadow .15s; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
@media (max-width: 1300px) { .span-2 { grid-column: span 3; } .span-4 { grid-column: span 6; } }
@media (max-width: 900px) { .vd-grid > .vw { grid-column: span 6; } }
.vw-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: grab; user-select: none; }
.vw-head h3 { margin: 0; font-size: 14px; }
.vw-grip { color: var(--muted); letter-spacing: -2px; font-size: 13px; }
.vw-sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.vw-hide { background: none; border: 0; color: var(--muted); cursor: pointer; opacity: 0; font-size: 13px; padding: 2px 4px; }
.vw:hover .vw-hide { opacity: .8; }
.vw.dragging { opacity: .45; }
.vw.drop { outline: 2px dashed var(--accent, #2f81f7); outline-offset: 3px; }
.vd-empty { display: grid; place-items: center; min-height: 140px; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }

/* indicadores */
.vw[data-w="kpis"] { background: transparent; border: 0; box-shadow: none; padding: 0; }
.vw[data-w="kpis"] .vw-head { display: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { position: relative; overflow: hidden; color: #fff; border-radius: 16px; padding: 14px 16px 12px;
  min-height: 112px; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(5, 11, 31, .25); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); }
.kpi-ico { position: absolute; right: 14px; top: 10px; font-size: 26px; opacity: .9; z-index: 1; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; opacity: .92; }
.kpi-val { font-size: 32px; font-weight: 800; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-val em { font-style: normal; font-size: 16px; font-weight: 700; opacity: .85; }
.kpi-sub { margin-top: auto; font-size: 12px; opacity: .9; }
.kpi.pulse { animation: kpiPulse 2s ease-in-out infinite; }
@keyframes kpiPulse { 50% { box-shadow: 0 0 0 4px rgba(255, 80, 80, .35), 0 8px 24px rgba(5, 11, 31, .25); } }

.legend-row { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.legend-row li { display: inline-flex; align-items: center; gap: 6px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* velocidade */
.spd-hist { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; align-items: end; height: 190px; padding-top: 8px; }
.spd-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.spd-bar { width: 100%; border-radius: 8px 8px 3px 3px; min-height: 2px; transition: height .4s; }
.spd-n { font-size: 12px; font-weight: 800; }
.spd-l { font-size: 11px; color: var(--muted); white-space: nowrap; }
.spd-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.spd-over { color: #ef4444; font-weight: 700; }

/* por câmera */
.hb { display: grid; gap: 10px; }
.hb-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; align-items: center; gap: 10px; cursor: pointer; }
.hb-row:hover .hb-name { color: var(--accent, #2f81f7); }
.hb-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { background: var(--panel-2); border-radius: 999px; height: 16px; overflow: hidden; }
.hb-fill { display: flex; height: 100%; border-radius: 999px; overflow: hidden; min-width: 6px; }
.hb-fill span { display: block; height: 100%; }
.hb-total { font-weight: 800; font-variant-numeric: tabular-nums; }

/* placas */
.vd-plates { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.vd-plates li { display: grid; grid-template-columns: 22px auto 1fr auto auto; align-items: center; gap: 10px; cursor: pointer; }
.vd-rank { font-weight: 800; color: var(--muted); text-align: right; }
.vd-pbar { background: var(--panel-2); height: 8px; border-radius: 999px; overflow: hidden; }
.vd-pbar div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #facc15, #f59e0b); }
.vd-pn { font-weight: 800; font-variant-numeric: tabular-nums; }
.vd-plates small { color: var(--muted); font-size: 11px; }
.lpr-plate.alert { border-color: #dc2626; border-top-color: #dc2626; background: #fff1f1; }

/* alertas */
.vd-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vd-alert { margin: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--panel-2);
  border: 1px solid var(--line); border-top: 4px solid var(--ac); transition: transform .12s; }
.vd-alert:hover { transform: translateY(-2px); }
.vd-alert-img { position: relative; aspect-ratio: 16/10; background: #0b1220; }
.vd-alert-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-clip { position: absolute; right: 6px; top: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.vd-alert figcaption { padding: 6px 8px 8px; display: grid; gap: 1px; font-size: 12px; }
.vd-alert figcaption b { color: var(--ac); }
.vd-alert figcaption small { color: var(--muted); }

/* catálogo */
.vd-colors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vd-color { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: var(--panel-2); border-radius: 999px; padding: 2px 8px; }
.vd-color i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(127, 127, 127, .5); display: inline-block; }

/* saúde */
.vd-health { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.vd-hcard { border: 1px solid var(--line); border-left: 5px solid #8c959f; border-radius: 12px; padding: 10px 12px; background: var(--panel-2); cursor: pointer; display: grid; gap: 6px; }
.vd-hcard.on { border-left-color: #22c55e; } .vd-hcard.warn { border-left-color: #f59e0b; } .vd-hcard.off { border-left-color: #8c959f; }
.vd-hhead { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.vd-hhead .dot { width: 9px; height: 9px; border-radius: 50%; background: #8c959f; }
.vd-hcard.on .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); } .vd-hcard.warn .dot { background: #f59e0b; }
.vd-rec { color: #ef4444; font-size: 11px; font-weight: 800; }
.vd-hstat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.vd-state { font-weight: 700; }
.vd-fps { font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--panel); }
.vd-fps.good { color: #16a34a; } .vd-fps.mid { color: #d97706; } .vd-fps.bad { color: #dc2626; }
.vd-herr { font-size: 12px; color: #d97706; }
.vd-rules { display: flex; flex-wrap: wrap; gap: 5px; }
.vd-rule { font-size: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.vd-rule.off { opacity: .5; text-decoration: line-through; }

/* ajustes de layout */
.vd-toggles label.vd-tog { display: inline-flex; flex-direction: row; align-items: center; width: auto; white-space: nowrap; margin: 0; }
.vd-toggles label.vd-tog input { width: auto; margin: 0; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-label { padding-right: 38px; }
.legend.legend-row { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
.legend.legend-row li { margin: 0; }
.vd-noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; opacity: .55; }
.vd-theme[data-theme="ciano"] { background: linear-gradient(90deg, #a5f3fc, #22d3ee, #06b6d4, #0284c7, #0e7490); }
.vd-theme[data-theme="quantum"] { background: linear-gradient(90deg, #e879f9, #a855f7, #7c3aed, #4f46e5); }
.vd-theme[data-theme="rubi"] { background: linear-gradient(90deg, #111111, #7f1d1d, #dc2626, #f87171, #f5f5f5); }
.vd-theme[data-theme="magenta"] { background: linear-gradient(90deg, #111111, #7d0730, #ed145b, #ff5e93, #f5f5f5); }
