:root {
  --ink: #142326;
  --muted: #5c6b6e;
  --line: #d7e2e3;
  --teal: #00888a;
  --teal-dark: #0b3a3b;
  --paper: #f3f6f6;
  --card: #ffffff;
  --pass: #0f766e;
  --pass-bg: #e7f6f4;
  --fail: #c2410c;
  --fail-bg: #fde8e4;
  --warn: #b45309;
  --warn-bg: #fff4e5;
  --low: #64748b;
  --mod: #d97706;
  --high: #c2410c;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

a { color: var(--teal); }

.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 48px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
}

h1 { margin: 0; font-size: 32px; line-height: 1.1; letter-spacing: -.02em; }

.meta { margin: 6px 0 0; color: var(--muted); }

.pdf {
  border: 0;
  background: var(--teal);
  color: white;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.pdf:hover { background: #006f71; }

.lead {
  margin: 0 0 16px;
  max-width: 68ch;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.kpi, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.kpi { padding: 12px 14px; }

.kpi b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.kpi span { color: var(--muted); font-size: 13px; }

.card { padding: 16px 16px 14px; margin-bottom: 12px; }

.card h2 { margin: 0 0 8px; font-size: 16px; }

.card p { margin: 0 0 10px; }

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }

.note {
  background: #f7fbfb;
  border-left: 3px solid var(--teal);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  color: var(--ink);
  font-size: 14px;
}

.warn-note { border-left-color: var(--warn); background: var(--warn-bg); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }

th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.num { text-align: right; font-variant-numeric: tabular-nums; }

.pass { color: var(--pass); font-weight: 700; }

.fail { color: var(--fail); font-weight: 700; }

.skip { color: var(--warn); font-weight: 700; }

.plot { width: 100%; height: auto; display: block; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.hbar { display: grid; grid-template-columns: 92px 1fr 36px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }

.track { display: flex; height: 14px; background: #eef3f3; border-radius: 7px; overflow: hidden; }

.seg { display: block; height: 100%; }

.seg.low { background: var(--low); }
.seg.mod { background: var(--mod); }
.seg.high { background: var(--high); }
.seg.crit { background: #7f1d1d; }
.seg.prod { background: var(--teal); }
.seg.dev { background: #94a3b8; }

.hours { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #e7eeee; }

.hours span:nth-child(1) { background: var(--teal); }
.hours span:nth-child(2) { background: #5eead4; }

.matrix { display: grid; grid-template-columns: 140px repeat(4, 1fr); gap: 4px; font-size: 13px; }

.matrix .h { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; padding: 4px; }

.cell { border-radius: 6px; padding: 8px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }

.cell.ok { background: var(--pass-bg); color: var(--pass); }
.cell.bad { background: var(--fail-bg); color: var(--fail); }
.cell.na { background: var(--warn-bg); color: var(--warn); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  background: var(--pass-bg);
  color: var(--pass);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 650;
}

.back { font-size: 13px; }

footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

footer button {
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.sessao { max-width: 420px; }

.sessao form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.sessao label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.sessao [hidden] {
  display: none;
}

.sessao input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.sessao button {
  border: 0;
  background: var(--teal);
  color: white;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.sessao [data-erro],
.projetos [data-conta-estado] {
  margin: 0;
  min-height: 1.2em;
  color: var(--fail);
}

.projetos [data-lista] {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.projetos [data-lista] button,
.projetos [data-sair] {
  text-align: left;
}

.projetos h2 {
  margin: 28px 0 0;
  font-size: 22px;
}

.index-list { display: grid; gap: 10px; }

.index-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.index-list a:hover { border-color: var(--teal); }

.index-list strong { display: block; font-size: 18px; }

.index-list span { color: var(--muted); }

.gerar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.gerar button {
  border: 0;
  background: var(--teal);
  color: white;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.gerar button:hover { background: #006f71; }

.gerar button:disabled {
  background: #94a3a8;
  cursor: wait;
}

.gerar p {
  margin: 0;
  flex-basis: 100%;
  color: var(--muted);
  font-size: 14px;
}

.gerar p.erro { color: var(--fail); }

.abas { display: flex; flex-wrap: wrap; gap: 6px; }

.abas button,
.paginas button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.abas button[aria-selected="true"] {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: white;
}

.lista-ferramentas {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.pesquisa, .paginacao label, .datas label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.pesquisa input,
.paginacao select,
.datas input {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  min-height: 38px;
}

.pesquisa input { min-width: 220px; }

.pesquisa input:focus,
.datas input:focus,
.paginacao select:focus {
  outline: 2px solid color-mix(in srgb, var(--teal) 28%, white);
  border-color: var(--teal);
}

.datas {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.datas input {
  min-width: 154px;
  color-scheme: light;
}

.datas input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
  margin-left: 2px;
}

.datas-sep {
  color: var(--muted);
  padding-bottom: 9px;
  font-size: 16px;
}

.index-list .vazio,
.lista-tabela .vazio {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--card);
}

.lista-tabela {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
}

.lista-tabela:has(.vazio) {
  background: transparent;
  border: 0;
}

.lista-tabela a { font-weight: 650; text-decoration: none; }

.lista-tabela {
  --seta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16'%3E%3Cpath fill='%235c6b6e' fill-opacity='.4' d='M6 1 11 6H1z'/%3E%3Cpath fill='%235c6b6e' fill-opacity='.4' d='M6 15 1 10h10z'/%3E%3C/svg%3E");
  --seta-hover: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16'%3E%3Cpath fill='%235c6b6e' fill-opacity='.8' d='M6 1 11 6H1z'/%3E%3Cpath fill='%235c6b6e' fill-opacity='.8' d='M6 15 1 10h10z'/%3E%3C/svg%3E");
  --seta-cima: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16'%3E%3Cpath fill='%2300888a' d='M6 1 11 6H1z'/%3E%3Cpath fill='%235c6b6e' fill-opacity='.28' d='M6 15 1 10h10z'/%3E%3C/svg%3E");
  --seta-baixo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16'%3E%3Cpath fill='%235c6b6e' fill-opacity='.28' d='M6 1 11 6H1z'/%3E%3Cpath fill='%2300888a' d='M6 15 1 10h10z'/%3E%3C/svg%3E");
}

.lista-tabela th button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.lista-tabela th button::after {
  content: "";
  width: 12px;
  height: 16px;
  flex: 0 0 auto;
  background: var(--seta) center / 12px 16px no-repeat;
}

.lista-tabela th button:hover { color: var(--ink); }

.lista-tabela th button:hover::after { background-image: var(--seta-hover); }

.lista-tabela th[aria-sort="ascending"] button,
.lista-tabela th[aria-sort="descending"] button,
.lista-tabela th[aria-sort="ascending"] button:hover,
.lista-tabela th[aria-sort="descending"] button:hover {
  color: var(--teal-dark);
}

.lista-tabela th[aria-sort="ascending"] button::after,
.lista-tabela th[aria-sort="ascending"] button:hover::after {
  background-image: var(--seta-cima);
}

.lista-tabela th[aria-sort="descending"] button::after,
.lista-tabela th[aria-sort="descending"] button:hover::after {
  background-image: var(--seta-baixo);
}

.lista-tabela td:last-child,
.lista-tabela th:last-child { white-space: nowrap; }

.paginacao {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.paginacao p { margin: 0; color: var(--muted); font-size: 14px; }

.paginas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.paginas button[aria-current="page"] {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.paginas button:disabled, .abas button:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 800px) {
  .kpis, .grid-2 { grid-template-columns: 1fr 1fr; }
  .matrix { grid-template-columns: 1fr repeat(4, minmax(48px, 1fr)); }
  h1 { font-size: 26px; }
}

.periodo {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.periodo select {
  margin-left: 8px;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: white;
}

@media print {
  body { background: white; }
  .wrap { max-width: none; padding: 0; }
  .pdf, .back, .no-print, .gerar, .lista-ferramentas, .paginacao { display: none; }
  .card, .kpi { break-inside: avoid; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
