/* ============================================================
   CUSTOM PROPERTIES — Variáveis globais do sistema
   Centralizadas aqui para facilitar tematização e manutenção.
   ============================================================ */
:root {
  --bs-border-width: 0.06rem !important;
  --bs-border-radius-lg: 2rem;

  /* Paleta de cores customizada */
  --bs-green-dark: #023b06;
  /* --bs-blue-dark: #011542; */
  --bs-blue-dark: #00017f;
  /* --bs-blue-dark: #023b06; */
  --bs-blue-light: #1491bb;
  --bs-blue-claro: #b6d7f5;
  --bs-gray-padrao: #d8d7d7;
  --bs-gray-500: #aaa8a8;
  --bs-white: #ffffff;
  --bs-yellow-claro: #f4cb27;
  /* --bs-danger-text: #dc3545; */
  /* --bs-titulo-text: #ff6600; */
  --bs-titulo-text: #ffe807;
  --bs-table-striped-bg: #ecedee;

  /* Background de campos desabilitados */
  --bs-form-control-disabled-bg: #d8d7d7;

  /* Imagens do sistema */
  --img-logo-watermark: url("../images/logo_base.png");
  --img-obrigatorio: url("/assets/images/obriga2_red.png");
  --img-logo-sidebar: url("../images/logo_header.png");
}

/* ============================================================
   UTILITÁRIOS DE BACKGROUND
   Classes auxiliares para aplicar as cores customizadas do sistema.
   ============================================================ */

/* Fundo azul escuro — usado no header, rodapé e cabeçalho de tabelas */
.bg-blue-dark,
.bg-blue-dark {
  background-color: var(--bs-blue-dark);
  color: var(--bs-titulo-text);
}

/* Variante de tabela com azul escuro no cabeçalho */
.bg-table-blue-dark {
  --bs-table-bg: var(--bs-blue-dark);
  --bs-table-color: #fff;
  color: var(--bs-titulo-text);
}

.bg-green-dark {
  background-color: var(--bs-green-dark);
}
.bg-green-light {
  background-color: var(--bs-green-light);
}
.bg-white {
  background-color: var(--bs-white);
}

/* Azul claro translúcido — usado em fundos de seções secundárias */
.bg-blue-claro {
  background-color: #cfe2ff61;
}

/* Cinza médio com transparência — destaque suave */
.bg-gray-500 {
  opacity: 0.7;
  background-color: var(--bs-gray-500);
}

.bg-gray-padrao {
  background-color: var(--bs-gray-padrao);
}
.bg-red {
  background-color: rgb(255, 0, 0);
}

/* ============================================================
   RESET BASE
   Remove paddings e margins padrão do navegador.
   ============================================================ */
* {
  padding: 0;
  margin: 0;
}

/* ============================================================
   HTML & BODY — Configuração do viewport principal
   O sistema é single-page: overflow hidden evita scrollbars na
   raiz; a rolagem fica dentro das seções de conteúdo.
   ============================================================ */
