/* Documentacao da API Makfil.
   PERSONALIZAR: as cores da marca sao as variaveis --marca*, logo em marca/logo.svg. */
:root {
  --marca: #1f4e78;
  --marca-forte: #163a5a;
  --marca-suave: #e8f0f7;
  --fundo: #ffffff;
  --fundo-2: #f6f7f9;
  --texto: #1c2024;
  --texto-2: #5b636b;
  --borda: #dde1e6;
  --codigo-fundo: #f3f5f7;
  --ok: #1a7f37;
  --ruim: #b42318;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --marca: #6aa7dc;
    --marca-forte: #9cc5ea;
    --marca-suave: #172635;
    --fundo: #0f1215;
    --fundo-2: #161a1e;
    --texto: #e6e8ea;
    --texto-2: #a3abb3;
    --borda: #2a3037;
    --codigo-fundo: #161b20;
    --ok: #4ac26b;
    --ruim: #ff7b72;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.6 var(--fonte); }
a { color: var(--marca); }
code, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--codigo-fundo); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

.topo {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; background: var(--fundo); border-bottom: 1px solid var(--borda);
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--texto); text-decoration: none; font-size: 1.05rem; }
.status { margin-left: auto; font-size: 0.85rem; color: var(--texto-2); display: flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--texto-2); }
.status.ok::before { background: var(--ok); }
.status.ruim::before { background: var(--ruim); }
.menu-botao { display: none; }

.corpo { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.menu {
  position: sticky; top: 57px; align-self: start; height: calc(100vh - 57px); overflow-y: auto;
  padding: 24px 16px; border-right: 1px solid var(--borda); display: flex; flex-direction: column; gap: 2px;
}
.menu a { color: var(--texto-2); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 0.93rem; }
.menu a:hover, .menu a.ativo { background: var(--marca-suave); color: var(--marca-forte); }

main { padding: 32px 40px 80px; max-width: 900px; }
section { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--borda); }
section:last-child { border-bottom: 0; }
h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.5rem; margin: 8px 0 12px; }
h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.lead { font-size: 1.1rem; color: var(--texto-2); }
.apagado { color: var(--texto-2); font-size: 0.9rem; }

.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.cartao { border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px; background: var(--fundo-2); display: flex; flex-direction: column; gap: 4px; }
.cartao span { color: var(--texto-2); font-size: 0.93rem; }

pre {
  position: relative; background: var(--codigo-fundo); border: 1px solid var(--borda); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; line-height: 1.5; margin: 10px 0 16px;
}
pre .copiar {
  position: absolute; top: 8px; right: 8px; font: 0.75rem var(--fonte); padding: 3px 9px; border-radius: 5px;
  border: 1px solid var(--borda); background: var(--fundo); color: var(--texto-2); cursor: pointer; opacity: 0;
}
pre:hover .copiar, pre .copiar:focus { opacity: 1; }

table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 0.93rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--borda); vertical-align: top; }
th { background: var(--fundo-2); font-weight: 600; white-space: nowrap; }

.passos { padding-left: 1.3em; }
.passos > li { margin-bottom: 12px; }

.abas { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--borda); margin-top: 16px; }
.abas button {
  font: inherit; font-size: 0.92rem; padding: 8px 14px; border: 0; background: none; color: var(--texto-2);
  border-bottom: 2px solid transparent; cursor: pointer;
}
.abas button[aria-selected="true"] { color: var(--marca-forte); border-bottom-color: var(--marca); font-weight: 600; }
.aba { padding-top: 8px; }

button, input { font: inherit; }
.explorador label { display: block; font-weight: 600; margin-bottom: 6px; }
.linha { display: flex; gap: 8px; flex-wrap: wrap; }
.linha input { flex: 1 1 260px; min-width: 0; }
input[type="password"], input[type="search"] {
  padding: 8px 12px; border: 1px solid var(--borda); border-radius: 6px; background: var(--fundo); color: var(--texto);
}
input[type="search"] { width: 100%; margin-bottom: 8px; }
form button, .detalhe button {
  padding: 8px 14px; border-radius: 6px; border: 1px solid var(--marca); background: var(--marca); color: #fff; cursor: pointer;
}
form button.secundario, .detalhe button.secundario { background: none; color: var(--marca); }
.aviso { padding: 10px 14px; border-radius: 8px; background: var(--marca-suave); }
.aviso.ruim { color: var(--ruim); }

.explorador-grade { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.lista { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; border: 1px solid var(--borda); border-radius: 8px; }
.lista li button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--borda);
  background: none; color: var(--texto); cursor: pointer; font-size: 0.88rem;
}
.lista li button:hover, .lista li button.ativo { background: var(--marca-suave); }
.lista small { display: block; color: var(--texto-2); font-family: var(--mono); font-size: 0.75rem; overflow-wrap: anywhere; }
.detalhe { min-width: 0; }
.detalhe h3 { margin-top: 0; }
.detalhe .tabela-amostra td, .detalhe .tabela-amostra th { font-size: 0.8rem; white-space: nowrap; }

@media (max-width: 860px) {
  .menu-botao {
    display: inline-block; padding: 6px 12px; border: 1px solid var(--borda); border-radius: 6px;
    background: var(--fundo); color: var(--texto); font: inherit; font-size: 0.9rem;
  }
  .status { margin-left: auto; }
  .corpo { grid-template-columns: minmax(0, 1fr); }
  .menu {
    display: none; position: fixed; top: 57px; left: 0; right: 0; height: auto; max-height: 70vh;
    background: var(--fundo); border-right: 0; border-bottom: 1px solid var(--borda); z-index: 9;
  }
  .menu.aberto { display: flex; }
  main { padding: 24px 16px 64px; }
  .topo { padding: 10px 16px; }
  h1 { font-size: 1.6rem; }
  .explorador-grade { grid-template-columns: minmax(0, 1fr); }
}
