/* WMS Cloud Monitor — complementos ao app.css (mesma base do WMS Cloud Virt) */
:root { --info: #60a5fa; }

.brand { padding-bottom: 14px; }
.brand .mlogo { width: 40px; height: 40px; object-fit: contain; border-radius: 9px; filter: drop-shadow(0 3px 10px rgba(0,0,0,.4)); }
.brand-sub { font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); }
.side { overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 4px; }
.nav a.sub { padding: 6px 12px 6px 18px; font-size: 13px; }
.nav .badge { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.relogio { font-variant-numeric: tabular-nums; margin-bottom: 6px; color: var(--text); }

.value.ok { color: var(--ok); } .value.bad { color: var(--bad); } .value.warn { color: var(--warn); }
.value small { font-size: 15px; color: var(--muted); font-weight: 500; }

/* bolinhas e selos de estado */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 8px rgba(62,207,142,.6); }
.dot-fora { background: var(--bad); box-shadow: 0 0 10px rgba(242,102,122,.8); animation: pulsa 1.4s infinite; }
.dot-alerta { background: var(--warn); }
.dot-aguardando { background: var(--info); }
@keyframes pulsa { 50% { opacity: .35; } }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; vertical-align: middle; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-ok { color: var(--ok); background: rgba(62,207,142,.12); }
.st-fora { color: var(--bad); background: rgba(242,102,122,.14); }
.st-alerta { color: var(--warn); background: rgba(245,184,74,.13); }
.st-aguardando { color: var(--info); background: rgba(96,165,250,.12); }
.st-pausado, .st-sem { color: var(--muted); background: rgba(139,147,168,.12); }
h1 .st, h2 .st { margin-left: 8px; }

.chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 6px; margin: 1px 4px 1px 0; border: 1px solid var(--border); white-space: nowrap; }
.chip-ok { color: var(--ok); border-color: rgba(62,207,142,.35); }
.chip-fora { color: var(--bad); border-color: rgba(242,102,122,.5); background: rgba(242,102,122,.08); }
.chip-aguardando { color: var(--info); }
.chip-pausado { color: var(--muted); }

/* cartões de cliente com favos */
.clis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.clis .card + .card { margin-top: 0; }
.cli { border-top: 3px solid var(--ok); }
.cli-fora { border-top-color: var(--bad); box-shadow: 0 0 0 1px rgba(242,102,122,.25), 0 8px 30px rgba(242,102,122,.12); }
.cli-alerta { border-top-color: var(--warn); }
.cli-aguardando, .cli-sem, .cli-pausado { border-top-color: var(--muted); }
.cli-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.cli-head a { color: var(--text); }
.cli-head a:hover h2 { color: var(--accent); }
.hexes { display: flex; flex-wrap: wrap; gap: 6px; }
.hex {
  --c: var(--ok);
  width: 92px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 42%, #0d1018), color-mix(in srgb, var(--c) 18%, #0d1018));
  color: #fff; padding: 0 14px; transition: transform .12s, filter .12s;
}
.hex:hover { transform: scale(1.06); filter: brightness(1.2); }
.hex-n { font-size: 11.5px; font-weight: 650; line-height: 1.15; max-height: 2.4em; overflow: hidden; }
.hex-v { font-size: 10.5px; opacity: .85; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hex-fora { --c: var(--bad); animation: pulsa-hex 1.6s infinite; }
.hex-alerta { --c: var(--warn); }
.hex-aguardando { --c: var(--info); }
.hex-pausado, .hex-sem { --c: #5b6275; }
@keyframes pulsa-hex { 50% { filter: brightness(1.45); } }

.tudo-ok { color: var(--ok); font-weight: 600; padding: 18px 4px; font-size: 15px; }
tr.prob-fora td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.prob-alerta td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* eventos */
.evs { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 96px 64px 1fr; gap: 4px 10px; padding: 7px 4px; border-bottom: 1px solid rgba(39,45,59,.6); color: var(--text); font-size: 13px; align-items: baseline; }
.ev:last-child { border-bottom: 0; }
.ev:hover { background: rgba(255,255,255,.03); }
.ev .muted { grid-column: 3; font-size: 12px; }
.ev-h { color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-t { font-weight: 700; font-size: 11px; letter-spacing: .05em; }
.ev-caiu .ev-t { color: var(--bad); }
.ev-voltou .ev-t { color: var(--ok); }

/* gráficos */
.tbl-wrap { overflow-x: auto; }
.spark-td { width: 170px; }
canvas.spark { width: 160px; height: 34px; display: block; }
.grafico-g { position: relative; }
canvas.g { width: 100%; height: 220px; display: block; }
.dica-g { display: none; position: absolute; top: 8px; pointer-events: none; background: rgba(10,12,18,.92); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.45; min-width: 150px; }
.seg-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar h1 { display: flex; align-items: center; flex-wrap: wrap; }
.topbar a.small { display: inline-flex; align-items: center; gap: 4px; }
.topbar a.small svg { width: 14px; height: 14px; }
.card-head .actions { display: flex; gap: 6px; }
.banner.bad, .banner.warn { margin-bottom: 10px; }

/* modo TV: sem menu, tudo maior */
body.modo-tv .app { grid-template-columns: 1fr; }
body.modo-tv .side { display: none; }
body.modo-tv .main { max-width: none; padding: 20px 28px; }
body.modo-tv .hex { width: 112px; height: 98px; }
body.modo-tv .hex-n { font-size: 13px; }
.tv-hora { font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 18px 16px 50px; }
  .ev { grid-template-columns: 80px 56px 1fr; }
}

.sil-sel { width: auto; padding: 4px 9px; font-size: 12.5px; }
.topbar .actions { align-items: center; }

pre.chave { white-space: pre-wrap; word-break: break-all; background: rgba(0,0,0,.25); padding: 10px; border-radius: 8px; margin: 10px 0 0; user-select: all; }

/* Gráficos (painéis estilo Grafana) */
.g-cli + .g-cli { margin-top: 26px; }
.g-cli-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.g-cli-head a { color: var(--text); }
.g-cli-head h2 { margin: 0; font-size: 18px; }
.g-grade { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.g-grade .card + .card { margin-top: 0; }
.g-painel { padding: 14px 14px 10px; }
.g-tit { font-size: 13px; font-weight: 650; letter-spacing: .01em; margin-bottom: 8px; color: var(--text); }
.g-area { position: relative; }
canvas.gm { width: 100%; height: 190px; display: block; cursor: crosshair; }
.g-dica { display: none; position: absolute; top: 4px; pointer-events: none; z-index: 5; min-width: 200px; max-width: 280px;
  background: rgba(13, 15, 20, .95); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.g-dh { color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.g-dl { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; line-height: 1.6; }
.g-dl i, .g-li i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.g-dl b { font-variant-numeric: tabular-nums; color: var(--text); }
.g-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.g-li { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.g-li:hover { color: var(--text); }
.g-lv { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.g-ln { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .g-grade { grid-template-columns: 1fr; } }