html,
body {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;

  font-family: "Open Sans", sans-serif;
  font-size: 14px;

  /* Desabilita seleção de texto acidental em toda a interface */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Reduz fonte em dispositivos touch (mobile) */
@media (hover: none) {
  html,
  body {
    font-size: 12px;
  }
}

/* Marca d'água com o logo da empresa no fundo de todas as telas */
body::before {
  content: "";
  background-color: aliceblue;
  background-image: var(--img-logo-watermark);
  background-repeat: repeat;
  background-size: 15%;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0%;
  left: 0%;
  opacity: 0.05;
  z-index: -1;
}

/* ============================================================
   LAYOUT PRINCIPAL — Área de conteúdo e sidebar
   O sistema usa um menu lateral que expande/recolhe via classe
   `.menuaberto`, ajustando dinamicamente a largura do conteúdo.
   ============================================================ */

/* Área de conteúdo com menu recolhido */
.content {
  position: absolute;
  max-height: calc(100vh - 5rem);
  min-height: calc(100vh - 5rem);
  height: calc(100vh - 5rem);
  max-width: calc(100vw - 5rem);
  min-width: calc(100vw - 5rem);
  width: calc(100vw - 5rem);
  overflow: hidden;
  margin-left: 4rem;
  margin-right: 4rem;

  /* Animação suave ao expandir/recolher menu */
  transition: all 0.3s linear;
  transform-origin: top bottom;
  transform-style: preserve-3D;
}

/* Área de conteúdo com menu expandido */
.content.menuaberto {
  position: absolute;
  max-width: calc(100vw - 20rem);
  min-width: calc(100vw - 20rem);
  width: calc(100vw - 20rem);
  margin-left: 20rem;
  margin-right: 4rem;

  transition: all 0.3s linear;
  transform-origin: top bottom;
  transform-style: preserve-3D;
}

/* Conteúdo dentro de modais */
.content_modal {
  height: auto;
  overflow: hidden;
  margin-top: 4rem;
  margin-left: 1rem;
  margin-right: 1rem;
}

/* Container genérico com altura máxima controlada */
.container {
  max-height: calc(100vh - 5rem);
  max-width: 98%;
  overflow: hidden;
  transition: all 0.2s linear;
  transform-origin: top;
  transform-style: preserve-3D;
}

/* ============================================================
   HEADER & TITLE — Cabeçalho fixo da aplicação
   ============================================================ */
.header {
  max-height: 4rem;
  height: 4rem;
  min-height: 4rem;
  width: 100vw;
}

/* Barra de título fixa no topo — presente em todas as telas */
.title,
.title-modal {
  position: fixed;
  top: 0rem;
  left: 0rem;
  max-height: 4rem;
  min-height: 4rem;
  height: 4rem;
  padding: 0.5rem 1rem;
  max-width: calc(100vw);
  width: calc(100vw);
  min-width: calc(100vw - 4rem);

  transition: all 0.3s linear;
  transform-origin: top bottom;
  transform-style: preserve-3D;
}

/* Variante inline para títulos dentro de modal */
.title-modal {
  position: relative;
  display: inline;
  width: max-content;
}

/* Padding responsivo do texto do título — recua com o menu */
.titulo {
  padding-left: 4rem;
  font-size: clamp(0.8rem, 2rem - 1vw, 1.5rem) !important;
}

/* Ajuste do título e rodapé quando o menu lateral está aberto */
.title.menuaberto {
  padding-left: 17rem !important;
  transition: all 0.3s linear;
  transform-origin: top bottom;
  transform-style: preserve-3D;
}

.rodape.menuaberto {
  padding-left: 20rem !important;
  transition: all 0.3s linear;
  transform-origin: top bottom;
  transform-style: preserve-3D;
}

/* ============================================================
   TIPOGRAFIA & LINKS
   ============================================================ */
.fs-0 {
  font-size: 1rem;
}
.fs-7 {
  font-size: 0.75rem !important;
}

a {
  cursor: pointer;
  text-decoration: none;
}

a:hover {
  color: var(--bs-blue-light);
  font-weight: bold;
  font-style: italic;
}

/* ============================================================
   NAVEGAÇÃO & ABAS (tabs)
   ============================================================ */

/* Cor padrão dos links inativos */
.nav-item > .nav-link {
  color: #aaa;
}
.nav-item > .nav-link:hover {
  color: #000;
}

/* Aba ativa: sobe levemente e adiciona sombra superior */
.nav-item > .nav-link.active {
  margin-top: 0.19rem;
  box-shadow: 0 -0.06rem 0.06rem 0.06rem var(--bs-gray-500);
  color: #0d6efd;
}

/* Ícone de pasta antes de cada aba — fechado por padrão, abre na ativa */
.nav-link::before {
  content: "\f07b";
  font-family: "Font Awesome 7 Free";
  font-weight: 400;
  transition: all 0.3s ease;
  display: inline-block;
}
.nav-link.active::before {
  content: "\f07c";
}

/* Abas de conteúdo com scroll vertical e borda arredondada */
.tab-content > .tab-pane {
  overflow-x: hidden;
  overflow-y: visible;
  height: auto;
  max-height: calc(100vh - 8.5rem) !important;
  transition: height 0.2s ease;
  border-radius: 0 0.9375rem 0.9375rem 0.9375rem;
}

/* Aba ativa recebe borda e sombra interna */
.tab-content > .tab-pane.show,
.tab-content-prin > .tab-pane-prin.show {
  box-shadow: inset -0.13rem -0.13rem 0.31rem -0.31rem var(--bs-gray-500);
  border: 0.06rem solid var(--bs-gray-500);
}

/* Pane de modal sem altura fixa */
#form_modal > .tab-content > .tab-pane {
  height: auto;
}

