/* Dashboards do Grafana desenhados pelo CleanONE (tema do CleanONE: claro/escuro) */
:root { --gd-track: hsl(var(--muted)); --gd-grid: hsl(var(--border)); --gd-axis: hsl(var(--muted-fg)); }
.gd-bar-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.gd-vars { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gd-var { position: relative; display: flex; align-items: stretch; }
.gd-var > label { display: flex; align-items: center; padding: 0 10px; font-size: 13px; font-weight: 600; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-right: 0; border-radius: 2px 0 0 2px; white-space: nowrap; }
.gd-sel { height: 30px; font-size: 13px; padding: 0 8px; width: auto; border: 1px solid #8a8886; background: hsl(var(--input-bg)); color: hsl(var(--fg)); border-radius: 2px; cursor: pointer; font-family: inherit; }
.dark .gd-sel { border-color: #605e5c; }
.gd-vbtn { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 0 2px 2px 0; }
.gd-vbtn svg { width: 14px; height: 14px; flex-shrink: 0; }
.gd-vpop { position: absolute; top: 100%; left: 0; z-index: 30; margin-top: 2px; min-width: 240px; max-height: 340px; overflow: auto; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); box-shadow: var(--shadow); padding: 4px; }
.gd-vpop .gd-vq { height: 28px; margin: 2px 2px 4px; width: calc(100% - 4px); font-size: 13px; padding: 0 8px; }
.gd-vo { display: flex; align-items: center; gap: 8px; padding: 5px 8px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.gd-vo:hover { background: hsl(var(--nav-hover)); }
.gd-vo input { width: auto; margin: 0; }
.gd-vo.hidden, .gd-vpop.hidden { display: none; }
.gd-upd { font-size: 12px; }

.gd-dash { display: flex; flex-direction: column; gap: 8px; }
.gd-dash:fullscreen { background: hsl(var(--bg)); padding: 12px; overflow: auto; }
.gd-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 2px; margin-top: 6px; border: 0; border-bottom: 1px solid hsl(var(--border)); background: transparent; color: hsl(var(--fg)); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.gd-row svg { width: 16px; height: 16px; transition: transform .15s; }
.gd-row.closed svg { transform: rotate(-90deg); }
.gd-row small { font-size: 12px; font-weight: 400; color: hsl(var(--muted-fg)); }
.gd-grid { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); grid-auto-rows: 30px; gap: 8px; }
.gd-grid.hidden { display: none; }
.gd-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 2px; box-shadow: var(--shadow); overflow: hidden; }
.gd-panel.transparent { background: transparent; border-color: transparent; box-shadow: none; }
.gd-panel.text { padding: 0; }
.gd-ph { flex-shrink: 0; padding: 6px 10px 2px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.gd-ph svg { width: 13px; height: 13px; color: hsl(var(--muted-fg)); }
.gd-pb { position: relative; flex: 1; min-height: 0; padding: 4px 8px 8px; overflow: hidden; }
.gd-panel.text .gd-pb { padding: 0; }
.gd-loading { position: absolute; left: 8px; right: 8px; top: 8px; height: 3px; background: linear-gradient(90deg, transparent, hsl(var(--primary)), transparent); background-size: 200% 100%; animation: gdload 1.1s linear infinite; }
@keyframes gdload { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.gd-nodata { height: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; color: hsl(var(--muted-fg)); font-size: 13px; text-align: center; }
.gd-nodata.err { color: hsl(var(--danger)); }
.gd-nodata.ok { color: hsl(var(--success)); }
.gd-nodata svg { width: 16px; height: 16px; }

/* stat */
.gd-stat { display: grid; gap: 4px; height: 100%; }
.gd-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; overflow: hidden; border-radius: 2px; padding: 2px 6px; }
.gd-tile.side { flex-direction: row; gap: 10px; }
.gd-tile > * { position: relative; z-index: 1; }
.gd-tile .gd-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; z-index: 0; }
.gd-tname { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; opacity: .92; }
.gd-tval { font-weight: 600; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; letter-spacing: -.01em; }
.gd-stat:not(.bg) .gd-tile { background: transparent; }

/* bar gauge */
.gd-bars { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 100%; }
.gd-bar { display: flex; align-items: center; gap: 8px; min-height: 0; }
.gd-bname { flex-shrink: 0; text-align: right; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-bviz { flex-shrink: 0; display: flex; align-items: center; }
.gd-bviz svg { display: block; }
.gd-barbox { width: 100%; background: var(--gd-track); border-radius: 2px; overflow: hidden; }
.gd-barfill { height: 100%; border-radius: 2px; }
.gd-bval { flex: 1; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* gauge */
.gd-gauges { display: flex; height: 100%; align-items: center; }
.gd-gauges > div { text-align: center; }
.gd-gval { font-weight: 600; margin-top: -1.4em; }

/* séries temporais */
.gd-ts { position: relative; }
.gd-ts svg { display: block; overflow: visible; }
.gd-grid line, line.gd-grid { stroke: var(--gd-grid); stroke-width: 1; }
.gd-axis { fill: var(--gd-axis); font-size: 10.5px; font-family: inherit; }
.gd-axis.lbl { fill: hsl(var(--fg)); font-size: 11.5px; }
.gd-stv { fill: #fff; font-size: 11px; font-weight: 600; }
.gd-cross { position: absolute; width: 1px; background: hsl(var(--fg) / .45); pointer-events: none; }
.gd-tip { position: absolute; z-index: 5; min-width: 160px; max-width: 360px; padding: 6px 8px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }
.gd-tip > b { display: block; margin-bottom: 4px; }
.gd-tip div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.gd-tip div span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.gd-tip i, .gd-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.gd-cross.hidden, .gd-tip.hidden { display: none; }
.gd-legend { font-size: 12px; overflow: auto; }
.gd-legend.list { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 4px; }
.gd-legend.list span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.gd-legend table { width: 100%; border-collapse: collapse; }
.gd-legend th { text-align: right; font-weight: 600; color: hsl(var(--primary)); padding: 2px 8px; position: sticky; top: 0; background: hsl(var(--card)); }
.gd-legend th:first-child, .gd-legend td:first-child { text-align: left; }
.gd-legend td { text-align: right; padding: 1px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-legend td:first-child { display: flex; align-items: center; gap: 6px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.gd-legend tr[data-i] { cursor: pointer; }
.gd-legend tr:hover td { background: hsl(var(--nav-hover)); }
.gd-legend .off { opacity: .4; }

/* tabelas e problemas */
.gd-table { height: 100%; overflow: auto; }
.gd-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.gd-table th { position: sticky; top: 0; z-index: 1; background: hsl(var(--card)); text-align: left; font-weight: 600; color: hsl(var(--primary)); padding: 6px 8px; border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; }
.gd-table td { padding: 5px 8px; border-bottom: 1px solid hsl(var(--border) / .7); vertical-align: middle; }
.gd-table tbody tr:hover td { background: hsl(var(--nav-hover)); }
.gd-sev { display: inline-block; min-width: 92px; padding: 2px 8px; color: #fff; font-weight: 600; border-radius: 2px; }
.gd-pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.gd-problems tr.new td:first-child { box-shadow: inset 3px 0 0 hsl(var(--primary)); }
.gd-text { height: 100%; overflow: auto; }
.gd-text > div { height: 100%; }

/* lista de dashboards */
.gd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gd-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); box-shadow: var(--shadow); color: hsl(var(--fg)); border-radius: 2px; }
.gd-card:hover { border-color: hsl(var(--primary)); text-decoration: none; }
.gd-card b { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.gd-card b svg { color: hsl(var(--primary)); width: 18px; height: 18px; }
.gd-card small { color: hsl(var(--muted-fg)); font-size: 12.5px; }

@media (max-width: 900px) {
  .gd-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .gd-panel { grid-column: 1 / -1 !important; grid-row: auto !important; height: 260px; }
}
.gd-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.gd-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px; border: 1.5px dashed hsl(var(--border)); color: hsl(var(--muted-fg)); font-size: 13.5px; }
.gd-drop.on { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .06); }
.gd-drop svg { width: 18px; height: 18px; }
