/* Cerebot Ops — direcao C "Leve" com a marca Cerebot (mockup 23/10/26). Cores da marca do site cerebot.com.br. */
:root {
  --bg: #F5F5F7; --surf: #FFFFFF; --line: #EEEEF2; --text: #1D1D1F; --ink: #1E2470; --t2: #5F6068;
  --trilho: #D3DAF0; --warn: #B45309; --bad: #D93025; --bad-bg: #FCEBEA; --warn-bg: #FDF1E4; --ok-txt: #1F8F4E;
  --azul: #2D5CF6; --azul-bg: #E8EEFF; --lima: #A3E635; --code: #F0F1F5;
  --sombra: 0 6px 24px rgba(30, 36, 112, .08);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111325; --surf: #1B1E36; --line: #2A2E4D; --text: #EEF0FB; --ink: #EEF0FB; --t2: #A3A9CC;
    --trilho: #3A4170; --warn: #F0A050; --bad: #FF8A7A; --bad-bg: #3A2530; --warn-bg: #3A2E1E; --ok-txt: #8FD3B0;
    --azul: #7C9CFF; --azul-bg: #25306A; --code: #15182C; --sombra: 0 6px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
main { max-width: 560px; margin: 0 auto; padding-top: env(safe-area-inset-top); }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* Abertura */
.abertura { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.abertura img { width: 84px; height: 84px; animation: flutua 2.4s ease-in-out infinite; }
.abertura span { font-size: 18px; font-weight: 600; color: var(--ink); }
@keyframes flutua { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .abertura img { animation: none; } }

/* Cabecalho */
.topo { display: flex; align-items: center; gap: 10px; padding: 14px 12px 0 20px; }
.topo img { width: 34px; height: 34px; flex: none; }
.topo .tit { display: flex; flex-direction: column; flex: 1; line-height: 1.15; min-width: 0; }
.topo .tit b { font-size: 17px; font-weight: 600; color: var(--ink); }
.topo .tit small { font-family: var(--mono); font-size: 12px; color: var(--t2); }
.redondo { width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--surf); color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.redondo svg, .voltar svg, .seta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.redondo.girando svg { animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Resumo + barra de saude */
.hero { padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.hero h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.saude { display: grid; gap: 4px; }
.saude a { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.saude i { height: 8px; border-radius: 4px; background: var(--trilho); }
.saude span { font-size: 12px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saude .warn i { background: var(--warn); } .saude .warn span { color: var(--warn); font-weight: 600; }
.saude .bad i { background: var(--bad); } .saude .bad span { color: var(--bad); font-weight: 600; }

/* Lista de servidores */
.caixa { margin: 0 12px; background: var(--surf); border-radius: 16px; padding: 4px 0; }
.srv { display: grid; grid-template-columns: 1fr auto 16px; gap: 12px; align-items: center; min-height: 56px;
  padding: 0 14px 0 16px; border-bottom: 1px solid var(--line); }
.srv:last-child { border-bottom: 0; }
.srv:active { background: var(--bg); }
.srv .nm { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.srv .nm b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv .nm small { font-family: var(--mono); font-size: 12px; color: var(--t2); }
.srv .nm small.bad { color: var(--bad); }
.trilho { display: flex; gap: 3px; align-items: center; }
.trilho i { width: 14px; height: 6px; border-radius: 3px; background: var(--trilho); }
.trilho i.warn { background: var(--warn); } .trilho i.bad { background: var(--bad); } .trilho i.na { background: transparent; }
.seta { color: var(--t2); display: flex; }
.legenda { margin: 8px 20px 0; font-size: 12px; color: var(--t2); }

/* Secoes */
.secao { margin: 22px 12px 0; }
.secao > h2 { margin: 0 8px 8px; font-size: 13px; font-weight: 600; color: var(--t2); }
.cartao { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px;
  background: var(--surf); border-radius: 12px; margin-bottom: 8px; }
.marca { width: 28px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.marca::after { content: ''; width: 10px; height: 10px; border-radius: 2px; }
.marca.bad { background: var(--bad-bg); } .marca.bad::after { background: var(--bad); }
.marca.warn { background: var(--warn-bg); }
.marca.warn::after { width: 0; height: 0; border-radius: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--warn); }
.marca.ok { background: var(--azul-bg); } .marca.ok::after { border-radius: 50%; border: 1.6px solid var(--azul); background: transparent; }
.cartao .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cartao .tx b { font-size: 15px; font-weight: 500; }
.cartao .tx small { font-size: 13px; color: var(--t2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.secao.detalhe .cartao .tx small { -webkit-line-clamp: unset; display: block; }
.cartao .tx .sil { font-size: 12px; color: var(--t2); }
.cartao .tempo { font-family: var(--mono); font-size: 12px; align-self: center; }
.tempo.bad { color: var(--bad); } .tempo.warn { color: var(--warn); }
.vazio { padding: 16px; background: var(--surf); border-radius: 12px; color: var(--t2); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.btn-peq { margin-top: 8px; align-self: start; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 0;
  background: var(--azul-bg); color: var(--azul); font-size: 13px; font-weight: 500; cursor: pointer; }

/* Detalhe do servidor */
.barra-topo { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 0 8px; }
.voltar { min-height: 44px; display: inline-flex; align-items: center; gap: 2px; padding: 0 8px; font-size: 15px; color: var(--azul); }
.barra-topo img { width: 26px; height: 26px; margin-right: 8px; }
.cab-srv { padding: 10px 20px 4px; display: flex; flex-direction: column; gap: 6px; }
.cab-srv h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 600; color: var(--ink); }
.cab-srv small { font-family: var(--mono); font-size: 12px; color: var(--t2); overflow-wrap: anywhere; }
.linha24 { padding: 18px 20px 4px; }
.linha24 .barras { display: flex; gap: 2px; align-items: flex-end; height: 40px; }
.linha24 .barras i { flex: 1 1 0; height: 16px; border-radius: 2px; background: var(--trilho); }
.linha24 .barras i.warn { height: 28px; background: var(--warn); }
.linha24 .barras i.bad { height: 40px; background: var(--bad); }
.linha24 .barras i.na { height: 2px; background: var(--line); }
.linha24 .eixo { display: flex; justify-content: space-between; padding-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--t2); }
.prop { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; min-height: 46px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.prop:last-child { border-bottom: 0; }
.prop b { font-size: 14px; font-weight: 500; }
.prop .pb { display: flex; gap: 2px; height: 8px; }
.prop .pb i { border-radius: 4px; background: var(--trilho); }
.prop .pb i.warn { background: var(--warn); } .prop .pb i.bad { background: var(--bad); }
.prop span { font-family: var(--mono); font-size: 12px; color: var(--t2); min-width: 64px; text-align: right; }
.prop span.bad { color: var(--bad); } .prop span.warn { color: var(--warn); }
.medidores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; background: var(--surf); border-radius: 16px; }
.medidores div { display: flex; flex-direction: column; gap: 8px; }
.medidores small { font-size: 12px; color: var(--t2); }
.medidores b { font-size: 22px; font-weight: 600; color: var(--ink); }
.medidores i { height: 4px; border-radius: 2px; background: var(--trilho); display: flex; }
.medidores i::before { content: ''; width: var(--p); border-radius: 2px; background: var(--azul); }
.medidores i.warn::before { background: var(--warn); } .medidores i.bad::before { background: var(--bad); }
details.grupo { background: var(--surf); border-radius: 16px; margin-bottom: 8px; overflow: hidden; }
details.grupo summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; cursor: pointer; }
details.grupo summary::-webkit-details-marker { display: none; }
details.grupo summary b { font-size: 15px; font-weight: 500; flex: 1; }
details.grupo summary span { font-size: 13px; color: var(--t2); }
details.grupo summary span.bad { color: var(--bad); font-weight: 600; } details.grupo summary span.warn { color: var(--warn); font-weight: 600; }
details.grupo summary .seta svg { transition: transform .2s; }
details.grupo[open] summary .seta svg { transform: rotate(90deg); }
.it { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.it .tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.it .tx span { font-size: 14px; overflow-wrap: anywhere; }
.it .tx small { font-size: 12px; color: var(--t2); overflow-wrap: anywhere; }
.it .v { font-family: var(--mono); font-size: 12px; color: var(--t2); text-align: right; white-space: nowrap; }
.it.bad .v, .it.bad .tx small { color: var(--bad); } .it.warn .v { color: var(--warn); }
.it.bad .tx span::before, .it.warn .tx span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.it.bad .tx span::before { background: var(--bad); } .it.warn .tx span::before { background: var(--warn); }
.acoes { margin: 24px 12px 0; display: flex; flex-direction: column; gap: 10px; }
.btn { min-height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 14px; border: 0;
  background: var(--surf); color: var(--ink); font-size: 15px; font-weight: 500; cursor: pointer; padding: 0 16px; }
.btn.prim { background: var(--azul); color: #FFFFFF; }
.btn:disabled { opacity: .5; }

/* Historico */
.dia { margin: 18px 8px 6px; font-size: 13px; font-weight: 600; color: var(--t2); }
.ev { display: grid; grid-template-columns: 48px 10px 1fr; gap: 10px; align-items: baseline; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .h { font-family: var(--mono); font-size: 12px; color: var(--t2); }
.ev .p { width: 8px; height: 8px; border-radius: 4px; align-self: center; background: var(--trilho); }
.ev .p.ok { background: var(--ok-txt); } .ev .p.warn { background: var(--warn); } .ev .p.bad { background: var(--bad); }
.ev small { display: block; font-size: 12px; color: var(--t2); overflow-wrap: anywhere; }

/* Login e ajustes */
.entrar { padding: 40px 20px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.entrar img { width: 72px; height: 72px; }
.entrar h1 { margin: 0; font-size: 22px; color: var(--ink); }
.form { margin: 18px 12px 0; padding: 18px 16px; background: var(--surf); border-radius: 16px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--t2); }
.form input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-size: 17px; padding: 0 12px; font-family: inherit; }
.erro { color: var(--bad); font-size: 14px; min-height: 20px; margin: 0; }
.texto { font-size: 14px; color: var(--t2); line-height: 1.5; margin: 0; }
.painel-txt { background: var(--surf); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.carregando { padding: 40px 20px; color: var(--t2); font-size: 14px; text-align: center; }

/* Abas (pilula flutuante) */
.abas { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
  width: calc(100% - 24px); max-width: 536px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px; background: var(--surf); border-radius: 20px; box-shadow: var(--sombra); }
.abas[hidden] { display: none; }
.abas a { min-height: 52px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 12px; color: var(--t2); position: relative; }
.abas a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.abas a[aria-current="page"] { background: var(--azul-bg); color: var(--azul); font-weight: 600; }