/* Aba principal com altura máxima de 90vh */
.tab-content-prin > .tab-pane-prin {
  max-height: 90vh;
}

/* ============================================================
   FORMULÁRIOS — Labels, inputs, wrappers
   ============================================================ */

/* Label em itálico fino — padrão do sistema */
.form-label {
  font-weight: 400;
  font-style: italic;
}

/* Marca visual de campo obrigatório (asterisco à esquerda) */
.obrigatorio {
  float: left;
  color: red;
  position: relative;
  z-index: 100;
}

/* Indicador gráfico de obrigatoriedade via background-image nos inputs */
:required:not(select):not([type="radio"]),
select:required + button.form-control {
  background-image: var(--img-obrigatorio);
  background-size: 0.44rem 0.9375rem;
  background-position: 0rem 45%;
  background-repeat: no-repeat;
}

/* Select obrigatório: preserva o ícone padrão do select ao lado do marcador */
select:required {
  background-image:
    var(--img-obrigatorio), var(--bs-form-select-bg-img),
    var(--bs-form-select-bg-icon, none);
  background-repeat: no-repeat;
  background-position:
    0rem 45%,
    right 0.75rem center;
  background-size:
    0.44rem 0.9375rem,
    1rem 0.75rem;
}

/* Formulários e inputs com borda arredondada e fundo levemente azulado */
.form-control,
.btn {
  border-radius: 1.5rem !important;
}

.form-control {
  background-color: rgb(235 246 253 / 50%);
  --bs-form-select-bg-img: none;
  box-shadow: inset 0 0.02rem 0.02rem rgba(0, 0, 0, 0.25);
  padding: 0.375rem 0.375rem 0.375rem 0.75rem !important;
  max-height: 2.5rem !important;
  min-height: 2.5rem !important;
}

.form-control:has(textarea),
.form-control:has(.editor),
.form-control:has(.selectpicker-selected-list) {
  max-height: none !important;
  min-height: fit-content !important;
}

textarea.form-control {
  min-height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
  max-height: fit-content !important;
}
/* Divs usadas como form-control (wrappers) não herdam o padding interno */
div.form-control:not(input):not(textarea):not(select) {
  padding: 0 !important;
}

.form-control::placeholder {
  color: gray;
  opacity: 0.5;
  font-style: italic;
}

.form-control:focus {
  box-shadow: inset 0 0.06rem 0.06rem rgba(0, 0, 0, 0.35);
}

/* Campos de data com largura automática para não esticar o layout */
input[type="date"].form-control {
  width: auto !important;
}

/* Input-group sem quebra de linha */
.input-group {
  flex-wrap: nowrap;
  min-height: 2.5rem !important;
  max-height: 2.5rem !important;
  height: 2.5rem !important;
}

.input-group:has(textarea),
.input-group:has(.editor),
.input-group:has(.bootstrap-select .selectpicker-selected-list) {
  min-height: fit-content !important;
  max-height: none !important;
  height: auto !important;
}

