:root {
  --largura-menu: 240px;
  --bs-primary: #1f4e79;
  --bs-primary-rgb: 31, 78, 121;
  --bs-link-color-rgb: 31, 78, 121;
  --bs-link-hover-color-rgb: 22, 56, 87;
}
[data-bs-theme='dark'] {
  --bs-link-color-rgb: 140, 185, 230;
  --bs-link-hover-color-rgb: 175, 208, 240;
}

.btn-primary {
  --bs-btn-bg: #1f4e79;
  --bs-btn-border-color: #1f4e79;
  --bs-btn-hover-bg: #183d5f;
  --bs-btn-hover-border-color: #183d5f;
  --bs-btn-active-bg: #153552;
  --bs-btn-active-border-color: #153552;
  --bs-btn-disabled-bg: #1f4e79;
  --bs-btn-disabled-border-color: #1f4e79;
}

body { min-height: 100vh; }

/* ---------- menu lateral ---------- */
.menu-lateral {
  --bs-offcanvas-width: var(--largura-menu);
  color: #cfd8e3;
}
/* O Bootstrap deixa .offcanvas-lg transparente no desktop; a cor fica no bloco interno. */
.menu-lateral > div { background: #14273a; min-height: 100%; }
@media (min-width: 992px) {
  .menu-lateral {
    width: var(--largura-menu);
    flex: 0 0 var(--largura-menu);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
}
.menu-lateral .marca { color: #fff; font-weight: 600; letter-spacing: 0.02em; }
.menu-lateral .simbolo-menu { height: 1.9rem; width: auto; flex: none; }

/* Símbolo do escritório (arte branca); a máscara permite pintá-lo na cor do tema. */
.simbolo {
  display: inline-block;
  aspect-ratio: 4 / 5;
  background-color: var(--bs-primary);
  -webkit-mask: url('/assets/img/simbolo.png') center / contain no-repeat;
  mask: url('/assets/img/simbolo.png') center / contain no-repeat;
}
[data-bs-theme='dark'] .simbolo { background-color: rgb(140, 185, 230); }
.simbolo-login { height: 4.5rem; }
.menu-lateral .nav-link {
  color: #cfd8e3;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.menu-lateral .nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.menu-lateral .nav-link.active { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; }
.menu-lateral .secao {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b9bb0;
  padding: 1rem 0.75rem 0.25rem;
}

.area-principal { min-width: 0; }

/* ---------- componentes ---------- */
.cartao-numero .valor { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.cartao-numero .rotulo { font-size: 0.8rem; color: var(--bs-secondary-color); }

.linha-tempo { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--bs-border-color); }
.linha-tempo li { position: relative; padding: 0 0 1.25rem 1rem; }
.linha-tempo li::before {
  content: '';
  position: absolute;
  left: calc(-1.25rem - 7px);
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bs-primary);
  border: 2px solid var(--bs-body-bg);
}
.linha-tempo li.anotacao::before { background: var(--bs-warning); }
.linha-tempo li.publicacao::before { background: var(--bs-info); }
/* Publicações do DJEN */
.publicacao-nova { border-left: 3px solid var(--bs-danger); }
.texto-publicacao { white-space: pre-line; max-width: 75rem; }

.dl-dados dt { font-weight: 500; color: var(--bs-secondary-color); font-size: 0.8rem; }
.dl-dados dd { margin-bottom: 0.9rem; overflow-wrap: anywhere; }

.tabela-clicavel tbody tr { cursor: pointer; }
.tabela-clicavel td:first-child { min-width: 12rem; }
pre.json { font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

.visualizador {
  width: 100%;
  height: calc(100vh - 170px);
  min-height: 420px;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  background: var(--bs-tertiary-bg);
}

.tela-login { min-height: 100vh; display: grid; place-items: center; background: var(--bs-tertiary-bg); padding: 1rem; }
.tela-login .card { width: 100%; max-width: 380px; }

/* Linhas de tabela que abrem para edição ao clicar. */
tr.linha-editavel { cursor: pointer; }

/* Cabeçalhos de tabela que ordenam a lista */
.btn-ordenar { background: none; border: 0; padding: 0; font: inherit; font-weight: inherit; color: inherit; white-space: nowrap; cursor: pointer; }
.btn-ordenar:hover { color: var(--bs-link-color); }
.btn-ordenar i { font-size: 0.7em; opacity: 0.35; }
.btn-ordenar.ativo, .btn-ordenar.ativo i { color: var(--bs-link-color); opacity: 1; }
th.text-end .btn-ordenar { text-align: right; }

/* Pasta do cliente */
.pasta-grupo > summary { cursor: pointer; list-style: none; }
.pasta-grupo > summary::-webkit-details-marker { display: none; }
.pasta-grupo:not([open]) > summary { border-bottom: 0; border-radius: inherit; }
.pasta-grupo .table td:first-child { overflow-wrap: anywhere; }
.pasta-soltar .pasta-area { outline: 2px dashed var(--bs-primary); outline-offset: 4px; border-radius: 0.375rem; }
.pasta-grupo.pasta-alvo { border-color: var(--bs-primary); box-shadow: 0 0 0 2px var(--bs-primary); }
.tabela-pasta { table-layout: fixed; }
.tabela-pasta th:nth-child(2) { width: 11rem; }
.tabela-pasta th:nth-child(3) { width: 7rem; }
.tabela-pasta th:nth-child(4) { width: 6.5rem; }
.tabela-pasta th:nth-child(5) { width: 6rem; }
.tabela-pasta td:nth-child(2) .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
