:root {
  color-scheme: light;
  --fundo: #f4f5f7;
  --superficie: #ffffff;
  --borda: #e1e4e8;
  --texto: #1b1f24;
  --texto-2: #57606a;
  --texto-3: #8c959f;
  --grade: #eaecef;
  --serie: #2a78d6;
  --serie-area: rgba(42, 120, 214, 0.10);
  --topo-1: #1a1c26;
  --topo-2: #35404e;
  --operational: #0ca30c;
  --degraded: #e0a000;
  --partial: #ec835a;
  --major: #d03b3b;
  --unknown: #c7ccd1;
  --maintenance: #2a78d6;
  --texto-maintenance: #1f63b5;
  --sem-monitoramento: #eceef1;
  --texto-operational: #0a7d0a;
  --texto-degraded: #9a6b00;
  --texto-partial: #b85426;
  --texto-major: #b62c2c;
  --texto-unknown: #6e7781;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fundo: #121316;
    --superficie: #1a1a19;
    --borda: #2c2f36;
    --texto: #f2f3f5;
    --texto-2: #c3c2b7;
    --texto-3: #8f9199;
    --grade: #2a2d33;
    --serie: #3987e5;
    --serie-area: rgba(57, 135, 229, 0.14);
    --unknown: #3a3e46;
    --sem-monitoramento: #22252b;
    --texto-operational: #3ccf3c;
    --texto-degraded: #fab219;
    --texto-partial: #ef9a78;
    --texto-major: #ef6b6b;
    --texto-unknown: #9aa1ab;
    --texto-maintenance: #6aa6ee;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--serie); text-decoration: none; }
a:hover { text-decoration: underline; }

/* topo */
.topo { background: linear-gradient(135deg, var(--topo-1), var(--topo-2)); padding: 44px 16px 96px; }
.topo-conteudo { max-width: 850px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marca img { display: block; height: 40px; width: auto; }
.botao-topo { color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 6px; padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.botao-topo:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; }

.pagina { max-width: 850px; margin: -64px auto 0; padding: 0 16px 48px; }

/* faixa geral */
.faixa { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 20px; font-weight: 600; padding: 18px 22px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.faixa-operational { background: var(--operational); }
.faixa-degraded { background: #c98a00; }
.faixa-partial { background: #d9693c; }
.faixa-major { background: var(--major); }
.faixa-unknown { background: #6e7781; }
.faixa-maintenance { background: var(--maintenance); }
.faixa-icone { width: 22px; height: 22px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, 0.25); position: relative; }
.faixa-icone::after { content: ""; position: absolute; inset: 0; background: #fff; -webkit-mask: var(--icone) center / 14px no-repeat; mask: var(--icone) center / 14px no-repeat; }

.nota { color: var(--texto-2); font-size: 14px; margin: 28px 2px 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#atualizado { color: var(--texto-3); }

/* caixa de componentes */
.caixa { background: var(--superficie); border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; }
.item { padding: 16px 20px; border-bottom: 1px solid var(--borda); }
.item:last-child { border-bottom: 0; }
.linha { display: flex; align-items: center; gap: 10px; }
.nome { font-weight: 600; flex: 1; min-width: 0; }
.grupo-botao { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-weight: 600; }
.grupo-botao:focus-visible { outline: 2px solid var(--serie); outline-offset: 3px; border-radius: 4px; }
.mais { width: 18px; height: 18px; flex: none; border: 1px solid var(--texto-3); border-radius: 4px; color: var(--texto-2); font-size: 14px; line-height: 16px; text-align: center; font-weight: 700; }
.estado { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.estado::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat; }
.estado.operational { color: var(--texto-operational); }
.estado.degraded { color: var(--texto-degraded); }
.estado.partial { color: var(--texto-partial); }
.estado.major { color: var(--texto-major); }
.estado.unknown { color: var(--texto-unknown); }
.estado.maintenance { color: var(--texto-maintenance); }
.operational, .faixa-operational { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.2 11.6 2.6 8l1.2-1.2 2.4 2.4 6-6L13.4 4.4z'/%3E%3C/svg%3E"); }
.degraded, .partial, .faixa-degraded, .faixa-partial { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7 3h2v6H7zm0 8h2v2H7z'/%3E%3C/svg%3E"); }
.major, .faixa-major { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.4 3.2 8 6.8l3.6-3.6 1.2 1.2L9.2 8l3.6 3.6-1.2 1.2L8 9.2l-3.6 3.6-1.2-1.2L6.8 8 3.2 4.4z'/%3E%3C/svg%3E"); }
.unknown, .faixa-unknown { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 7h10v2H3z'/%3E%3C/svg%3E"); }
.mensagem { color: var(--texto-2); font-size: 14px; margin: 4px 0 0 28px; }
.item > .mensagem.sem-recuo { margin-left: 0; }
.filhos { margin: 14px 0 0 28px; border-left: 2px solid var(--borda); padding-left: 16px; }
.filhos .item { padding: 12px 0; border-bottom: 1px dashed var(--borda); }
.filhos .item:last-child { border-bottom: 0; padding-bottom: 0; }
.filhos[hidden] { display: none; }

/* barras de 90 dias */
.barras { display: flex; gap: 2px; height: 34px; margin-top: 10px; }
.barra { flex: 1; min-width: 2px; border-radius: 2px; background: var(--sem-monitoramento); cursor: default; }
.barra.unknown.medido { background: var(--unknown); }
.barra.operational { background: var(--operational); }
.barra.degraded { background: var(--degraded); }
.barra.partial { background: var(--partial); }
.barra.major { background: var(--major); }
.barra:hover, .barra:focus-visible { opacity: 0.75; outline: none; }
.rotulos { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--texto-3); font-size: 12px; margin-top: 6px; }
.rotulos .linha-meio { flex: 1; height: 1px; background: var(--grade); }

.legenda { list-style: none; margin: 0; padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--texto-2); border-top: 1px solid var(--borda); background: var(--fundo); }
.legenda li { display: inline-flex; align-items: center; gap: 6px; }
.ponto { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--unknown); }
.ponto.operational { background: var(--operational); }
.ponto.degraded { background: var(--degraded); }
.ponto.partial { background: var(--partial); }
.ponto.major { background: var(--major); }
.ponto.maintenance { background: var(--maintenance); }
.ponto.sem-monitoramento { background: var(--sem-monitoramento); box-shadow: inset 0 0 0 1px var(--borda); }

/* blocos */
.bloco { margin-top: 44px; }
.bloco h2 { font-size: 22px; margin: 0; font-weight: 600; }
.bloco-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.abas { display: inline-flex; border: 1px solid var(--borda); border-radius: 6px; overflow: hidden; background: var(--superficie); }
.abas button { all: unset; cursor: pointer; padding: 6px 14px; font-size: 14px; color: var(--texto-2); border-right: 1px solid var(--borda); }
.abas button:last-child { border-right: 0; }
.abas button[aria-selected="true"] { background: var(--serie); color: #fff; font-weight: 600; }
.abas button:focus-visible { outline: 2px solid var(--serie); outline-offset: -2px; }

/* métricas */
.metrica { padding: 16px 20px 10px; border-bottom: 1px solid var(--borda); }
.metrica:last-child { border-bottom: 0; }
.metrica-cabecalho { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.metrica-nome { font-weight: 600; }
.metrica-valor { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metrica-valor small { font-size: 13px; color: var(--texto-2); font-weight: 500; margin-left: 2px; }
.grafico { width: 100%; height: 120px; display: block; margin-top: 6px; touch-action: pan-y; }
.grafico .grade { stroke: var(--grade); stroke-width: 1; }
.grafico .eixo { fill: var(--texto-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.grafico .area { fill: var(--serie-area); }
.grafico .linha-serie { fill: none; stroke: var(--serie); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafico .mira { stroke: var(--texto-3); stroke-width: 1; stroke-dasharray: 3 3; }
.grafico .marcador { fill: var(--serie); stroke: var(--superficie); stroke-width: 2; }

/* incidentes */
.dia { margin-top: 22px; }
.dia h3 { font-size: 16px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--borda); font-weight: 600; }
.incidente { margin: 10px 0 14px; }
.incidente-titulo { font-weight: 600; }
.incidente-titulo.major { color: var(--texto-major); }
.incidente-titulo.degraded { color: var(--texto-degraded); }
.incidente-titulo.partial { color: var(--texto-partial); }
.incidente-meta { color: var(--texto-2); font-size: 13px; }
.vazio { color: var(--texto-3); font-size: 14px; margin: 6px 0; }
.metricas .vazio { padding: 16px 20px; }

.dica { position: fixed; z-index: 10; pointer-events: none; background: var(--texto); color: var(--superficie); font-size: 12px; line-height: 1.4; padding: 7px 10px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); max-width: 240px; }
.dica strong { display: block; font-size: 13px; }

.rodape { text-align: center; color: var(--texto-3); font-size: 13px; padding: 24px 16px 40px; }

@media (max-width: 600px) {
  .topo { padding: 28px 16px 84px; }
  .marca img { height: 32px; }
  .faixa { font-size: 17px; padding: 16px; }
  .item { padding: 14px 14px; }
  .filhos { margin-left: 10px; padding-left: 12px; }
  .mensagem { margin-left: 0; }
  .metrica { padding: 14px 14px 8px; }
}
.maintenance, .faixa-maintenance { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11.5 1.5a3.5 3.5 0 0 0-3.3 4.6L2 12.3 3.7 14l6.2-6.2a3.5 3.5 0 0 0 4.6-3.3l-2 2-2-.5-.5-2z'/%3E%3C/svg%3E"); }