/* Addon (prefixo) com bordas esquerdas arredondadas */
.input-group-text.input-group-addon {
  border-top-right-radius: 0rem !important;
  border-bottom-right-radius: 0rem !important;
  border-top-left-radius: 1.5rem !important;
  border-bottom-left-radius: 1.5rem !important;
  margin-right: 0 !important;
  margin-left: 0.1rem !important;
}

/* Sufixo (append) com bordas direitas arredondadas */
.input-group-text {
  border-top-right-radius: 1.5rem !important;
  border-bottom-right-radius: 1.5rem !important;
  margin-left: 0 !important;
  padding: 0.375rem 0.4rem;
  font-size: 0.75rem;
  background-color: rgb(235, 246, 253);
  opacity: 1;
  z-index: 100;
  min-height: 1.69rem;
}

/* Remove arredondamento esquerdo do input quando tem addon antes */
.input-group-addon + .form-control {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Remove arredondamento direito do input quando tem append depois */
.form-control:has(+ .input-group-append) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Input-group desabilitado */
.input-group.disabled {
  cursor: default;
}

/* Todos os estados de campo desabilitado — padroniza aparência e bloqueia interação */
.form-control:disabled,
.form-select:disabled,
.bootstrap-select > .disabled,
.input-group-addon:has(+ input:disabled),
input[disabled] + .input-group-append,
input:disabled,
select:disabled,
button.disabled,
[aria-disabled="true"] * {
  cursor: default;
  user-select: none;
  pointer-events: none;
  background-color: var(--bs-secondary-bg);
  color: #6c757d !important;
  padding-right: 0.69rem;
}

/* Wrapper de campo obrigatório (variante alternativa com borda) */
.input-group-required {
  display: flex;
  align-items: center;
  color: var(--bs-body-color);
  text-align: center;
  white-space: nowrap;
  background-color: var(--bs-tertiary-bg);
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: 2rem;
}

/* Contador de caracteres restantes exibido abaixo do input */
.div-caract {
  font-size: xx-small;
  display: inline-flex;
  width: auto;
  height: 1rem;
  bottom: -0.9375rem;
  position: absolute;
  left: 94%;
  color: black;
  box-shadow: inset 0 0 2.31rem 0.1rem rgb(13 110 253 / 25%);
}

/* Quando atinge o limite — destaque em vermelho */
.div-caract.acabou {
  color: red;
  left: 70%;
}

/* Campo marcado como ajustado/com erro customizado */
.input-ajustado {
  border: 0.13rem solid red !important;
  background-color: #ffe6e6;
}

/* Erros de validação do servidor (lista de erros do CI4) */
.errors li {
  list-style: none;
  width: 100%;
  text-align: center;
}

.errors ul {
  padding-left: 0;
  margin-bottom: 0;
}

/* Mensagem de validação inline — posicionada absolutamente sobre o campo */
.invalid-feedback {
  display: none;
  position: absolute;
  height: fit-content;
  width: auto;
  top: 1.5rem;
  left: 2.5rem;
  background: white;
  border-bottom: 0.06rem solid var(--bs-form-invalid-border-color);
  border-radius: 0.56rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-wrap: nowrap;
  font-size: 0.875em;
  text-align: start;
  color: var(--bs-form-invalid-color);
  z-index: 100;
}

/* Campo de senha com caixa de informações de força */
.show_password {
  pointer-events: all;
}

.show_password::before {
  content: "\f070"; /* fa-eye-slash  */
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-style: normal;
}

.show_password:hover::before {
  content: "\f06e"; /* fa-eye */
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-style: normal;
}

/* ============================================================
   INPUTS ESPECIAIS
   ============================================================ */

/* Color picker com tamanho e aparência padronizados */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 5rem !important;
  height: 2.06rem;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: none;
}

/* Remove spinner nativo dos inputs numéricos (substituído por botões customizados) */
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Botões de incremento/decremento customizados para campos numéricos */
.up-num:hover,
.down-num:hover {
  background-color: var(--bs-info);
  cursor: pointer;
}

