:root {
  --teal: #134f5c;
  --teal-soft: #45818e;
  --teal-raw: #76a5af;
  --bg: #0e1618;
  --panel: #14212450;
  --panel-solid: #16242800;
  --card: #1a2a2e;
  --line: #24393e;
  --text: #e6eef0;
  --muted: #8fa8ae;
  --ok: #3fb27f;
  --warn: #e0a63b;
  --bad: #d9534f;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px; background: var(--teal); border-bottom: 1px solid #0b3239;
  position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 16px; margin: 0; letter-spacing: .5px; font-weight: 700; }
header .sub { color: #bcd9de; font-size: 12px; }
header .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
nav { display: flex; gap: 2px; padding: 0 22px; background: #101b1e; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav button {
  background: none; border: none; color: var(--muted); padding: 12px 16px;
  cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap;
}
nav button.on { color: #fff; border-bottom-color: var(--teal-raw); }
main { padding: 22px; max-width: 1500px; }
section { display: none; }
section.on { display: block; }
h2 { font-size: 15px; margin: 0 0 4px; }
h3 { font-size: 13px; margin: 22px 0 8px; color: var(--teal-raw); text-transform: uppercase; letter-spacing: .8px; }
p.hint { color: var(--muted); font-size: 12.5px; margin: 2px 0 14px; max-width: 780px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
label { display: block; font-size: 11.5px; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .5px; }
input, select, textarea {
  width: 100%; background: #0e1a1d; color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; font-family: var(--mono); font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-raw); }
button.act {
  background: var(--teal); color: #fff; border: 1px solid var(--teal-soft); border-radius: 6px;
  padding: 9px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
}
button.act:hover { background: var(--teal-soft); }
button.act.ghost { background: transparent; color: var(--teal-raw); }
button.act.danger { background: #52201f; border-color: #7a2f2d; color: #f0c3c1; }
button.act:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; background: var(--teal); color: #fff; padding: 9px 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
  position: sticky; top: 0;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: #1d2f34; }
.scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill.ok { background: #14402f; color: #7fe0b0; }
.pill.warn { background: #4a3a12; color: #f0cd80; }
.pill.bad { background: #4a1c1a; color: #f5a9a5; }
.pill.idle { background: #22343a; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-family: var(--mono); text-align: right; }
.big { font-size: 26px; font-weight: 700; font-family: var(--mono); }
.big.small { font-size: 19px; }
.metric { background: #0f1c1f; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.metric .lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.mono { font-family: var(--mono); font-size: 12px; }
.warnbox { background: #3a2c10; border: 1px solid #6b5316; color: #f5dfa6; padding: 12px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px; }
.badbox { background: #3d1c1a; border: 1px solid #7a2f2d; color: #f7c9c6; padding: 12px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px; }
.okbox { background: #113228; border: 1px solid #1f6349; color: #a9e8ca; padding: 12px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px; }
.chat { max-height: 46vh; overflow: auto; }
.msg { margin: 8px 0; padding: 8px 12px; border-radius: 10px; max-width: 78%; font-size: 12.5px; }
.msg.agent { background: #1b3a42; margin-right: auto; }
.msg.user { background: #2a2f35; margin-left: auto; }
.msg .who { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; max-width: 880px; width: 92%; padding: 0; }
dialog::backdrop { background: #000a; }
dialog .head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
dialog .body { padding: 18px; max-height: 74vh; overflow: auto; }
.strip { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.bar { display: flex; height: 20px; border-radius: 4px; overflow: hidden; background: #0e1a1d; font-size: 10px; }
.bar div { display: flex; align-items: center; justify-content: center; color: #04191d; font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
#login { display: grid; place-items: center; height: 100vh; }
#login .card { width: 340px; }
.hide { display: none !important; }
code { background: #0e1a1d; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
span.sub { color: var(--muted); font-size: 11.5px; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Variaveis do briefing: nome | valor | remover, alinhados em coluna. O nome e
   monoespacado porque e o texto que se escreve entre chavetas no guiao -- ver
   ali a diferenca entre `local` e `Local` evita meia hora de confusao. */
.varrow { display: grid; grid-template-columns: 190px 1fr 34px; gap: 8px; margin-bottom: 6px; align-items: center; }
.varrow input:first-child { font-family: var(--mono); }
.varrow button { background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 6px; padding: 7px 0; cursor: pointer; font-size: 14px; line-height: 1; }
.varrow button:hover { border-color: #7a2f2d; color: #f5a9a5; }
@media (max-width: 620px) { .varrow { grid-template-columns: 1fr; } }
