/* ===== [NOVO] Topbar/header ===== */
.topbar { background: #0f172a; }              /* mantém visual escuro elegante */
.topbar .container-xxl {
  padding-left: 1rem; 
  padding-right: 1rem;                         /* “puxa” para os lados */
}
/* nav links do topo (mantém compat com .navbar .nav-link que você já tinha) */
.topbar .nav-link { color: #cbd5e1; }
.topbar .nav-link:hover { color: #fff; }
.topbar .nav-link.active {
  font-weight: 600;
  border-bottom: 2px solid rgba(255,255,255,.6);
}
/* faixa sutil logo abaixo do topo */
.topbar-shadow { height: 1px; background: linear-gradient(to right, rgba(0,0,0,.15), rgba(0,0,0,0)); }

/* -------- Base -------- */
body { background: #f6f7f9; }
.navbar .nav-link { color: #cbd5e1; }
.navbar .nav-link:hover { color: #fff; }

.navbar .container, .navbar .container-xxl {
  justify-content: space-between; /* brand à esquerda, menu à direita */
}
.navbar .navbar-brand { margin: 0; }
.navbar .navbar-nav { margin-left: auto; }

/* ===== [OPCIONAL] se quiser o topo sempre colado no conteúdo com a mesma largura
.container-xxl { padding-left: 1rem; padding-right: 1rem; }
*/

/* -------- Resultados (tabela) -------- */
.results-table { table-layout: fixed; }
.results-table thead th { position: sticky; top: 0; z-index: 2; }
.results-table th, .results-table td {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.col-edit { width: 76px; }
.col-cns { width: 110px; }
.col-uf { width: 56px; text-align: center; }
.col-cidade { width: 160px; }
.col-denominacao { width: 320px; }
.col-atribuicoes { width: 240px; }
.col-email_contato { width: 220px; }
.col-situacao_juridica { width: 160px; }
.col-responsavel { width: 180px; }
.col-data_instalacao, .col-data_decisao, .col-data_ingresso_responsavel { width: 120px; }

/* Linha com SKY */
.row-sky td { background: #e7f1ff !important; }
.row-sky:hover td { background: #d9e9ff !important; }

/* Helpers */
.badge.sky-badge { background: #0d6efd; }
.uppercase { text-transform: uppercase; }

/* -------- Sistemas -------- */
.sist-wrap { max-height: 65vh; }
#sist-table tbody tr.selected > td { background: #e8f0ff !important; }
#sist-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sist-toolbar .input-group .btn { padding-inline: .6rem; }

/* diálogo simples */
.dlg-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 9999; }
.dlg-backdrop[hidden] { display: none; }
.dlg-card { width: min(520px, 92vw); background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); overflow: hidden; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f8f9fa; border-bottom: 1px solid #e5e7eb; }
.dlg-body { padding: 14px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; background: #f8f9fa; border-top: 1px solid #e5e7eb; }

/* --- Full width apenas na página de Resultados --- */
/*.page-resultados .container-xxl { */
/*  max-width: 100% !important;   /* ocupa toda a largura da viewport */
/*} */

/* altura útil maior para a grade (ajuste fino se quiser) */
.page-resultados .table-responsive {
  max-height: calc(100vh - 260px); /* cabeçalho+filtros ~260px */
}

/* um pouco menos de “padding” para caber mais colunas */
.page-resultados .results-table th,
.page-resultados .results-table td {
  font-size: 0.92rem;
}

/* ----- Modal Detalhes: header/foot fixos e body rolável ----- */
#det-modal .modal-content {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* evita o body “vazar” por cima do header */
}

#det-modal .modal-header,
#det-modal .modal-footer {
  position: sticky;
  background: var(--bs-body-bg, #fff);
  z-index: 3;                  /* fica acima do conteúdo */
}

#det-modal .modal-header { top: 0;  border-bottom: 1px solid var(--bs-border-color, #dee2e6); }
#det-modal .modal-footer { bottom: 0; border-top:    1px solid var(--bs-border-color, #dee2e6); }

#det-body {
  overflow: auto;              /* a rolagem fica no corpo */
  padding: .75rem 1rem;
}

/* -------- Modal de Detalhes -------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 9999; }
.modal-overlay.show { display: flex; }
.modal-card { width: min(1000px, 92vw); max-height: 90vh; overflow: auto; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.modal-head { position: sticky; top: 0; background: #f8f9fa; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.modal-title { font-weight: 600; }
.btn-close { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.modal-body { padding: 12px 16px; }
.modal-foot { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; background: #f8f9fa; border-top: 1px solid #e5e7eb; padding: 10px 16px; }
.loading { padding: 24px; text-align: center; color: #64748b; }

.det-sec { margin-bottom: .75rem; }
.det-sec summary { cursor: pointer; font-weight: 600; list-style: none; margin-bottom: .5rem; }
.det-sec summary::-webkit-details-marker { display: none; }

.det-row { border-bottom: 1px dashed #e6e6e6; padding: .35rem 0; }
.det-row .col-form-label { color:#334155; white-space: nowrap; }
.det-row input[readonly] { background: #f5f6f8; }

/* garante respiro lateral idem ao header */
main .container-xxl { padding-left: 1rem; padding-right: 1rem; }