/* Switch vertical (toggle de duas opções) */
.form-switch .form-check-input {
  width: 1.8em;
  transform: rotate(-90deg);
  margin: 0.5rem 0rem;
  padding-left: 0;
}

/* Variantes de cor para os dois estados do switch */
.form-switch .form-check-input.duasOpcoes.primeira {
  background-color: var(--bs-primary);
  opacity: 1;
}
.form-switch .form-check-input.duasOpcoes.segunda {
  background-color: var(--bs-secondary);
  transform: rotate(-270deg);
  opacity: 1;
}

/* Altura fixa para wrappers de campo simples (exceto textareas e multi-select) */
div[id^="ig_"]:not(:has(textarea)):not(:has(select[multiple])) {
  height: 3.44rem;
  overflow: visible;
  display: flex !important;
  flex-direction: inherit;
}

/* ============================================================
   BOOTSTRAP SELECT — Customizações do plugin selectpicker
   ============================================================ */

/* Borda obrigatória para diferenciar visualmente do input padrão */
.dropdown.bootstrap-select {
  border: var(--bs-border-width) solid var(--bs-border-color) !important;
}

/* Remove seta quando desabilitado */
.bootstrap-select.disabled .dropdown-toggle::after {
  display: none !important;
}

/* Dropdown desabilitado */
.dropdown-toggle.disabled,
.dropdown.bootstrap-select.disabled {
  background-color: var(--bs-secondary-bg);
  pointer-events: none;
}

/* Opção selecionada com destaque azul info */
.bootstrap-select .dropdown-menu li a.selected {
  background-color: var(--bs-info);
}

/* Largura mínima do popover de ícones */
.iconpicker-popover {
  min-width: 10rem;
}

/* Texto do botão pode quebrar linha */
.bootstrap-select > .dropdown-toggle {
  white-space: inherit !important;
}

/* Texto do item selecionado sem quebra */
.filter-option-inner-inner {
  text-wrap: nowrap;
}

/* Dropdown máximo de 30vh de altura */
.inner.show {
  max-height: 30vh !important;
}

/* Dropdown em modo popup (dentro de modal) */
.bootstrap-select.popup > .dropdown-menu.show {
  position: inherit !important;
  z-index: 1100;
  max-height: 15rem !important;
  margin-bottom: 1rem !important;
  top: -2rem !important;
  display: grid;
}

