/* Página de status dos sistemas públicos.
   Valores do protótipo aprovado (docs/prototipo/pagina-status-v5.html). Sem JavaScript e
   sem estilo em linha: tudo que muda por estado vem de classes (ok, slow, down; crit, warn). */

/* Fontes servidas pelo próprio monitor (subconjunto latin, licença OFL ao lado). */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/static/fonts/bricolage-grotesque-latin-opsz-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/instrument-sans-latin-wght-normal.woff2) format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #0a0e13; --panel: #10161d; --edge: #1d2731;
  --ink: #e3eaf0; --ink-2: #9aabb9; --ink-3: #7e8f9e;
  --ok: #3ddc84; --warn: #ffb02e; --crit: #ff4d4f;
  --none: #26323e;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 2000px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 56px) 56px; }

a { color: inherit; }
a:focus-visible, .rolagem:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

/* cor de cada estado: os cartões, ícones e textos leem --dot */
.ok { --dot: var(--ok); }
.slow { --dot: var(--warn); }
.down { --dot: var(--crit); }

/* barra do topo: discreta, só identifica e diz quando foi a última checagem */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--edge); margin-bottom: 32px; }
.brand { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variation-settings: "opsz" 24; margin: 0; line-height: 1.3; }
.when { font-size: 14px; color: var(--ink-2); margin: 0 0 0 auto; }
.nav a { font-size: 14px; font-weight: 600; color: var(--ink); text-underline-offset: 3px; }

h2.sec { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 14px; font-variation-settings: "opsz" 24; }

/* ícones de estado: desenho próprio por estado, traço na cor do fundo sobre o LED colorido */
.ic { display: block; }
.ic path { fill: none; stroke: var(--bg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ic circle { fill: var(--bg); }

/* avisos: cartões largos, um por problema */
.alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(560px, 100%), 1fr)); gap: 14px; margin-bottom: 36px; }
.al { display: grid; grid-template-columns: 60px 1fr auto; border: 1px solid var(--c); border-radius: 10px; overflow: hidden; background: var(--wash); }
.al.crit { --c: var(--crit); --wash: rgba(255,77,79,.08); }
.al.warn { --c: var(--warn); --wash: rgba(255,176,46,.08); }
.al .ico { background: var(--c); display: grid; place-items: center; }
.al .ico .ic { width: 34px; height: 34px; }
.al .ico .ic path { stroke-width: 1.8; }
.al .body { padding: 14px 20px; align-self: center; min-width: 0; }
.al h3 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 4px; font-variation-settings: "opsz" 36; overflow-wrap: anywhere; }
.al h3 a { text-decoration: none; }
.al h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.al h3 span { font-family: var(--text); font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--c); margin-left: 6px; vertical-align: 2px; }
.al .why { margin: 0 0 3px; font-size: 15px; max-width: 46em; overflow-wrap: anywhere; }
.al .tg { margin: 0; font-size: 13px; color: var(--ink-2); }
.al .fig { padding: 12px 22px; border-left: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; justify-content: center; align-items: flex-end; text-align: right; min-width: 128px; }
.al .big { font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: -.035em; font-variation-settings: "opsz" 72; margin: 0; white-space: nowrap; }
.al .big small { font-family: var(--text); font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin-left: 4px; }
.al .fcap { font-size: 12.5px; color: var(--ink-2); margin: 4px 0 0; }

/* faixa que substitui os avisos quando não há problema */
.calma { border: 1px solid var(--edge); border-radius: 10px; background: var(--panel); margin-bottom: 36px; }
.calma p { margin: 0; padding: 16px 20px; display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; font-variation-settings: "opsz" 24; }
.calma.ok { border-color: var(--ok); background: rgba(61,220,132,.08); }
.calma .led { width: 22px; height: 22px; }

/* grade com todos os sistemas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.t { background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 20px 20px 16px 24px; position: relative; min-width: 0; }
.t::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dot); border-radius: 8px 0 0 8px; }
.t:hover { border-color: #2b3946; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
h3.nm, h2.nm { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.2; font-variation-settings: "opsz" 24; min-width: 0; overflow-wrap: anywhere; }
/* o cartão inteiro é o link para a página do sistema */
.t .nm a { text-decoration: none; }
.t .nm a::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.t .nm a:focus-visible { outline: none; }
.t .nm a:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 2px; }
.st { font-size: 14px; font-weight: 600; color: var(--dot); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.led { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); display: inline-grid; place-items: center; align-self: center; }
.led .ic { width: 100%; height: 100%; }
.host { font-size: 13px; color: var(--ink-3); margin: 2px 0 0; overflow-wrap: anywhere; }
.selo { display: inline-block; margin: 8px 0 0; padding: 1px 10px; border: 1px dashed var(--ink-3); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.val { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1; letter-spacing: -.03em; margin-top: 18px; font-variation-settings: "opsz" 96; }
.val .u { font-family: var(--text); font-size: 17px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.val.none { font-size: 30px; color: #fff; }
.cap { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }

/* gráfico das últimas 8 h */
.spark { display: block; width: 100%; height: auto; margin: 12px 0 8px; overflow: visible; }
.spark-lim { stroke: rgba(255,176,46,.5); stroke-width: 1; stroke-dasharray: 4 4; }
.spark-area { fill: rgba(138,160,179,.10); }
.spark-line { fill: none; stroke: #8aa0b3; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-pt { fill: var(--dot); stroke: var(--panel); stroke-width: 2; }

/* faixa de 90 dias: fica acima do link do cartão para mostrar o título de cada dia */
.strip { display: flex; gap: 1px; height: 20px; position: relative; z-index: 1; }
.strip i { flex: 1; background: var(--ok); opacity: .5; }
.strip i.w { background: var(--warn); opacity: 1; }
.strip i.c { background: var(--crit); opacity: 1; }
.strip i.n { background: var(--none); opacity: 1; }
.strip i:hover { outline: 2px solid var(--ink-3); }
.foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.foot b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.vazio { color: var(--ink-2); margin: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 28px; font-size: 13px; color: var(--ink-2); align-items: center; }
.legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.ok { background: var(--ok); opacity: .5; }
.sw.w { background: var(--warn); }
.sw.c { background: var(--crit); }
.sw.n { background: var(--none); }

/* página de um sistema */
.sis { max-width: 760px; margin-bottom: 36px; }
.sis h2.nm { font-size: 26px; font-variation-settings: "opsz" 36; }

/* tabelas (versão acessível e endereços de um sistema) */
.rolagem { overflow-x: auto; }
.tab { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--edge); font-size: 14px; }
.tab caption { caption-side: top; text-align: left; color: var(--ink-2); padding: 0 0 8px; }
.tab th, .tab td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--edge); }
.tab thead th { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tab tbody th { font-weight: 600; }
.tab tbody th a { text-underline-offset: 3px; }
.tab .selo { margin: 0 0 0 6px; }
.tab .rot { display: block; }
.tab .host { font-weight: 400; }
.tab .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.enderecos { margin-bottom: 8px; }

@media (max-width: 720px) {
  .when { margin-left: 0; }
  .al { grid-template-columns: 52px 1fr; }
  .al .fig { grid-column: 1 / -1; border-left: 0; border-top: 1px solid rgba(255,255,255,.07); align-items: flex-start; text-align: left; padding: 12px 20px; }
  .al h3 span { display: block; margin: 6px 0 0; vertical-align: baseline; }
}

/* a página não anima nada; a regra garante isso também para o que vier depois */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
