/* Portal de APIs GransoftWeb (/API e /API/{Grupo}).
   Tudo fica sob .gsapi para não brigar com Bootstrap/AdminLTE carregados pelo layout. */

body.gsapi-body { margin: 0; background: #F7F7FA; }
body.gsapi-body #page-outer-nonav, body.gsapi-body #page-container { padding: 0; margin: 0; background: #F7F7FA; }

.gsapi {
    --azul: #16233F; --azul-2: #22375A; --verde: #157F73; --verde-claro: #2FBF9B; --verde-fundo: #E8F3F1; --verde-hover: #D6EDE8;
    --texto-2: #4A5A70; --texto-3: #5A6C82; --borda: #E2E5EA; --borda-2: #EDF0F4; --campo: #D8DEE6; --fundo: #F7F7FA;
    --erro: #C2384A; --erro-fundo: #FCE7EA; --aviso: #8A5300; --aviso-fundo: #FDF1D6; --info: #1B5FC4; --info-fundo: #E6EEFC;
    --mono: 'Roboto Mono', Consolas, monospace;
    min-height: 100vh; display: flex; flex-direction: column; background: var(--fundo); color: var(--azul);
    font-family: Roboto, 'Segoe UI', system-ui, sans-serif; font-size: 15px; line-height: 22px; -webkit-font-smoothing: antialiased;
}
.gsapi *, .gsapi *::before, .gsapi *::after { box-sizing: border-box; }
.gsapi h1, .gsapi h2, .gsapi h3 { font-family: inherit; color: var(--azul); margin: 0; }
.gsapi h1 { font-size: 26px; line-height: 32px; font-weight: 700; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gsapi h2 { font-size: 18px; line-height: 24px; font-weight: 700; }
.gsapi p { margin: 0; }
.gsapi a { color: var(--verde); }
.gsapi a:hover { color: var(--azul); }
.gsapi code, .gsapi .gsapi-mono { font-family: var(--mono); }
.gsapi code { font-size: 13px; background: none; padding: 0; color: inherit; }
.gsapi [hidden] { display: none !important; }
.gsapi a:focus-visible, .gsapi button:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
.gsapi input:focus, .gsapi textarea:focus, .gsapi select:focus { outline: none; }
.gsapi .gsapi-so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gsapi .gsapi-sub { font-size: 14px; color: var(--texto-2); }
.gsapi .gsapi-linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gsapi .gsapi-entre { justify-content: space-between; }

/* Topo e rodapé */
.gsapi-topo { height: 60px; background: var(--azul); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; }
.gsapi-topo-marca { display: flex; align-items: center; gap: 16px; }
.gsapi-topo-marca a { display: flex; }
.gsapi-topo-marca img { height: 22px; width: auto; display: block; }
.gsapi-topo-sep { width: 1px; height: 24px; background: rgba(255,255,255,.18); }
.gsapi-topo-nome { color: #fff; font-size: 15px; font-weight: 500; }
.gsapi-topo-nav { display: flex; gap: 8px; }
.gsapi .gsapi-topo-btn { height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 4px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; transition: background .2s; }
.gsapi .gsapi-topo-btn:hover { background: rgba(47,191,155,.14); color: #fff; }
.gsapi-rodape { border-top: 1px solid var(--borda); background: #fff; }
.gsapi-rodape-in { max-width: 1280px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--texto-2); }
.gsapi-rodape-in > a { color: var(--texto-2); }

/* Estrutura */
.gsapi-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.gsapi-main-larga { max-width: 1280px; padding-top: 28px; }
.gsapi-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.gsapi-cab-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 680px; }
.gsapi-cab-txt p { font-size: 15px; line-height: 23px; color: var(--texto-2); }
.gsapi-cab-url { display: flex; flex-direction: column; gap: 6px; flex: 0 1 460px; min-width: 0; }
.gsapi-cab-url label { font-size: 14px; font-weight: 500; margin: 0; }
.gsapi-cab-url .gsapi-linha { flex-wrap: nowrap; }
.gsapi-cab-url input { flex: 1; min-width: 0; }
.gsapi-duas { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.gsapi-grupos { flex: 999 1 560px; min-width: 0; }
.gsapi-lado { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.gsapi-card { background: #fff; border: 1px solid var(--borda); border-radius: 14px; box-shadow: 0 1px 3px rgba(18,45,62,.06); overflow: hidden; }
.gsapi-pad { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.gsapi-card-cab { padding: 18px 22px; border-bottom: 1px solid var(--borda); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gsapi-card-cab.gsapi-col { flex-direction: column; align-items: flex-start; gap: 2px; }
.gsapi-card-tit { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gsapi-trilha { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texto-2); }
.gsapi-trilha a { color: var(--texto-2); }
.gsapi-trilha span { color: var(--azul); font-weight: 500; }
.gsapi-meta { display: flex; gap: 28px; font-size: 12px; color: var(--texto-2); flex-wrap: wrap; }
.gsapi-meta > div { display: flex; flex-direction: column; }
.gsapi-meta code, .gsapi-meta b { font-size: 13px; font-weight: 600; color: var(--azul); }

/* Selos */
.gsapi-pill { font-size: 12.5px; line-height: 20px; font-weight: 500; padding: 3px 12px; border-radius: 999px; background: var(--verde-fundo); color: var(--verde); white-space: nowrap; }
.gsapi-pill-erro { background: var(--erro-fundo); color: var(--erro); }
.gsapi-mini { font-size: 11px; font-weight: 500; color: var(--texto-2); background: var(--borda-2); padding: 2px 7px; border-radius: 999px; }
.gsapi-tag { height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 999px; background: var(--borda-2); color: var(--texto-2); font-size: 12.5px; font-weight: 500; }
.gsapi-tag code { color: var(--azul); font-size: 12.5px; }
.gsapi-tag-aviso { background: var(--aviso-fundo); color: var(--aviso); }
.gsapi-tag-info { background: #E4EEFF; color: #0B57C8; }
.gsapi-grupo-tit .gsapi-tag { height: 22px; font-size: 11.5px; }

/* Lista de grupos */
.gsapi .gsapi-grupo { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--borda-2); text-decoration: none; color: var(--azul); transition: background .2s; }
.gsapi .gsapi-grupo:last-child { border-bottom: 0; }
.gsapi .gsapi-grupo:hover { background: var(--fundo); color: var(--azul); }
.gsapi-grupo-ico { width: 44px; height: 44px; flex: none; border-radius: 999px; background: var(--verde-fundo); color: var(--verde); display: grid; place-items: center; }
.gsapi-grupo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gsapi-grupo-tit { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gsapi-grupo-tit b { font-size: 16px; font-weight: 700; }
.gsapi-grupo-tit code { font-size: 12.5px; color: var(--texto-2); }
.gsapi-chev { color: var(--verde); flex: none; transition: transform .2s; }
.gsapi-grupo:hover .gsapi-chev { transform: translateX(3px); }

/* Campos */
.gsapi-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gsapi .gsapi-rotulo { font-size: 15px; font-weight: 500; color: var(--azul); margin: 0; }
.gsapi .gsapi-obrig { color: var(--erro); margin-left: 2px; }
.gsapi .gsapi-input, .gsapi .gsapi-ro, .gsapi .gsapi-busca {
    width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 4px; border: 1.5px solid var(--verde); background: #fff;
    font: 400 15px/22px Roboto, 'Segoe UI', sans-serif; color: var(--azul); transition: border-color .2s, box-shadow .2s;
}
.gsapi select.gsapi-input { height: 44px; padding: 0 10px; }
.gsapi .gsapi-input:focus, .gsapi .gsapi-busca:focus-within { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(47,191,155,.25); }
.gsapi .gsapi-input[aria-invalid="true"] { border-color: #E24C5B; background: var(--erro-fundo); }
.gsapi .gsapi-ro { border-color: var(--campo); background: #F0F0F0; font: 400 13px/19px var(--mono); resize: none; }
.gsapi input.gsapi-ro { font-size: 14px; }
.gsapi .gsapi-json { font: 400 13px/20px var(--mono); min-height: 180px; resize: vertical; }
.gsapi .gsapi-erro { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--erro); }
.gsapi .gsapi-campo-desc { font-size: 12.5px; line-height: 18px; color: var(--texto-3); }

/* Botões */
.gsapi .gsapi-btn { height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 4px; border: 0;
    background: none; font: 700 15px/20px Roboto, 'Segoe UI', sans-serif; white-space: nowrap; cursor: pointer; text-decoration: none;
    transition: background .2s, color .2s, transform .15s; }
.gsapi .gsapi-btn:active { transform: translateY(1px); }
.gsapi .gsapi-btn:disabled { opacity: .6; cursor: default; }
.gsapi .gsapi-btn-primario { background: var(--azul); color: #fff; }
.gsapi .gsapi-btn-primario:hover { background: var(--azul-2); color: #fff; }
.gsapi .gsapi-btn-outline { border: 1.5px solid var(--verde-claro); background: var(--verde-fundo); color: var(--verde); font-size: 14px; padding: 0 16px; }
.gsapi .gsapi-btn-outline:hover { background: var(--verde-hover); color: var(--verde); }
.gsapi .gsapi-btn-ghost { color: var(--texto-2); font-weight: 500; padding: 0 14px; }
.gsapi .gsapi-btn-ghost:hover { background: var(--borda-2); color: var(--azul); }
.gsapi .gsapi-btn-p { height: 30px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--verde); }
.gsapi .gsapi-btn-escuro { color: #B9C7D4; }
.gsapi .gsapi-btn-escuro:hover { background: rgba(255,255,255,.08); color: #fff; }
.gsapi .gsapi-passos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--texto-2); }
.gsapi .gsapi-passos b, .gsapi .gsapi-passos code { color: var(--azul); }

/* Testador (formulário + painel escuro) */
.gsapi-teste { display: flex; flex-wrap: wrap; }
.gsapi-teste-form { flex: 1 1 400px; min-width: 0; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 16px; margin: 0; }
.gsapi-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; }
.gsapi-campos .gsapi-largo { grid-column: 1 / -1; }
.gsapi-painel { flex: 1 1 400px; min-width: 0; min-height: 320px; background: var(--azul); color: #C6D2E0; display: flex; flex-direction: column; }
.gsapi-painel-cab { padding: 16px 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gsapi-painel-tit { font-size: 14px; font-weight: 500; color: #fff; }
.gsapi-abas { display: inline-flex; gap: 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
.gsapi .gsapi-abas button { height: 40px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; cursor: pointer;
    font: 500 14px/20px Roboto, sans-serif; color: #B9C7D4; }
.gsapi .gsapi-abas button[aria-selected="true"] { border-bottom-color: var(--verde-claro); color: #fff; font-weight: 700; }
.gsapi-painel-corpo { flex: 1; padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.gsapi-vazio { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; border: 1px dashed rgba(255,255,255,.18); border-radius: 8px; font-size: 14px; color: #B9C7D4; }
.gsapi-carregando { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 14px; font-weight: 500; color: #B9C7D4; }
.gsapi-spin { width: 36px; height: 36px; border-radius: 999px; border: 3px solid #D8E6E3; border-top-color: var(--verde-claro); animation: gsapi-gira .8s linear infinite; }
@keyframes gsapi-gira { to { transform: rotate(360deg); } }
.gsapi .gsapi-pre { margin: 0; flex: 1; max-height: 560px; overflow: auto; padding: 0; border: 0; border-radius: 0; background: none; color: #C6D2E0;
    font: 400 12.5px/20px var(--mono); white-space: pre-wrap; word-break: break-word; }
.gsapi .gsapi-pre .gsapi-k { color: #2FBF9B; }
.gsapi .gsapi-pre .gsapi-c { color: #8494A8; }
.gsapi-status { height: 22px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px 0 8px; border-radius: 8px; background: rgba(47,191,155,.16); color: #2FBF9B; font-size: 12.5px; font-weight: 500; }
.gsapi-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gsapi-status.gsapi-status-erro { background: rgba(226,76,91,.18); color: #FF8A96; }

/* Página do grupo: menu lateral */
.gsapi-nav { flex: 1 1 260px; max-width: 100%; min-width: 0; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-x: hidden; overflow-y: auto; }
.gsapi .gsapi-busca { display: flex; align-items: center; gap: 8px; width: auto; margin: 0 2px 8px; padding: 0 12px; color: var(--texto-3); flex: none; }
.gsapi .gsapi-busca input { flex: 1; min-width: 0; border: 0; background: none; font: 400 14px/20px Roboto, sans-serif; color: var(--azul); height: 40px; }
.gsapi-nav-grupo { display: flex; flex-direction: column; gap: 2px; }
.gsapi-nav-tit { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); padding: 14px 12px 6px; }
.gsapi .gsapi-nav-i { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-left: 3px solid transparent; border-radius: 4px;
    text-decoration: none; font: 500 14px/20px Roboto, sans-serif; color: var(--texto-2); transition: background .2s, color .2s; }
.gsapi .gsapi-nav-i:hover { background: var(--fundo); color: var(--azul); }
.gsapi .gsapi-nav-i[aria-current="page"] { background: var(--verde-fundo); color: var(--verde); font-weight: 700; border-left-color: var(--verde-claro); }
.gsapi-nav-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsapi-verbo { font: 500 10px/18px var(--mono); padding: 0 5px; border-radius: 4px; background: var(--borda-2); color: var(--texto-2); flex: none; }
.gsapi-ponto { width: 7px; height: 7px; border-radius: 50%; background: #E0A100; flex: none; }
.gsapi-nav-vazio { margin: 8px 12px; font-size: 12px; }

/* Página do grupo: método selecionado */
.gsapi-artigo { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.gsapi-ep { padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.gsapi-ep-rota { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gsapi-ep-rota code { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.gsapi-ep-verbo { height: 24px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 4px; background: var(--verde-fundo); color: var(--verde); font: 500 12px/24px var(--mono); }
.gsapi .gsapi-ep h2 { font-size: 22px; line-height: 28px; }
.gsapi-ep-desc { max-width: 760px; font-size: 14px; line-height: 23px; color: var(--texto-2); }
.gsapi-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.gsapi-aviso { display: flex; gap: 10px; padding: 12px 14px; border-radius: 4px; font-size: 13px; line-height: 21px; color: var(--azul); background: var(--info-fundo); }
.gsapi-aviso svg { flex: none; margin-top: 2px; color: var(--info); }
.gsapi-aviso.gsapi-aviso-alerta { background: var(--aviso-fundo); }
.gsapi-aviso.gsapi-aviso-alerta svg { color: var(--aviso); }
.gsapi-usos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.gsapi-usos code { font-size: 12.5px; color: var(--texto-2); overflow-wrap: anywhere; }
.gsapi-sec-tit { margin: 0; padding: 18px 24px; font-size: 18px; line-height: 24px; font-weight: 700; border-bottom: 1px solid var(--borda); }
.gsapi-tabela-wrap { overflow-x: auto; }
.gsapi .gsapi-tabela { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; margin: 0; }
.gsapi .gsapi-tabela th { padding: 10px 12px; background: var(--fundo); text-align: left; font-size: 13px; font-weight: 500; color: var(--texto-2); white-space: nowrap; }
.gsapi .gsapi-tabela td { padding: 12px; vertical-align: top; border-top: 1px solid var(--borda-2); }
.gsapi .gsapi-tabela th:first-child, .gsapi .gsapi-tabela td:first-child { padding-left: 24px; }
.gsapi .gsapi-tabela th:last-child, .gsapi .gsapi-tabela td:last-child { padding-right: 24px; }
.gsapi .gsapi-tabela td code { font-size: 12.5px; font-weight: 500; }
.gsapi .gsapi-tabela .gsapi-tipo { font: 400 12px/20px var(--mono); color: var(--texto-2); white-space: nowrap; }
.gsapi .gsapi-tabela .gsapi-desc { color: var(--texto-2); min-width: 240px; }
.gsapi-uso { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--borda-2); color: var(--texto-2); white-space: nowrap; }
.gsapi-uso::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gsapi-uso.gsapi-uso-obrig { background: var(--erro-fundo); color: var(--erro); }
.gsapi-sem { margin: 0; padding: 20px 24px; font-size: 13px; color: var(--texto-2); }
.gsapi-ep-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 720px) {
    .gsapi-main { padding: 20px 14px 40px; }
    .gsapi-ep { padding: 20px; }
    .gsapi-nav { position: static; max-height: none; }
    .gsapi-topo-nome, .gsapi-topo-sep { display: none; }
    /* Com Desenvolvedores e Swagger no topo, os atalhos quebram linha no celular. */
    .gsapi-topo { height: auto; min-height: 60px; padding: 8px 14px; flex-wrap: wrap; }
    .gsapi-topo-nav { flex-wrap: wrap; gap: 4px; }
    .gsapi .gsapi-topo-btn { padding: 0 8px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .gsapi *, .gsapi *::before, .gsapi *::after { transition-duration: .01ms !important; animation-duration: 2s !important; }
}