/* Lista de itens selecionados exibida abaixo do select (variante múltipla) */
.selectpicker-selected-list {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  padding-left: 0.75rem;
  cursor: pointer;
  max-height: 10rem;
  overflow-y: auto;
}
.selectpicker-selected-list div {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

/* Seta do dropdown — usa ícone FontAwesome no lugar da seta padrão Bootstrap */
.dropdown-toggle[aria-expanded="false"]::after {
  content: "\f0a5";
  font-family: "Font Awesome 7 Free";
  background-image: none;
  border: 0;
  vertical-align: middle;
  right: 3.5rem;
}

/* Seta rotacionada quando aberto */
.dropdown-toggle[aria-expanded="true"]::after {
  content: "\f0a5";
  font-family: "Font Awesome 7 Free";
  background-image: none;
  border: 0;
  vertical-align: middle;
  right: 3.5rem;
  transform: rotate(-450deg);
  transition: var(--bs-accordion-btn-icon-transition);
}

/* Menu dropdown com bordas inferiores arredondadas */
.dropdown-menu {
  border-radius: 0rem 0rem 1.25rem 1.25rem;
  box-shadow: 0.13rem 0.31rem 0.31rem -0.06rem var(--bs-gray-500);
}

/* ============================================================
   TABELAS & DATATABLES
   ============================================================ */

/* Células sempre alinhadas verticalmente ao centro */
table > tbody > tr > td,
tr td {
  vertical-align: middle;
}

/* DataTable ocupa toda a largura disponível com animação de entrada */
.dataTable {
  width: 100% !important;
  animation: showDtable 5s 5s 5s both;
}

@keyframes showDtable {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dataTables_scrollHead {
  display: flex;
}

/* Cabeçalho azul escuro nas tabelas de dados */
table.dataTable.table-info > thead.table-default th {
  background-color: var(--bs-blue-dark);
  color: var(--bs-titulo-text);
}

/* Destaque de coluna reordenada */
table.dataTable.table-info > thead.table-default th.reordered {
  border: 0.13rem solid yellow;
}

/* Seleção de texto desabilitada dentro de DataTables */
table.dataTable {
  user-select: none;
}

/* Wrapper interno das células de conteúdo: limita largura e quebra o texto */
table.dataTable td .cell-wrap {
  max-width: 50vw;
  min-width: 8vw;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Remove background herdado das células Bootstrap nas DataTables */
table.dataTable.table > :not(caption) > * > * {
  background-color: transparent;
  box-shadow: 0 0 0 0rem #fff !important;
}

/* Linhas alternadas: branco e azul claro */
table.dataTable.table-info > tbody > tr.odd {
  background-color: white !important;
}
table.dataTable.table-info > tbody > tr.even {
  background-color: var(--bs-blue-claro) !important;
}

/* Hover com gradiente azul, elevação e sombra */
table.dataTable.table-hover tbody tr:hover {
  background: linear-gradient(
    to bottom,
    rgb(150 200 220),
    rgb(131 178 198)
  ) !important;
  transform: translateY(-0.13rem);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

/* Click na linha: retorna à posição com sombra interna */
table.dataTable.table-hover tbody tr:active {
  transform: translateY(0);
  box-shadow: inset 0 0.13rem 0.25rem rgba(0, 0, 0, 0.3);
}

/* Sem bordas verticais nas células (apenas linhas horizontais) */
.table.table-vertical-borders > :not(caption) > * > * {
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
}

/* Tabela compacta para informações auxiliares */
.tabela-pequena {
  font-size: 0.63rem;
  margin: 0 !important;
}

/* Th vertical para tabelas com muitas colunas */
.vertical-th {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.69rem;
  white-space: nowrap;
  text-align: justify;
  vertical-align: middle;
  height: 5rem;
}

/* Cabeçalho de filtro fixo durante scroll horizontal */
.theadfilter {
  z-index: 200;
  position: fixed;
  opacity: 1;
}

/* DataTables — controles inferiores */
.dataTables_length {
  width: auto;
  float: left;
}
.dt-buttons {
  float: left;
  margin-right: 1%;
}
.dataTables_info {
  float: left;
  line-height: 2.3rem;
  padding-top: 0.15em !important;
}

/* Spinner de processamento com cor do sistema */
div.dataTables_processing > div:last-child > div,
div.msgprocessando > div:last-child > div {
  background-color: rgb(13 110 253);
}

/* Paginação com bordas arredondadas */
.pagination,
.pagination > li,
.pagination > li > a {
  border-radius: 5rem !important;
  --bs-pagination-padding-x: 0.575rem;
  --bs-pagination-padding-y: 0.187rem;
}

/* Modo impressão: permite scroll e remove limitações de tamanho */
.dt-print-view {
  overflow: auto !important;
  max-height: none;
  max-width: none;
  width: auto;
  height: auto;
  font-family: "Open Sans", sans-serif;
}

/* Texto das células em modo impressão: quebra linha e reduz fonte */
.dt-print-view table .text-nowrap {
  white-space: normal !important;
  font-size: 0.75rem !important;
}

/* ============================================================
   BOTÕES
   ============================================================ */

.btn {
  transition: all 0.15s ease;
  box-shadow:
    0 0.5px 0.5px rgba(0, 0, 0, 0.2),
    inset 0 0px 0 rgba(255, 255, 255, 0.4),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.1); /*base mais escura */
  --bs-btn-padding-x: 0.375rem !important;
  --bs-btn-padding-y: 0.187rem !important;
}

.btn:hover {
  color: var(--bs-btn-hover-color);
  background-color: var(--bs-btn-hover-bg);
  border-color: var(--bs-btn-hover-border-color);
  /* transform: translateY(-0.13rem); */
}

.btn:active {
  /* transform: translateY(0.06rem); */
  transform: scale(0.97);
  box-shadow: inset 0 0.13rem 0.31rem rgba(0, 0, 0, 0.35);
}

/* Ícone dentro do botão de ação — rotação animada */
.acao .btn > i {
  display: inline-block;
  transition: transform 0.3s ease;
  --angle: 0deg;
  transform: rotate(var(--angle));
}

/* Variantes de rotação pré-definidas */
.acao .btn > i.fa-rotate-270 {
  --angle: 270deg;
}
.acao .btn > i.fa-rotate-90 {
  --angle: 90deg;
}
.acao .btn > i.fa-rotate-45 {
  --angle: 45deg;
}

/* Hover nos botões de ação: aumenta o ícone */
.acao .btn:hover > i {
  transform: rotate(var(--angle)) scale(1.3);
}

/* Botão-grupo sem flex-grow */
.btn-group > .btn {
  position: relative;
  flex: none;
}

/* ============================================================
   MODAIS
   ============================================================ */

/* Modal do Bootbox acima de todos os outros elementos */
.bootbox.modal {
  z-index: 5005 !important;
  backdrop-filter: blur(0.19rem) grayscale(0.7);
}

/* Sombra azul escura no contorno dos modais */
.modal-content {
  box-shadow: 0rem 0rem 0.25rem 0.06rem var(--bs-blue-dark);
}

/* Modal redimensionável pelo usuário */
.resize {
  resize: both;
  overflow: auto;
  max-width: 95vw;
  max-height: 85vh;
}

/* ============================================================
   TOASTS — Notificações temporárias (canto inferior direito)
   ============================================================ */

#toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1055;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Animação de entrada: expande da direita para a esquerda */
.toast {
  opacity: 0;
  transform: scaleX(0);
  transform-origin: right;
  transition:
    transform 0.4s ease-out,
    opacity 0.6s ease-out;
  display: block;
  min-width: 15.63rem;
  max-width: 21.88rem;
  border-radius: 0.25rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
}

/* Mantém visível mesmo quando não tem classe .show (overrides Bootstrap) */
.toast:not(.show) {
  display: block !important;
}

/* Estado animado — visível e expandido */
.toast.toast-animar {
  opacity: 1;
  transform: scaleX(1);
}

.toast .toast-header {
  border-bottom: 0.06rem solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 0.75rem;
}

/* Cor do header por tipo de toast */
.toast.bg-success .toast-header {
  color: #198754;
}
.toast.bg-danger .toast-header {
  color: #dc3545;
}

.toast .toast-body {
  padding: 0.75rem;
}
.toast .btn-close {
  filter: invert(1);
}

/* ============================================================
   BLOQUEIO DE TELA — Overlay de loading/processamento
   Exibido durante operações assíncronas para bloquear a UI.
   ============================================================ */

#bloqueiaTela {
  position: fixed;
  inset: 0;
  display: block;
  z-index: 105000;
}

/* Fundo gradiente semitransparente */
#bloqueiaTela .overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    farthest-side at 50% 50%,
    #ffffff,
    rgba(20, 62, 201, 0.5)
  );
  opacity: 0.7;
}

/* Mensagem de processamento centralizada sobre o overlay */
.msgprocessando {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 105010;
  color: var(--bs-blue-dark);
}

/* ============================================================
   TOOLTIP (MDB / Bootstrap)
   ============================================================ */

/* Tooltip claro com borda escura — contrasta em qualquer fundo */
.tooltip > .tooltip-inner {
  background-color: var(--bs-white);
  border: 0.06rem solid var(--bs-dark);
  color: var(--bs-dark);
  box-shadow: 0.13rem 0.13rem 0.19rem 0.19rem var(--bs-secondary);
  opacity: 0.95;
  text-align: start;
  min-width: 10ch;
  max-width: 80ch;
  width: auto;
}

/* ============================================================
   SCROLLBAR PERSONALIZADO — Estilo azul escuro do sistema
   ============================================================ */

::-webkit-scrollbar {
  width: 0.75rem;
}

::-webkit-scrollbar-track {
  box-shadow: inset 0 0 0.31rem #00017f;
  border-radius: 0.44rem;
}

::-webkit-scrollbar-thumb {
  background: #00017f;
  border-radius: 0.44rem;
  box-shadow: inset 0 0 0.31rem white;
}

::-webkit-scrollbar-thumb:hover {
  background: #00017f;
}

/* ============================================================
   ACCORDION
   ============================================================ */

/* Cabeçalho do accordion de produtos em azul escuro */
#accProdutos .accordion-button {
  color: var(--bs-white) !important;
  font-weight: bolder;
  padding-right: 2rem;
  border-radius: 0.875rem 0.875rem 0 0;
  background-color: var(--bs-blue-dark) !important;
  box-shadow: inset 0 calc(-1 * var(--bs-accordion-border-width)) 0
    var(--bs-accordion-border-color) #dee2e6;
}

.accordion-body,
.accordion-collapse {
  border-radius: 0 0 0.875rem 0.875rem !important;
}

/* ============================================================
   COLLAPSE INLINE — Variante que preserva display inline-block
   Usada no perfil de usuário (colapso horizontal, não vertical)
   ============================================================ */

.collapse-perfil.collapse {
  display: inline-block;
}
.collapse-perfil.collapse:not(.show) {
  display: none;
}
.collapse-perfil.collapsing {
  display: inline-block;
}

/* ============================================================
   UTILITÁRIOS — Classes auxiliares diversas
   ============================================================ */

/* Ocultar elemento */
.esconder {
  display: none;
}

/* Espaçamento vertical reduzido */
.py-15 {
  padding-top: 0.15rem !important;
  padding-bottom: 0.15rem !important;
}

/* Larguras percentuais complementares */
.w-90 {
  width: 90% !important;
}
.w-10 {
  width: 10% !important;
}

/* Texto em colunas verticais (para tabelas com muitas colunas) */
.textovertical {
  width: 0.06rem;
  word-wrap: break-word;
  font-family: monospace;
  white-space: pre-wrap;
}

/* Sublinhado lateral colorido — hierarquia visual dentro de seções */
.subline {
  margin-top: -0.875rem;
  height: 1.13rem;
  margin-left: 0.44rem;
  border-left: 0.19rem solid rgba(var(--bs-primary-rgb));
  border-bottom: 0.13rem solid rgba(var(--bs-primary-rgb));
  padding-left: 0.38rem;
  color: rgba(var(--bs-primary-rgb));
}

/* Badge de validação de aba */
.valid-tab {
  transform: translate(-100%, 15%) !important;
}

/* Tabela legada com borda inferior */
.table2 {
  transition: all ease 1s;
  border-bottom: 0.15rem solid #ccc;
  width: 100%;
  padding-bottom: 1rem !important;
}

.table2.even {
  background-color: var(--bs-table-striped-bg) !important;
}
/* Fade de Bootstrap — garante opacidade 1 no estado .in */
.fade.in {
  opacity: 1;
}

/* Indicador de servidor (canto inferior) */
i w #stat_server {
  position: absolute;
  float: right;
  bottom: 0.19rem;
  right: 2.5rem;
  z-index: 15000;
}

/* Linhas da tabela sem quebra de texto */
table tbody td {
  white-space: nowrap;
}

/* Margem zero nas rows do Bootstrap */
.row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.rotate-90 {
  writing-mode: vertical-rl;
  transform: rotate(-180deg);
  white-space: nowrap;
  height: auto;
  width: 4rem;
  font-size: 0.75rem;
  text-align: left !important;
  align-content: center;
  padding: 0.25rem;
  display: block;
}
