/**
* Template Name: 
* Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
* Updated: Apr 20 2024 with Bootstrap v5.3.3
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
*/

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
:root {
  scroll-behavior: smooth;
  --custom-primary: #f0a500;
  --custom-secondary: #2a2a2a;
  --custom-light-rgb: 35, 35, 35;
  --custom-dark-rgb: 0, 0, 0;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --light-bg: #f8fafc;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  /* V2 Shadcn variables */
  /* Escala de PLANOS do tema claro — mesma regra do escuro: a moldura (barra +
     cabeçalho) recua, a área de trabalho vem à frente dela, o cartão vem à
     frente de tudo.
     A página era #fafafa contra cartão #ffffff: 1,04:1, praticamente a mesma
     cor. O cartão só existia por causa da borda — e tela com brilho alto ou
     baixo contraste come a borda, sobrando um lençol branco. Agora 1,10:1, na
     mesma faixa do escuro (1,18:1). */
  /* Volta ao branco neutro do JURISCOPE. O azulado (#f2f4f9) veio com o
     design system v3; a marca é âmbar sobre cinza neutro, e o tom frio
     brigava com ela. Só o tema CLARO muda — o escuro fica como está. */
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #09090b;
  --muted: #6d6d76;      /* 4,66:1 sobre a pagina nova; #71717a dava 4,39 */
  --muted-light: #a1a1aa;
  --amber: #f0a500;
  --amber-dark: #d49200;
  --amber-light: #fff8eb;
  --amber-rgb: 240, 165, 0;
  --hover-bg: #fefbf3;
  --active-bg: #fff8eb;
  --radius: 6px;
  /* Sidebar (collapsible rail).
     --sidebar-w  = space the layout reserves for the sidebar (content offset).
     --rail-w     = actual width of the .sidebar element.
     --sidebar-expanded = width when pinned / peeked / drawer.
     Collapsed by default: both are the slim rail. Pinned overrides them to the
     expanded width (content shifts). Peek/focus only widen .sidebar (overlay,
     content does NOT shift). Mobile drops --sidebar-w to 0. */
  --sidebar-w: 64px;
  --rail-w: 64px;
  --sidebar-expanded: 264px;
  --header-h: 56px;

  /* ---- pele da barra lateral (tema claro) ----
     A moldura — barra lateral + cabeçalho — volta a ser BRANCA, como era antes
     do layout-v2. O cinza azulado tirava a leveza da tela: com a página em
     #fafafa e os cartões em branco, a moldura era a coisa mais pesada do
     enquadramento e o menu lia como painel de outro sistema. A separação com
     a página passa a ser 1px de --border, não diferença de tom.

     Só as CORES mudam aqui; medida, peso e espaçamento do menu ficam como
     estão. Os tons foram remedidos contra o branco novo, não herdados. */
  --sb-bg: #ffffff;
  --sb-hover: rgba(9, 9, 11, 0.055);
  --sb-active: rgba(9, 9, 11, 0.085);
  --sb-ink: #6d6d76;    /* rótulo ocioso: 5,12:1 sobre a barra branca */
  --sb-label: #71717a;  /* título de seção: apagado, mas ainda 4,83:1 */
  /* Um âmbar só para todo o estado ativo — ícone, rótulo e ponto do submenu.
     Agora ele também é TEXTO, então o limiar é 4,5:1 e não os 3:1 de objeto
     gráfico. E o piso não é o branco: o item ativo tem o véu --sb-active por
     baixo (#eaeaea sobre branco), onde este tom dá 4,70:1. O #d49200 da
     versão antiga dava 2,51:1 e reprovava feio. */
  --sb-accent: #8a5f00;
  --sb-shadow: 0 8px 32px rgba(9, 9, 11, 0.14), 0 1px 3px rgba(9, 9, 11, 0.08);
  --pdf-hover: #dc2626;
  --pdf-hover-bg: rgba(220, 38, 38, 0.08);
  --excel-hover: #059669;
  --excel-hover-bg: rgba(5, 150, 105, 0.08);
}

[data-theme="dark"] {
  /* Escala de PLANOS do tema escuro. A regra é a mesma do tema claro: a
     moldura (barra + cabeçalho) recua, a área de trabalho vem à frente dela e
     o cartão vem à frente de tudo.

     Estava invertido. A página era #09090b — quase preto puro — e a moldura,
     mais CLARA que ela, avançava e disputava atenção com o conteúdo. A tela
     lia como um buraco preto com painéis flutuando. Tirar a área de trabalho
     do preto absoluto é o que conserta; escurecer mais a moldura só juntaria
     as duas numa mancha.

     Luminância: moldura .0048 < página .0081 < cartão .0145/.0185 */
  --bg: #15161a;
  --surface: #1e2026;
  --border: #27272a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --muted-light: #71717a;
  --hover-bg: #27272a;
  --active-bg: rgba(240, 165, 0, 0.1);
  --amber-light: rgba(240, 165, 0, 0.08);
  /* barra lateral no escuro — ver o bloco equivalente no :root claro */
  --sb-bg: #0e0f12;
  --sb-hover: rgba(250, 250, 250, 0.06);
  --sb-active: rgba(250, 250, 250, 0.1);
  --sb-ink: #a1a1aa;    /* 7,26:1 sobre --sb-bg */
  --sb-label: #8f8f99;  /* 5,81:1 — --muted-light dava 3,85:1 e reprovava */
  --sb-accent: #f0a500; /* 8,94:1 */
  --sb-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --light-bg: #09090b;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --pdf-hover: #f87171;
  --pdf-hover-bg: rgba(248, 113, 113, 0.12);
  --excel-hover: #34d399;
  --excel-hover-bg: rgba(52, 211, 153, 0.12);
}

body {
  background: var(--bg);
  font-family: var(--ds-font);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

input:focus,
select:focus:not(.select2-hidden-accessible),
textarea:focus {
  border-color: var(--amber) !important;
  box-shadow: 0 0 0 3px rgba(var(--amber-rgb), 0.12) !important;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

select.select2-hidden-accessible {
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: none !important;
}

/* ===== Global form controls V2 ===== */
.form-control, .form-select,
input[type="text"], input[type="number"], input[type="date"],
input[type="email"], input[type="password"],
select:not(.select2-hidden-accessible),
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

select:not([multiple]):not(.select2-hidden-accessible) {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

/* ===== Global Select2 V2 ===== */
/* Select2 container — invisible wrapper */
.select2-container {
  width: 100% !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.select2-container *:focus,
.select2-container *:focus-visible {
  outline: none !important;
}

.select2-container .selection {
  display: block !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Select2 selection — the only visible box */
.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  min-height: 34px !important;
  font-size: 0.82rem !important;
  background: var(--surface) !important;
  padding: 4px 8px !important;
  box-shadow: none !important;
  outline: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important;
  line-height: 26px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 34px !important;
}
.select2-dropdown {
  background: var(--surface) !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Select2 focus/open — amber border only on selection */
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--amber) !important;
  box-shadow: none !important;
}

/* Select2 search field inside selection — invisible */
.select2-container .select2-search--inline .select2-search__field {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Select2 dropdown highlight */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--amber) !important;
  color: #fff !important;
}

/* Kill any styling on the original select behind Select2 */
select.select2-hidden-accessible,
select.select2-hidden-accessible:focus,
select.select2-hidden-accessible:focus-visible {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  position: absolute !important;
  white-space: nowrap !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--amber-light) !important;
  border: 1px solid rgba(var(--amber-rgb), 0.25) !important;
  color: #92400e !important;
  border-radius: 50px !important;
  font-size: 0.72rem !important;
  padding: 1px 8px !important;
  margin: 2px 4px 2px 0 !important;
  line-height: 1.6 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--amber) !important;
  margin-right: 4px !important;
  font-size: 14px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #dc3545 !important;
}

.select2-container--default .select2-search--inline .select2-search__field {
  font-size: 0.82rem !important;
  font-family: inherit !important;
  color: var(--text) !important;
  margin-top: 2px !important;
}

.select2-container--default .select2-search--inline .select2-search__field::placeholder {
  color: var(--muted-light) !important;
}

.select2-container--default .select2-selection__placeholder {
  color: var(--muted-light) !important;
  font-size: 0.82rem !important;
}

.select2-dropdown {
  border-color: var(--border) !important;
  border-radius: var(--radius) !important;
  z-index: 1070 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
  font-size: 0.82rem !important;
  font-family: 'Inter', sans-serif !important;
}

.select2-container--default .select2-results__option {
  padding: 6px 12px !important;
  font-size: 0.82rem !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--amber) !important;
  color: #fff !important;
}

.select2-container--default .select2-results__option--selected {
  background-color: var(--amber-light) !important;
  color: #92400e !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  font-size: 0.82rem !important;
  font-family: inherit !important;
  padding: 6px 10px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--amber) !important;
  box-shadow: 0 0 0 2px rgba(var(--amber-rgb), 0.1) !important;
  outline: none !important;
}

.select2-hidden-accessible {
  display: none !important;
}

/* ==========================================================================
   Select2 — base global (light + dark). Mantem consistencia em todas as
   paginas, nao so na Prospecao. Variaveis seguem o tema automaticamente.
   ========================================================================== */
.select2-container { width: 100% !important; }

.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  min-height: 42px !important;
  padding: 0.25rem 0.45rem !important;
  font-size: 0.9rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important;
  line-height: 38px !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--amber) !important;
  box-shadow: 0 0 0 3px rgba(var(--amber-rgb), 0.12) !important;
  outline: none !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--amber) !important;
  border: none !important;
  color: #fff !important;
  padding: 2px 9px !important;
  margin: 3px 4px 3px 0 !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #fff !important;
  margin-right: 4px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  border: none !important;
  background: transparent !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: rgba(255, 255, 255, 0.7) !important;
  background: transparent !important;
}

.select2-container--default .select2-selection--multiple .select2-search__field {
  color: var(--text) !important;
  margin-top: 0 !important;
}

.select2-container--default .select2-selection__placeholder,
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder {
  color: var(--muted) !important;
}

/* Layout flex dos pills: o select2 4.0 usa float + nowrap + overflow:hidden
   no container, o que desalinha pills de larguras diferentes e empurra o
   "limpar" para uma linha propria. Flex-wrap resolve o agrupamento e o clear
   sai do fluxo, ancorado no canto. */
.select2-container--default .select2-selection--multiple {
  position: relative !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  padding-right: 22px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-search--inline {
  float: none !important;
}

.select2-container--default .select2-selection__clear {
  position: absolute !important;
  top: 9px !important;
  right: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  color: var(--muted) !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  background: transparent !important;
}

.select2-container--default .select2-selection__clear:hover {
  color: var(--text) !important;
}

.select2-dropdown {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--card-shadow) !important;
  overflow: hidden;
}

.select2-search--dropdown .select2-search__field {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  padding: 6px 10px !important;
}

.select2-container--default .select2-results__option {
  color: var(--text) !important;
  background: var(--surface) !important;
  padding: 8px 12px !important;
  font-size: 0.88rem !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--amber) !important;
  color: #fff !important;
}

.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] {
  background: rgba(var(--amber-rgb), 0.12) !important;
  color: var(--text) !important;
}

[data-theme="dark"] .select2-container--default .select2-results__option--selected,
[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
  background: rgba(var(--amber-rgb), 0.18) !important;
  color: var(--amber) !important;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 2px solid #f0a500;
  outline-offset: 2px;
}

a {
  color: #f0a500;
  text-decoration: none !important;
}

a:hover {
  color: #b86200;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ds-font);
}

/*--------------------------------------------------------------
  # Main
  --------------------------------------------------------------*/
/* .main is defined in the Sidebar V2 section below */

/* responsive .main is defined in Sidebar V2 section */

/*--------------------------------------------------------------
  # Page Title
  --------------------------------------------------------------*/
.pagetitle {
  margin-bottom: 6px;
  margin-top: 0;
  padding-top: 0;
}

.pagetitle h1 {
  font-size: 20px;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

/*--------------------------------------------------------------
  # Back to top button
  --------------------------------------------------------------*/
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 99999;
  background: #f0a500;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: all 0.4s;
}

.back-to-top i {
  font-size: 24px;
  color: #fff;
  line-height: 0;
}

.back-to-top:hover {
  background: #ffac47;
  color: #fff;
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/*--------------------------------------------------------------
  # Override some default Bootstrap stylings
  --------------------------------------------------------------*/
/* Dropdown menus */
.dropdown-menu {
  border-radius: 8px;
  padding: 8px 0;
  animation-name: dropdown-animate;
  animation-duration: 0.2s;
  animation-fill-mode: both;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  color: var(--text);
}

.dropdown-menu .dropdown-header,
.dropdown-menu .dropdown-footer {
  text-align: center;
  font-size: 14px;
  padding: 10px 20px;
  color: var(--muted);
}

.dropdown-menu .dropdown-footer a {
  color: var(--amber);
  text-decoration: none;
}

.dropdown-menu .dropdown-footer a:hover {
  text-decoration: underline;
}

.dropdown-menu .dropdown-divider {
  border-color: var(--border);
  margin: 4px 0;
}

.dropdown-menu .dropdown-item {
  font-size: 0.85rem;
  padding: 8px 16px;
  transition: 0.2s;
  color: var(--text);
}

.dropdown-menu .dropdown-item i {
  margin-right: 10px;
  font-size: 16px;
  line-height: 0;
  color: var(--muted);
}

.dropdown-menu .dropdown-item:hover {
  background-color: var(--hover-bg);
  color: var(--text);
}

@media (min-width: 768px) {
  .dropdown-menu-arrow::before {
    content: "";
    width: 13px;
    height: 13px;
    background: var(--surface);
    position: absolute;
    top: -7px;
    right: 20px;
    transform: rotate(45deg);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
  }
}

@keyframes dropdown-animate {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }

  0% {
    opacity: 0;
  }
}


/* Card */

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: none;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f0a500, #f0a500);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  .card:nth-child(6) {
    animation-delay: 0.6s;
  }
}

.card-header,
.card-footer {
  border-color: var(--border);
  background-color: var(--surface);
  color: var(--muted);
  /* padding: 15px; */
}

.card-title {
  padding: 20px 0 15px 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--ds-font);
}

.card-title span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.card-body {
  padding: 0 20px 20px 20px;
}


.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}


.btn-primary {
  background-color: #f0a500;
  color: #ffffff;
  border: 1px solid #e67a00;
}

.btn-primary:hover {
  background-color: #ffac47;
  border-color: #ffa333;
}

.text-primary {
  color: #f0a500 !important;
}

.btn-primary:disabled,
.btn-primary.disabled {
  background-color: #ffe0b8 !important;
  color: #ffffff !important;
  border: 1px solid #ffd699 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

.btn-check:checked + .btn, .btn.active, .btn.show, .btn:first-child:active, :not(.btn-check) + .btn:active {
  color: white;
  background-color: var(--custom-primary);
  border-color: var(--custom-primary);
}

/* Close Button */
.btn-close {
  background-size: 25%;
}

.btn-close:focus {
  outline: 0;
  box-shadow: none;
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--border);
}

.accordion-button:focus {
  outline: 0;
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  color: var(--text);
  background-color: var(--hover-bg);
}

.accordion-flush .accordion-button {
  padding: 15px 0;
  background: none;
  border: 0;
}

.accordion-flush .accordion-button:not(.collapsed) {
  box-shadow: none;
  color: #f0a500;
}

.accordion-flush .accordion-body {
  padding: 0 0 15px 0;
  color: var(--text);
  font-size: 15px;
}

/* Breadcrumbs */
.breadcrumb {
  font-size: 14px;
  font-family: var(--ds-font);
  color: var(--muted);
  font-weight: 600;
}

.breadcrumb a {
  color: var(--muted);
  transition: 0.3s;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb .breadcrumb-item::before {
  color: var(--muted);
}

.breadcrumb .active {
  color: var(--text);
  font-weight: 600;
}

/*--------------------------------------------------------------
  # Header
  --------------------------------------------------------------*/

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 997;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  /* Mesmo plano da barra lateral, não o dos cartões: cabeçalho e barra são a
     MOLDURA em volta do conteúdo e devem ler como uma peça só. Com --surface
     o topo tinha a cor dos cartões e disputava atenção com eles. */
  background-color: var(--sb-bg);
  padding-left: 20px;
  padding-right: 16px;
  box-shadow: none;
  transition: left 0.2s ease-in-out;
}

.header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

/* Mobile: sidebar is off-canvas (--sidebar-w:0), leave room for the hamburger. */
@media (max-width: 767px) {
  .header { padding-left: 56px; }
}

.header .toggle-sidebar-btn {
  font-size: 32px;
  padding-left: 10px;
  cursor: pointer;
  color: var(--text);
}


/*--------------------------------------------------------------
  # Header Nav
  --------------------------------------------------------------*/
.header-nav ul {
  list-style: none;
}

.header-nav>ul {
  margin: 0;
  padding: 0;
}

.nav-profile img {
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.header-nav .profile {
  min-width: 240px;
  padding-bottom: 0;
  top: 8px !important;
}

.header-nav .profile .dropdown-header h6 {
  font-size: 0.85rem;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--text);
}

.header-nav .profile .dropdown-header span {
  font-size: 0.78rem;
  color: var(--muted);
}

.header-nav .profile .dropdown-item {
  font-size: 0.85rem;
  padding: 10px 16px;
  transition: 0.2s;
  color: var(--text);
}

.header-nav .profile .dropdown-item i {
  margin-right: 10px;
  font-size: 16px;
  line-height: 0;
  color: var(--muted);
}

.header-nav .profile .dropdown-item:hover {
  background-color: var(--hover-bg);
}

/*--------------------------------------------------------------
  # Sidebar V2 — Shadcn Style
  --------------------------------------------------------------*/
.sidebar-logo {
  height: var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 12px;
  /* sem filete sob o logo: na barra do Claude o topo é contínuo, e o traço
     ali cortava a coluna em duas antes mesmo do menu começar */
  margin: 0 -10px 2px;
  flex-shrink: 0;
}

.sidebar-logo a { display: flex; align-items: center; }
.sidebar-logo img { height: 22px; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail-w);
  /* 100vh no iOS conta a barra do navegador e a lateral fica MAIOR que a
     tela — o rodapé (conta) some por baixo. dvh acompanha a barra; o 100vh
     acima fica de reserva para quem não tem dvh. */
  height: 100vh;
  height: 100dvh;
  background: var(--sb-bg);
  border-right: 1px solid var(--border);
  z-index: 1000;
  padding: 0 10px;
  overflow: hidden;
  transition: width 0.2s ease-in-out, transform 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
}

/* nav wrapper is layout-transparent so the ul stays a direct flex child */
.sidebar-nav-region { display: contents; }

/* scrollbar controlado pela .sidebar-nav */

.main {
  position: fixed;
  top: var(--header-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 16px;
  transition: left 0.2s ease-in-out;
}

.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.main::-webkit-scrollbar-track { background: transparent; }

[data-theme="dark"] .main::-webkit-scrollbar-thumb { background: #3f3f46; }

.sidebar-nav {
  padding: 0 0 16px 0;
  margin: 0;
  list-style: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.sidebar-nav:hover {
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: var(--border); }
.sidebar-nav li { padding: 0; margin: 0; list-style: none; }
.sidebar-nav .nav-item { margin-bottom: 2px; }

.sidebar-nav .nav-heading {
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--sb-label);
  font-weight: 500;
  margin: 0;
  padding: 14px 9px 5px;
  white-space: nowrap;
}

/* Item = pílula. Sem borda de nenhum lado: a barra de 3px à esquerda era o
   que mais denunciava "menu de sistema", e ela ainda empurrava o ícone meio
   pixel para o lado a cada troca de estado. */
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--sb-ink);
  padding: 0 9px;
  border-radius: 8px;
  transition: background 0.1s, color 0.1s;
  background: transparent;
}

.sidebar-nav .nav-link i {
  font-size: 15px;
  /* o espaço quem dá é o gap; margem aqui somava e desalinhava o rótulo */
  margin-right: 0;
  color: inherit;
  opacity: 0.85;
  width: 16px;
  text-align: center;
}

.sidebar-nav .nav-link.collapsed {
  color: var(--sb-ink);
  background: transparent;
}

.sidebar-nav .nav-link:hover {
  color: var(--text);
  background: var(--sb-hover);
}

.sidebar-nav .nav-link:hover i { opacity: 1; }

.sidebar-nav .nav-link:not(.collapsed),
.sidebar-nav .nav-link.active {
  color: var(--sb-accent);
  background: var(--sb-active);
  font-weight: 500;
}

/* O âmbar do item ativo pega o rótulo junto com o ícone: só no ícone ele era
   pequeno demais para dizer onde a pessoa está. */
.sidebar-nav .nav-link:not(.collapsed) i,
.sidebar-nav .nav-link.active i { color: var(--sb-accent); opacity: 1; }

/* No celular a barra vira gaveta e o dedo precisa de alvo de 44px. */
@media (max-width: 767px) {
  .sidebar-nav .nav-link { min-height: 44px; }
  .sidebar-nav .nav-content a { min-height: 40px; }
}

.sidebar-nav .nav-link .bi-chevron-down {
  margin-right: 0;
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-light);
  transition: transform 0.2s;
}

.sidebar-nav .nav-link:not(.collapsed) .bi-chevron-down { transform: rotate(180deg); }

/* Submenu preso ao pai por uma guia vertical, em vez de recuo cego: com 38px
   de padding e nada mais, o filho não parecia filho de ninguém. */
.sidebar-nav .nav-content {
  padding: 1px 0 3px 19px;
  margin: 0;
  list-style: none;
  position: relative;
}

.sidebar-nav .nav-content::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 4px;
  bottom: 7px;
  width: 1px;
  background: var(--border);
}

.sidebar-nav .nav-content a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 31px;
  font-size: 13px;
  font-weight: 400;
  color: var(--sb-ink);
  padding: 0 9px;
  border-radius: 8px;
  transition: background 0.1s, color 0.1s;
}

.sidebar-nav .nav-content a:hover { color: var(--text); background: var(--sb-hover); }
.sidebar-nav .nav-content a.active {
  color: var(--sb-accent);
  background: var(--sb-active);
  font-weight: 500;
}

.sidebar-nav .nav-content a i {
  font-size: 6px;
  margin-right: 0;
  line-height: 0;
  border-radius: 50%;
  color: var(--sb-label);
}

.sidebar-nav .nav-content a.active i { background-color: var(--sb-accent); color: var(--sb-accent); }

/* --------------------------------------------------------------
   # Collapsible rail — collapsed / peek / pinned / drawer states
   -------------------------------------------------------------- */

/* Labels fade rather than clip while the rail resizes. */
.sidebar-nav .nav-link span {
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.18s ease;
}
.sidebar-nav .nav-link i { flex-shrink: 0; }

/* Logo row: mark on the left, pin toggle on the right. */
.sidebar-logo { justify-content: space-between; gap: 6px; }
.sidebar-logo-link { overflow: hidden; text-decoration: none; }
/* Collapsed shows the compact mark; expanded shows the original wordmark image. */
/* Uma arte só para os dois estados da barra.
   A imagem é 2513x400 e a marca ocupa x=0..387 dela — medido no arquivo, não
   estimado. Com 26px de altura o conjunto dá 163px de largura e a marca,
   sozinha, 25px. Fechada, a largura da caixa cai para esses 25px e o
   object-fit recorta: a marca fica IDÊNTICA nos dois estados, porque é o
   mesmo pixel.

   `object-position: left` é o que faz o corte pegar a marca e não o meio do
   texto. A largura anima junto com a barra, então o toggle parece a palavra
   se desenrolando ao lado da marca, em vez de uma troca de imagem.

   O seletor precisa dos dois níveis: `.sidebar-logo img` (0,1,1) lá em cima
   fixa height:22px e venceria uma classe sozinha (0,1,0). */
.sidebar-logo .sidebar-logo-img {
  height: 26px;
  width: 163px;
  object-fit: cover;
  object-position: left center;
  flex-shrink: 0;
  max-width: none;
  display: block;
  transition: width 0.17s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-pin {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* fantasma: sem caixa, e só aparece quando o ponteiro está na barra —
     é um controle de quem já está ali, não um botão disputando atenção */
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sb-label);
  cursor: pointer;
  opacity: 0;
  transition: color 0.12s, background 0.12s, opacity 0.12s;
}
.sidebar:hover .sidebar-pin,
.sidebar:focus-within .sidebar-pin,
html.sidebar-pinned .sidebar-pin { opacity: 1; }
.sidebar-pin:focus-visible { opacity: 1; }
.sidebar-pin:hover { color: var(--text); background: var(--sb-hover); }
.sidebar-pin i { font-size: 15px; }
html.sidebar-pinned .sidebar-pin { color: var(--text); }

/* --------------------------------------------------------------
   # Bloco de conta (rodapé da barra)
   Saiu do cabeçalho e desceu para cá: identidade, saldo e sair moram
   junto, e o topo fica só com o que é da PÁGINA. Os ids (#user-balance,
   #themeToggle) vieram inteiros do cabeçalho — main.js os pega por
   getElementById, então mudar de lugar não quebra nada.

   O menu abre para CIMA e cabe dentro da barra (que tem a altura da tela),
   por isso o overflow:hidden da .sidebar não o corta. Enquanto ele está
   aberto o botão segura o foco, e o :focus-within lá embaixo mantém a
   barra expandida — senão o menu abriria sobre um trilho de 64px.
   -------------------------------------------------------------- */
.sidebar-foot { flex-shrink: 0; padding: 6px 0 8px; position: relative; }

/* O menu rola por baixo da conta e era cortado no meio de uma linha — parecia
   quebrado, não rolável. Este esmaecido dissolve o que passa por baixo no
   fundo da barra. Fica no rodapé, não na área de rolagem: máscara no próprio
   contêiner que rola mexe com a barra de rolagem em alguns navegadores. */
.sidebar-foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 20px;
  background: linear-gradient(to top, var(--sb-bg), transparent);
  pointer-events: none;
}

.sidebar-acct {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.sidebar-acct:hover { background: var(--sb-hover); }

/* O caret do Bootstrap (::after) é um triângulo feito de borda e destoa de
   todo o resto, que usa Bootstrap Icons — trocado por um chevron de verdade.
   Aponta para CIMA porque é para lá que o menu abre, e gira ao abrir. */
.sidebar-acct::after { display: none; }

/* --------------------------------------------------------------
   # Botão de tema (cabeçalho e menu da conta)
   Os DOIS ícones ficam no DOM, empilhados na mesma célula de grid, e o
   tema decide qual aparece. Trocar `className` por JS seria instantâneo,
   sem transição possível — e ainda obrigaria o JS a saber de aparência.
   Assim o estado mora inteiro no CSS, vindo do data-theme do <html>, e os
   dois botões acompanham sozinhos, sem risco de um mostrar sol e o outro
   lua. Mostra a LUA no claro: o ícone anuncia para onde o clique leva.
   -------------------------------------------------------------- */
.theme-ico {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
}
.theme-ico i {
  grid-area: 1 / 1;
  transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-ico .bi-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-ico .bi-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-ico .bi-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-ico .bi-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

@media (prefers-reduced-motion: reduce) {
  .theme-ico i { transition: none; }
}

.sidebar-acct-caret {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--sb-label);
  transition: transform 0.16s;
}
.sidebar-acct:hover .sidebar-acct-caret { color: var(--text); }
.sidebar-acct[aria-expanded="true"] .sidebar-acct-caret { transform: rotate(180deg); }

.sidebar-acct-avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ds-border, var(--muted-light));
  background: var(--ds-surface-2, transparent);
  color: var(--ds-text-dim, var(--muted));
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar-acct-who { min-width: 0; flex: 1; overflow: hidden; }
.sidebar-acct-who b {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Abaixo do nome: EMPRESA e PLANO. Saldo não entra aqui — é número que muda o
   dia todo e pertence ao topo, junto das outras métricas. O que identifica a
   conta é de quem ela é e em que plano está.

   A empresa é texto e o plano é pílula, de propósito: são coisas de natureza
   diferente. Empresa é nome próprio, plano é um estado entre poucos possíveis
   — e estado, no resto do sistema, se lê como pílula. */
.sidebar-acct-co {
  display: block;
  font-size: 11px;
  color: var(--sb-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-acct-plan {
  /* .ds-pill já dá forma e cor; aqui só o que é do lugar: caber na coluna
     estreita da barra e não deixar a pílula esticar a caixa inteira. */
  margin-top: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: top;
}

.sidebar-acct-menu {
  width: calc(var(--sidebar-expanded) - 20px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--sb-shadow);
  padding: 5px;
}
.sidebar-acct-menu .dropdown-header { padding: 6px 9px 4px; }
.sidebar-acct-menu .dropdown-header h6 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sb-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-acct-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  color: var(--sb-ink);
  width: 100%;
}
.sidebar-acct-menu .dropdown-item:hover,
.sidebar-acct-menu .dropdown-item:focus {
  background: var(--sb-hover);
  color: var(--text);
}
.sidebar-acct-menu .dropdown-item i { font-size: 15px; width: 16px; text-align: center; }
.sidebar-acct-menu .dropdown-divider { margin: 5px -5px; border-color: var(--border); }

.sidebar-pin:focus-visible,
.sidebar-acct:focus-visible,
.sidebar-toggle-btn:focus-visible,
.sidebar-nav .nav-link:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.sidebar-nav .nav-link:focus-visible { outline-offset: -2px; }

/* ---- COLLAPSED look (slim rail: icons only) ----
   Applies only when none of the expansion states is active. */
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  border-left-width: 0; /* remove the 3px accent bar so the icon centres on a whole pixel */
}
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .nav-link i {
  margin-right: 0;
}
/* Fully remove labels/chevrons/badges from flow so only the icon remains, dead-centred. */
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .nav-link span,
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .nav-link .bi-chevron-down,
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .nav-link .badge {
  display: none;
}
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .nav-content {
  display: none !important;
}
/* Hide the scrollbar when collapsed so it doesn't steal width and push the
   centred icons off-axis (still scrollable by wheel/trackpad). */
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-nav {
  scrollbar-width: none;
}
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}
/* Section headings collapse into a subtle divider line. */
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .nav-heading {
  margin: 12px 10px 8px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  background: var(--border);
}
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-logo { justify-content: center; }
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-pin { display: none; }
/* Fechada: a caixa encolhe para a largura da marca e o object-fit corta o
   resto. Nada de trocar de imagem — e' a mesma. */
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-logo-img { width: 25px; }
/* Conta encolhida: sobra o avatar, centrado no trilho. */
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-acct-who,
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-acct-caret { display: none; }
html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-acct { justify-content: center; padding-left: 0; padding-right: 0; }

/* ---- PEEK / keyboard focus: expand as an OVERLAY (content does not shift) ---- */
html.sidebar-peek .sidebar,
.sidebar:focus-within {
  width: var(--sidebar-expanded);
  z-index: 1045;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.12);
}

/* ---- PINNED: rail joins the layout flow, content shifts (desktop only) ---- */
@media (min-width: 1024px) {
  html.sidebar-pinned {
    --sidebar-w: var(--sidebar-expanded);
    --rail-w: var(--sidebar-expanded);
  }
}

/* Mobile hamburger (only shown < 768px). */
.sidebar-toggle-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.sidebar-toggle-btn i { font-size: 18px; color: var(--text); }

/* Scrim behind the tablet overlay / mobile drawer (JS toggles .is-visible). */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1040;
}
.sidebar-overlay.is-visible { display: block; }

/* Footer tracks the reserved sidebar width in every state. */
#footer.footer { margin-left: var(--sidebar-w); transition: margin-left 0.2s ease-in-out; }

/* Collapsed tooltip (JS-positioned, fixed so the rail overflow can't clip it). */
.sidebar-tooltip {
  position: fixed;
  z-index: 1060;
  transform: translateY(-50%);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: var(--card-shadow);
}
.sidebar-tooltip.is-visible { opacity: 1; }

/* Collapsed submenu flyout (JS-positioned, fixed). */
.sidebar-flyout {
  position: fixed;
  z-index: 1060;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--card-shadow-hover);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.sidebar-flyout.is-visible { opacity: 1; visibility: visible; transform: translateX(0); }
.sidebar-flyout-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-light);
  font-weight: 600;
  padding: 4px 10px 6px;
}
.sidebar-flyout ul { list-style: none; margin: 0; padding: 0; }
.sidebar-flyout li { padding: 0; margin: 0; list-style: none; }
.sidebar-flyout a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: var(--radius);
  text-decoration: none;
}
.sidebar-flyout a:hover { color: var(--text); background: var(--hover-bg); }
.sidebar-flyout a.active { color: var(--amber-dark); background: var(--active-bg); font-weight: 600; }
.sidebar-flyout a:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.sidebar-flyout a i { font-size: 13px; color: var(--muted-light); background: none; border-radius: 0; }
.sidebar-flyout a.active i { color: var(--amber); background: none; }
.sidebar-flyout a .badge { margin-left: auto; }

/* --------------------------------------------------------------
   # Responsive breakpoints
   -------------------------------------------------------------- */

/* Tablet (768–1023px): collapsed rail; the pin button taps open an overlay
   expansion (peek) with a scrim. No hover peek, no pinning. */
@media (min-width: 768px) and (max-width: 1023px) {
  .main { padding: 20px 16px 16px; }
  /* No hover peek at this size, so the rail toggle must stay tappable even
     when collapsed. Hide the wordmark to make room in the 64px rail. */
  html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-pin { display: inline-flex; }
  html:not(.sidebar-pinned):not(.sidebar-peek):not(.drawer-open) .sidebar:not(:focus-within) .sidebar-logo-link { display: none; }
}

/* Laptop (1024–1279px): é a única faixa em que a barra PODE ficar fixada em
   260px sem a tela ser larga. Em 1024 fixada sobram 1024 − 260 − 48 de padding
   = 716px de conteúdo, e é aí que a tabela de 10 colunas passa a rolar dentro
   do cartão. Um degrau a menos de padding devolve 16px de leitura, e só quando
   a barra está fixada — com o rail de 64px o respiro maior continua valendo.
   `html.sidebar-pinned .main` é (0,2,0) e vence `.main` (0,1,0). */
@media (min-width: 1024px) and (max-width: 1279px) {
  html.sidebar-pinned .main { padding-left: 16px; padding-right: 16px; }
}

/* Mobile (< 768px): sidebar becomes an off-canvas drawer. */
@media (max-width: 767px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    z-index: 1045;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.18);
  }
  html.drawer-open .sidebar { transform: translateX(0); }
  .main { padding: 16px 12px 12px; }
  /* Aparece só aqui (nasce display:none). O alvo era ~32px de altura — 6px de
     padding mais 18px de ícone — e é o primeiro toque da tela: é ele que abre
     o menu. inline-flex no lugar de block para centrar o ícone na caixa. */
  .sidebar-toggle-btn {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    top: 6px; left: 6px;
  }
  /* Itens do menu: 13px com 7px de padding dão ~31px. Numa gaveta com 20+
     linhas encostadas uma na outra, é onde mais se erra o toque. */
  .sidebar-nav .nav-link { padding-top: 11px; padding-bottom: 11px; }
  .sidebar-nav .nav-content a { padding-top: 10px; padding-bottom: 10px; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  .sidebar, .main, .header, #footer.footer,
  .sidebar-nav .nav-link span,
  .sidebar-tooltip, .sidebar-flyout,
  .sidebar-nav .nav-link .bi-chevron-down {
    transition: none !important;
  }
}

/* Monitor grande (≥1920) e TV (≥2560).
   NÃO se põe um `max-width` no .main: a maior parte das telas deste sistema é
   dado denso — tabela financeira, kanban, listagem de 12 colunas — e ali
   espremer o conteúdo é pior do que esticá-lo; a coluna extra que cabe em
   1920px é informação que a pessoa deixa de rolar para ver. O que uma tela
   larga deve dar é RESPIRO, e é isso que o padding lateral crescente faz:
   48px em 1920, 64px em 2560, com teto para não virar uma faixa vazia.

   O teto de LINHA (largura de leitura) fica onde a tela é de texto ou de
   formulário, e por isso mora no CSS de cada uma: .legal-wrap (780px),
   .ntf-page (780px), .bus-wrap (1100px), .pm-wrap (1400px), .auth-shell
   (1680px). Ali a linha longa atrapalha; na tabela, não.

   O `!important` que estava aqui era desnecessário: esta regra vem depois das
   outras três de `.main` e tem a mesma especificidade — vence por ordem. */
@media (min-width: 1920px) {
  .main { padding: 14px clamp(30px, 2.5vw, 64px); }
}

/* Legacy dashboard styles removed — V2 KPI cards and global table styles apply */


/* Tabela */

.dt-container {
  padding: 10px 20px 20px 20px !important;
}

.table-dashboard {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}


/* Centraliza a paginação */
.dt-paging ul.pagination {
  display: flex;
  justify-content: center;
  padding-left: 0;
  list-style: none;
  margin-top: 10px;
}

/* Estiliza os botões de paginação */
.dt-paging ul.pagination li.page-item button.page-link {
  background-color: transparent;
  color: var(--text);
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
}

/* Botão ativo (número selecionado) */
.dt-paging ul.pagination li.page-item.active button.page-link {
  background-color: var(--amber);
  color: #fff;
  border-radius: 6px;
  font-weight: bold;
  padding: 10px 18px;
  cursor: default;
}

/* Setas de navegacao — esconde texto nativo e usa SVG inline via CSS */
.dt-paging .page-link.previous,
.dt-paging .page-link.next,
.dt-paging ul.pagination li.page-item button.page-link.previous,
.dt-paging ul.pagination li.page-item button.page-link.next {
  font-size: 0 !important;
  color: transparent !important;
  position: relative;
}

.dt-paging .page-link.previous::after,
.dt-paging ul.pagination li.page-item button.page-link.previous::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  background-color: var(--muted);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.15s;
}

.dt-paging .page-link.next::after,
.dt-paging ul.pagination li.page-item button.page-link.next::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  background-color: var(--muted);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.15s;
}

.dt-paging .page-link.previous:hover::after,
.dt-paging .page-link.next:hover::after,
.dt-paging ul.pagination li.page-item button.page-link.previous:hover::after,
.dt-paging ul.pagination li.page-item button.page-link.next:hover::after {
  background-color: var(--amber);
}

.dt-paging .page-item.disabled .page-link.previous::after,
.dt-paging .page-item.disabled .page-link.next::after,
.dt-paging ul.pagination li.page-item.disabled button.page-link.previous::after,
.dt-paging ul.pagination li.page-item.disabled button.page-link.next::after {
  background-color: var(--muted-light);
  opacity: 0.4;
}

/* Estilo de hover nos botões */
.dt-paging ul.pagination li.page-item button.page-link:hover {
  background-color: var(--hover-bg);
  border-radius: 4px;
  padding: 8px 16px;
}

/* Remove espaços entre os botões */
.dt-paging ul.pagination li.page-item {
  margin: 0 4px;
}

/* Legacy table-dashboard removed — V2 global styles apply */


/*--------------------------------------------------------------
  # Footer
  --------------------------------------------------------------*/
.footer {
  padding: 20px 0;
  font-size: 14px;
  transition: all 0.3s;
  border-top: 1px solid var(--border);
}


.btn.btn-primary:hover {
  background-color: #e56b0f;
  color: #ffffff;
}

.btn.btn-primary:active {
  background-color: #c65305;
}

.btn-sm:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

.btn-sm i {
  font-size: 0.9rem;
}

.btn.btn-info {
  background-color: #0d6efd;
  border-color: #0b5ed7;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out, transform 0.2s ease;
}

.btn.btn-info:hover {
  background-color: #0b5ed7;
  /* Slightly darker blue on hover */
  transform: scale(1.05);
  /* Subtle zoom effect */
}

.btn.btn-info:active {
  background-color: #0a58ca;
  /* Even darker when clicked */
  transform: scale(0.95);
  /* Slight press-down effect */
}

.btn.btn-secondary {
  background-color: #495057;
  border-color: #343a40;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out, transform 0.2s ease;
}

.btn.btn-secondary:hover {
  background-color: #6c757d;
  color: #ffffff;
}

.btn.btn-secondary:active {
  background-color: #6c757d;
  transform: scale(0.95);
}


/* Estilização geral do container de filtros */
.row.align-items-center.custom {
  background-color: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Alinhamento e espaçamento entre os campos de filtro */

.modern-modal {
  border-radius: 16px;
  box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.15);
  background: var(--surface);
  padding: 20px;
  border: none;
}

.header-badge {
  background: var(--hover-bg);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  display: inline-block;
  margin: auto;
}

.modern-modal .modal-title {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 5px;
}

.modal-description {
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
}

.card-section {
  background: var(--hover-bg);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.card-section h6 {
  font-size: 1rem;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 15px;
}

.modern-modal .form-control {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 0.95rem;
  transition: 0.2s;
}

.modern-modal .form-control:focus {
  border-color: #ff8800;
  box-shadow: 0 0 8px rgba(255, 174, 0, 0.3);
}

.input-group-text {
  padding: 0.275rem 0.55rem !important;
}

div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm) {
  background-color: #f0a500 !important;
}

.tooltip-inner {
  background-color: black !important;
  color: white !important;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 5px;
  text-align: center;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: black !important;
}

#filterPanel .card-body {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.08);
}

.form-control-sm,
.form-select-sm {
  font-size: 14px;
  border-radius: 6px;
}

#applyFilters {
  background-color: #ff8500;
  border-color: #ff8500;
  color: white;
}

#applyFilters:hover {
  background-color: #e67300;
}

#clearFilters {
  color: var(--muted);
  border-color: var(--border);
}

#clearFilters:hover {
  background-color: var(--hover-bg);
}

.btn-outline-secondary:hover {
  background-color: var(--hover-bg);
  color: var(--text);
}

#filterPanel .text-end {
  margin-top: 12px;
}

#add-to-leads,
#filter-btn {
  font-size: 14px;
  padding: 4px 11px;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

#add-to-leads:disabled {
  background-color: var(--hover-bg);
  color: var(--muted-light);
  border-color: var(--border);
  cursor: not-allowed;
}

#filter-btn {
  color: var(--muted);
  border-color: var(--border);
}

#filter-btn:hover {
  background-color: var(--hover-bg);
  color: var(--text);
}

.btn-success {
  background-color: #5cb85c;
  border-color: #4cae4c;
  color: white;
  font-weight: bold;
  border-radius: 6px;
  padding: 8px 14px !important;
}

.btn-success:disabled {
  background-color: var(--border);
  cursor: not-allowed;
}

.btn-success:hover {
  background-color: #218838;
}


.btn {
  transition: all 0.3s ease-in-out;
  padding: 6px 10px !important;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.btn:hover,
.btn:focus {
  filter: brightness(1.1);
}

.btn-outline-primary {
  color: #f7981d;
  border-color: #f7981d;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: #f7981d;
  color: white;
  border-color: #d47b10;
}

.btn-outline-secondary {
  color: var(--muted);
  border-color: var(--border);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: var(--hover-bg);
  color: var(--text);
}

.btn-danger {
  background-color: #dc3545;
  border: none;
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #c82333;
}

.btn-primary {
  background-color: #f7981d;
  border: none;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #d47b10;
}

select {
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: var(--surface);
}

select:hover,
select:focus {
  border-color: #f0a500;
  box-shadow: 0 0 5px rgba(253, 126, 20, 0.5);
}

.form-control::placeholder,
.form-select::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--muted) !important;
  opacity: 1 !important;
}

/* Caixa de seleção de TODO o sistema (`appearance: none` desenha a nossa).
   Dois agentes acharam os mesmos dois defeitos aqui, em telas diferentes:

   1. A borda usava --border: 1,23:1 no claro e 1,05:1 no ESCURO, onde a caixa
      simplesmente sumia — sobrava o rótulo solto. Controle de formulário é
      objeto gráfico e a WCAG 1.4.11 cobra 3:1. --ds-border-field existe para
      isso e foi medido nos dois temas (3,72:1 / 3,71:1).

   2. O ✓ era branco sobre âmbar: 2,08:1. É exatamente o defeito que o
      --ds-on-brand corrigiu nos botões primários, sobrevivendo aqui porque
      esta regra é anterior ao design system. Tinta escura sobre âmbar dá
      8,51:1.

   O âmbar também era #f0a500 cravado; passa a vir do token. */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ds-border-field, var(--border));
  border-radius: 4px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

input[type="checkbox"]:checked {
  background-color: var(--amber);
  border-color: var(--amber);
  color: var(--ds-on-brand, #141824);
}

input[type="checkbox"]:checked::after {
  content: "\2713";
  color: var(--ds-on-brand, #141824);
  font-size: 14px;
  font-weight: 700;
  display: block;
  text-align: center;
  line-height: 18px;
}

input[type="radio"] {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 50%;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

input[type="radio"]:checked {
  background-color: #f0a500;
  border-color: #f0a500;
  color: #fff;
}

input[type="radio"]:hover {
  border-color: #f0a500;
}


.form-select,
.form-control {
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Saldo no cabeçalho. Era 16px em negrito com uma moeda âmbar de 20px ao lado
   — no cabeçalho de um sistema aquilo gritava, e âmbar aqui não é status nem
   alerta, é só um número que muda o dia todo. Vira uma pílula quieta: borda
   discreta, algarismos tabulares (senão a largura pula a cada atualização) e
   a unidade em tom apagado, porque quem lê já sabe que é crédito.
   A moeda saiu do template; as regras que a pintavam foram junto. */
.credit-container {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.credit-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}


.historico-card {
  border-left: 4px solid #007bff;
  background: var(--hover-bg);
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.historico-card strong {
  font-weight: bold;
}

.historico-card .text-muted {
  font-size: 12px;
  display: block;
  margin-top: 5px;
}

.nav-tabs .nav-link.active {
  background-color: transparent;
  color: #f0a500;
  border-bottom: 3px solid #f0a500;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 0;
  color: var(--muted);
}

.bg-light {
  background-color: rgba(var(--custom-light-rgb), 1) !important;
}

.bg-dark {
  background-color: rgba(var(--custom-dark-rgb), 1) !important;
}

.bg-primary {
  background-color: var(--custom-primary) !important;
}

.bg-secondary {
  background-color: var(--custom-secondary) !important;
}


.value-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
  height: 100%;
}

.value-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--custom-primary);
}

.value-card.readonly {
  background: var(--hover-bg);
  border-color: var(--custom-secondary);
}

.value-card.readonly:hover {
  border-color: var(--success-color);
}


.input-group .input-group-text {
  background: var(--custom-primary);
  color: white;
  border: 2px solid var(--custom-primary);
  border-radius: 12px 0 0 12px;
  font-weight: 600;
}

.input-group .form-control {
  border-left: none;
  border-radius: 0 12px 12px 0;
}


.invalid-feedback {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--danger-color);
}

@media (max-width: 768px) {
  .main-card {
    padding: 1rem;
    border-radius: 16px;
  }

  .value-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .card-value {
    font-size: 1.5rem;
  }

  .container-fluid {
    padding: 1rem 0.5rem;
  }
}

@media (max-width: 576px) {
  .card-value {
    font-size: 1.25rem;
  }
}

/*--------------------------------------------------------------
  # Global DataTable V2
  --------------------------------------------------------------*/
.table thead th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  white-space: nowrap;
  border-bottom: 2px solid var(--amber);
  border-top: 1px solid var(--border);
}

.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.table tbody tr:nth-child(even) { background: var(--bg); }

.table tbody tr:hover {
  background: var(--hover-bg);
  box-shadow: inset 3px 0 0 var(--amber);
}

.table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  font-size: 0.82rem;
  color: var(--text);
}

div.dt-processing { display: none !important; }

.dt-paging .page-item .page-link {
  color: var(--muted);
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  margin: 0 2px;
  background: var(--surface);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.dt-paging .page-item .page-link:hover {
  background: var(--amber-light);
  color: var(--amber);
  border-color: var(--amber);
}

.dt-paging .page-item.active .page-link {
  background-color: var(--amber);
  border-color: var(--amber);
  color: #fff;
}

.dt-paging .page-item.disabled .page-link {
  color: var(--muted-light);
  background: var(--surface);
  border-color: var(--border);
  opacity: 0.5;
  cursor: not-allowed;
}


.dt-info { font-size: 0.8rem; color: var(--muted); }

.dt-length {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.dt-length select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  height: 30px;
}

.dt-layout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

/*--------------------------------------------------------------
  # Global Modal V2
  --------------------------------------------------------------*/
.modal {
  z-index: 1060 !important;
}

.modal-backdrop {
  z-index: 1059 !important;
}

.modal-backdrop.show {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 1 !important;
}

[data-theme="dark"] .modal-backdrop.show {
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  font-family: 'Inter', sans-serif;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}


.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  background: var(--surface);
  border-radius: 12px 12px 0 0;
}

.modal-header .modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.modal-header .btn-close {
  opacity: 0.5;
}

.modal-header .btn-close:hover { opacity: 1; }

.modal-body {
  padding: 16px 20px;
  color: var(--text);
  font-size: 0.85rem;
  overflow-y: auto;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  background: var(--surface);
  border-radius: 0 0 12px 12px;
}

.modal-footer .btn-primary,
.modal-footer .btn-success {
  background: var(--amber) !important;
  border-color: var(--amber) !important;
  color: #fff !important;
  font-weight: 500;
  font-size: 0.82rem;
  border-radius: var(--radius);
  padding: 6px 16px;
}

.modal-footer .btn-primary:hover,
.modal-footer .btn-success:hover {
  background: var(--amber-dark) !important;
  border-color: var(--amber-dark) !important;
}

.modal-footer .btn-secondary,
.modal-footer .btn-outline-secondary {
  font-size: 0.82rem;
  border-radius: var(--radius);
  padding: 6px 16px;
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface);
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-outline-secondary:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.modal .btn-outline-primary {
  color: var(--amber);
  border-color: var(--amber);
  font-size: 0.82rem;
  border-radius: var(--radius);
}

.modal .btn-outline-primary:hover {
  background: var(--amber);
  color: #fff;
}

.modal .btn-outline-secondary {
  font-size: 0.82rem;
  border-radius: var(--radius);
  border-color: var(--border);
  color: var(--muted);
}

.modal .btn-outline-secondary:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.modal .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.modal .form-control,
.modal .form-select {
  font-size: 0.82rem;
  border-radius: var(--radius);
  border-color: var(--border);
}

.modal .spinner-border {
  color: var(--amber) !important;
}

.modal .badge.bg-primary {
  background: var(--amber) !important;
}

.modal .badge.bg-success {
  background: #059669 !important;
}

.modal .list-group-item {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.12s;
}

.modal .list-group-item:hover {
  background: var(--hover-bg);
}

.modal .list-group-item:last-child {
  border-bottom: none;
}

.modal .form-check-input:checked {
  background-color: var(--amber);
  border-color: var(--amber);
}

.modal .form-check-input:focus {
  box-shadow: 0 0 0 2px rgba(var(--amber-rgb), 0.2);
  border-color: var(--amber);
}

.modal .input-group-text {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

/* Modal dark mode */
[data-theme="dark"] .modal-content {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .modal-header {
  background: var(--surface);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .modal-footer {
  background: var(--surface);
  border-top-color: var(--border);
}


[data-theme="dark"] .modal .list-group-item {
  background: var(--surface);
  color: var(--text);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .modal .input-group-text {
  background: var(--bg);
  border-color: var(--border);
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0,0,0,0.6);
}

/*--------------------------------------------------------------
  # Dark Mode Toggle Button
  --------------------------------------------------------------*/
.btn-theme-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s;
  margin-right: 8px;
}

.btn-theme-toggle:hover {
  background: var(--hover-bg);
  color: var(--text);
}

/*--------------------------------------------------------------
  # Dark Mode Overrides
  --------------------------------------------------------------*/
/* Igual ao caso da .sidebar logo abaixo: esta regra pintava com --surface e
   vencia por especificidade, anulando o --sb-bg no escuro. Sobra a borda. */
[data-theme="dark"] .header {
  border-bottom-color: var(--border);
}

/* A cor da barra vem de --sb-bg, que já tem valor próprio por tema lá em cima.
   Esta regra pintava com --surface e, por ter especificidade (0,2,0) contra os
   (0,1,0) de `.sidebar`, VENCIA — no escuro o --sb-bg era ignorado por
   completo e a barra saía com a mesma cor dos cartões. Ficou só a borda, que
   é o que esta regra realmente precisava ajustar. */
[data-theme="dark"] .sidebar {
  border-right-color: var(--border);
}

[data-theme="dark"] .main {
  background: var(--bg);
}

.app-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding: 14px 0 6px;
  margin-top: 40px;
  font-size: 0.71rem;
  color: var(--muted-light);
  letter-spacing: 0.2px;
}

.app-footer-brand {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}

.app-footer-brand-main {
  color: var(--text);
}

.app-footer-brand-accent {
  color: var(--amber);
}

.app-footer-sep {
  color: var(--border);
}

[data-theme="dark"] .app-footer {
  border-top-color: var(--border);
  color: var(--muted-light);
}

[data-theme="dark"] .dropdown-menu {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .dropdown-item {
  color: var(--text);
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .modal-content {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .table {
  color: var(--text);
  --bs-table-bg: var(--bg);
  --bs-table-color: var(--text);
  --bs-table-striped-bg: var(--surface);
  --bs-table-hover-bg: var(--hover-bg);
  --bs-table-border-color: var(--border);
}

[data-theme="dark"] .table thead th {
  background: var(--surface) !important;
  color: var(--muted) !important;
  border-color: var(--border);
}

[data-theme="dark"] .table tbody tr {
  background: var(--bg);
  border-color: var(--border);
}

[data-theme="dark"] .table tbody tr:nth-child(even) {
  background: var(--surface);
}

[data-theme="dark"] .table tbody td {
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .dt-paging .page-link {
  background: var(--surface);
  border-color: var(--border);
  color: var(--amber);
}

[data-theme="dark"] .dt-paging .page-link:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .dt-paging .page-item.active .page-link {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}

[data-theme="dark"] .dt-paging .page-item.disabled .page-link {
  background: var(--bg);
  border-color: var(--border);
  color: var(--muted-light);
}

[data-theme="dark"] .card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .partes-page .partes-filter-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .partes-page .partes-table-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .text-muted {
  color: var(--muted) !important;
}

[data-theme="dark"] .pagetitle h1 {
  color: var(--text);
}

[data-theme="dark"] .breadcrumb a,
[data-theme="dark"] .breadcrumb {
  color: var(--muted);
}

/*--------------------------------------------------------------
  # V2 Design System — Global Components
  --------------------------------------------------------------*/

/* Page Header */
.v2-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 0 0 16px 0;
}

.v2-page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  margin: 0;
}

.v2-page-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.v2-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Cards */
.v2-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.v2-card-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.v2-card-body { padding: 20px; }

.v2-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.v2-table-card .table { margin-bottom: 0; }
.v2-table-wrap { overflow-x: auto; }
.v2-table-card .dt-length { padding: 12px 16px; }
.v2-kpi-delta { font-size: 0.78rem; font-weight: 600; margin-top: 2px; }
td.dt-empty {
  text-align: center !important; padding: 48px 20px !important;
  color: var(--muted); font-size: 13px; border: none !important;
}
.dt-no-data thead { display: none !important; }
.dt-no-data .dt-length,
.dt-no-data .dataTables_length,
.dt-no-data .dt-paging,
.dt-no-data .dataTables_paginate { display: none !important; }
.dt-no-data .v2-table-wrap,
.dt-no-data .partes-table-wrap,
.dt-no-data .table-responsive { overflow-x: hidden !important; }
.dt-no-data .dt-info,
.dt-no-data [id$="_info"],
.dt-no-data table,
.dt-no-data .table { display: none !important; }
.dt-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 20px; color: var(--muted); gap: 12px;
}
.dt-empty-state i { font-size: 40px; opacity: 0.3; }
.dt-empty-state span { font-size: 13px; font-weight: 500; }

/* Buttons */
.v2-btn-primary {
  background: var(--amber) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius) !important;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.v2-btn-primary:hover {
  background: var(--amber-dark) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--amber-rgb), 0.3);
}

.v2-btn-ghost {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.v2-btn-ghost:hover {
  background: var(--hover-bg) !important;
  color: var(--text) !important;
}

.v2-btn-danger {
  background: transparent !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  border-radius: var(--radius) !important;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.v2-btn-danger:hover {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
}

[data-theme="dark"] .v2-btn-danger:hover {
  background: rgba(220, 38, 38, 0.1) !important;
}

/* Badges */
.v2-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-block;
}

.v2-badge-alimentar { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.v2-badge-comum { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.v2-badge-indenizatoria { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.v2-badge-remuneratoria { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }
.v2-badge-default { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.v2-badge-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.v2-badge-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.v2-badge-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.v2-badge-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

[data-theme="dark"] .v2-badge-alimentar { background: rgba(5,150,105,0.15); color: #34d399; border-color: rgba(52,211,153,0.3); }
[data-theme="dark"] .v2-badge-comum { background: rgba(37,99,235,0.15); color: #60a5fa; border-color: rgba(96,165,250,0.3); }
[data-theme="dark"] .v2-badge-indenizatoria { background: rgba(240,165,0,0.12); color: #fbbf24; border-color: rgba(251,191,36,0.3); }
[data-theme="dark"] .v2-badge-remuneratoria { background: rgba(157,23,77,0.15); color: #f472b6; border-color: rgba(244,114,182,0.3); }
[data-theme="dark"] .v2-badge-default { background: rgba(55,65,81,0.3); color: #9ca3af; border-color: rgba(156,163,175,0.3); }
[data-theme="dark"] .v2-badge-success { background: rgba(5,150,105,0.15); color: #34d399; border-color: rgba(52,211,153,0.3); }
[data-theme="dark"] .v2-badge-warning { background: rgba(240,165,0,0.12); color: #fbbf24; border-color: rgba(251,191,36,0.3); }
[data-theme="dark"] .v2-badge-danger { background: rgba(220,38,38,0.15); color: #f87171; border-color: rgba(248,113,113,0.3); }
[data-theme="dark"] .v2-badge-info { background: rgba(37,99,235,0.15); color: #60a5fa; border-color: rgba(96,165,250,0.3); }

/* Section Title */
.v2-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-light);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Column Utilities */
.v2-col-name { font-weight: 600; color: var(--text); }
.partes-col-name-link { font-weight: 600; color: var(--text); text-decoration: none; transition: color 0.15s; }
.partes-col-name-link:hover { color: var(--primary, #f0a500); }
.v2-col-doc { font-family: 'SF Mono','Fira Code',monospace; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.3px; }
.v2-col-valor { font-family: 'Inter',-apple-system,sans-serif; font-size: 0.8rem; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; color: var(--text); }
.v2-text-null { color: var(--muted-light); }

/* Action Icon */
.v2-action-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius); color: var(--muted); font-size: 13px;
  cursor: pointer; transition: all 0.15s;
  background: transparent; border: none;
}

.v2-action-icon:hover { color: var(--amber); background: var(--hover-bg); }

/* Empty State */
.v2-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
}

.v2-empty-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--amber-light);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}

.v2-empty-icon i { font-size: 1.3rem; color: var(--amber); }
.v2-empty-state h5 { color: var(--text); font-weight: 700; font-size: 1rem; margin-bottom: 0.3rem; }
.v2-empty-state p { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }

/* Skeleton Shimmer */
@keyframes v2-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.v2-skeleton {
  height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, var(--hover-bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: v2-shimmer 1.5s infinite ease-in-out;
}

/* KPI Card */
.v2-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s;
}

.v2-kpi-card:hover {
  border-color: rgba(var(--amber-rgb), 0.3);
  box-shadow: 0 2px 8px rgba(var(--amber-rgb), 0.08);
}

.v2-kpi-title {
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--muted); margin-bottom: 8px;
}

.v2-kpi-value {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums;
}

.v2-kpi-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-bottom: 8px;
}

.v2-kpi-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.v2-kpi-footer {
  margin-top: 8px;
  font-size: 0.72rem;
}

.v2-kpi-card--amber {
  background: var(--amber);
  border-color: var(--amber-dark);
}

.v2-kpi-card--amber .v2-kpi-title {
  color: rgba(255, 255, 255, 0.85);
}

.v2-kpi-card--amber .v2-kpi-value {
  color: #fff;
}

.v2-kpi-card--amber:hover {
  border-color: var(--amber-dark);
  box-shadow: 0 4px 12px rgba(var(--amber-rgb), 0.3);
}

[data-theme="dark"] .v2-kpi-card--amber {
  background: rgba(var(--amber-rgb), 0.2);
  border-color: rgba(var(--amber-rgb), 0.4);
}

[data-theme="dark"] .v2-kpi-card--amber .v2-kpi-title {
  color: var(--amber);
}

[data-theme="dark"] .v2-kpi-card--amber .v2-kpi-value {
  color: var(--amber);
}

.v2-kpi-value--success {
  color: var(--success-color);
}

[data-theme="dark"] .v2-kpi-value--success {
  color: #34d399;
}

/* Calculator Info Table */
.calc-info-table { border: none; }
.calc-info-table thead th { border-bottom: none; }
.calc-info-table tbody tr { border-bottom: 1px solid var(--border); }
.calc-info-table tbody tr:last-child { border-bottom: none; }
.calc-info-table tbody tr:nth-child(even) { background: transparent; }
.calc-info-table tbody tr:hover { background: transparent; box-shadow: none; }
.calc-info-table td { padding: 8px 0; border: none; font-size: 0.82rem; }

.v2-calc-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  width: 1%;
  padding-right: 16px !important;
}

/* Export Buttons */
.v2-btn-export {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 16px;
  transition: all 0.15s;
}
.v2-btn-export:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(var(--amber-rgb), 0.06);
}
#btnPdf.v2-btn-export:hover {
  border-color: var(--pdf-hover);
  color: var(--pdf-hover);
  background: var(--pdf-hover-bg);
}
#btnExcel.v2-btn-export:hover {
  border-color: var(--excel-hover);
  color: var(--excel-hover);
  background: var(--excel-hover-bg);
}

/* Calculator Periods Accordion */
#periodosAccordion .accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px) !important;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--surface);
}
#periodosAccordion .accordion-item:last-child { margin-bottom: 0; }
#periodosAccordion .accordion-button {
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  padding: 14px 20px;
  border: none;
  box-shadow: none !important;
}
#periodosAccordion .accordion-button:not(.collapsed) {
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
#periodosAccordion .accordion-button::after {
  filter: none;
  background-size: 14px;
}
[data-theme="dark"] #periodosAccordion .accordion-button::after {
  filter: invert(1);
}

/* Filter Card */
.v2-filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Tabs V2 */
.v2-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.v2-tab {
  padding: 10px 16px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--muted);
  border: none; background: transparent;
  cursor: pointer; transition: all 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.v2-tab:hover { color: var(--text); }
.v2-tab.active { color: var(--amber); border-bottom-color: var(--amber); font-weight: 600; }

/* Filter Row */
.v2-filter-row {
  display: flex; align-items: flex-end; gap: 12px;
  padding: 16px 20px; flex-wrap: wrap;
}

.v2-filter-group {
  display: flex; flex-direction: column; gap: 3px;
}

.v2-filter-label {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
}

.v2-filter-input {
  height: 34px; padding: 0 10px;
  font-size: 0.82rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  color: var(--text); transition: border-color 0.2s, box-shadow 0.2s;
}

.v2-filter-input:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(var(--amber-rgb), 0.12);
}

/* Status dot */
.v2-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 6px;
}

/* Period Tabs (chart filters) */
.v2-period-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.v2-period-tab {
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  height: 30px;
}

.v2-period-tab:last-child { border-right: none; }

.v2-period-tab:hover {
  color: var(--text);
  background: var(--hover-bg);
}

.v2-period-tab.active {
  background: var(--amber);
  color: #fff;
}

.v2-status-dot-success { background: #059669; }
.v2-status-dot-warning { background: #d97706; }
.v2-status-dot-danger { background: #dc2626; }
.v2-status-dot-muted { background: var(--muted-light); }

/*--------------------------------------------------------------
  # V2 Responsividade Global
  --------------------------------------------------------------*/

@media (max-width: 1199px) {
  .v2-page-header { flex-direction: column; gap: 8px; }
  .v2-page-actions { width: 100%; }
  .v2-kpi-card { padding: 16px; }
  .v2-kpi-value { font-size: 1.25rem; }
  .v2-filter-row { flex-direction: column; gap: 8px; }
  .v2-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .v2-tab { white-space: nowrap; flex-shrink: 0; }
  .partes-adv-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .app-footer { padding: 12px 0 4px; }
}

@media (max-width: 991px) {
  .partes-adv-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .v2-card-body { padding: 16px; }
}

@media (max-width: 767px) {
  .v2-page-title { font-size: 16px; }
  .v2-page-desc { font-size: 12px; }
  .v2-page-actions { flex-wrap: wrap; }
  .v2-page-actions .btn { font-size: 0.75rem; padding: 6px 12px; }

  .v2-kpi-card { padding: 14px; }
  .v2-kpi-value { font-size: 1.1rem; }
  .v2-kpi-title { font-size: 0.65rem; }
  .v2-kpi-icon { width: 32px; height: 32px; font-size: 0.9rem; }

  .partes-adv-grid { grid-template-columns: 1fr !important; }
  .partes-toggles { flex-wrap: wrap; gap: 8px; }
  .partes-filter-header { padding: 8px 12px; }
  .partes-filter-body { padding: 12px; }
  .partes-apply-bar { padding: 10px 12px; }
  .partes-chips { padding: 6px 12px; }

  .v2-card-body { padding: 12px; }
  .v2-section-title { font-size: 0.6rem; }
  .v2-filter-row { padding: 12px; }

  .v2-tabs { padding: 0 12px; gap: 0; }
  .v2-tab { padding: 8px 12px; font-size: 0.75rem; }

  .table thead th { font-size: 0.6rem; padding: 8px 10px; }
  .table tbody td { font-size: 0.75rem; padding: 8px 10px; }

  .dt-layout-row { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
  .dt-paging .page-item .page-link { min-width: 28px; height: 28px; font-size: 0.7rem; padding: 4px 6px; }

  .partes-drawer { width: 100% !important; }

  .v2-btn-primary, .v2-btn-ghost, .v2-btn-danger { font-size: 0.75rem; padding: 6px 14px; }
}

@media (max-width: 480px) {
  .v2-page-title { font-size: 14px; }
  .v2-kpi-value { font-size: 1rem; }
  .partes-switch-text { font-size: 0.7rem; }
  .partes-dr { flex-direction: column; gap: 4px; }
  .partes-dr span { display: none; }
}

@media (min-width: 1920px) {
  .v2-kpi-value { font-size: 1.75rem; }
  .v2-card-body { padding: 24px; }
  .partes-adv-grid { grid-template-columns: repeat(5, 1fr) !important; }
}

/* Page-specific utilities */
.dt-center { text-align: center; }
.dt-right { text-align: right; }
.datatable-top { display: none; }
.pagination { justify-content: center; }
.card-title { padding: 20px 0 0 0 !important; }

/* Page-specific utilities -- batch 3 */

/* Process search V2 */
.ps-tribunal-tabs {
    flex-wrap: wrap;
}

.tribunal-badge {
    cursor: pointer;
}

.tribunal-badge.active {
    background: var(--amber);
    color: #fff;
}

.ps-toggle-link {
    font-size: 0.8rem;
    color: var(--amber);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.ps-toggle-link:hover {
    color: var(--amber-dark);
}

.result-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.result-card.success { border-left: 3px solid var(--success-color); }
.result-card.warning { border-left: 3px solid var(--warning-color); }
.result-card.error { border-left: 3px solid var(--danger-color); }

.ps-help-details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.ps-help-summary {
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    transition: color 0.15s;
}

.ps-help-summary::-webkit-details-marker { display: none; }

.ps-help-summary:hover { color: var(--text); }

.ps-help-content {
    padding: 0 16px 16px;
}

.ps-help-block h6 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ps-help-block ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.ps-help-block li {
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
    padding-left: 12px;
    position: relative;
}

.ps-help-block li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 4px;
    height: 4px;
    background: var(--amber);
    border-radius: 50%;
}

.ps-help-block li:last-child { margin-bottom: 0; }

.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    flex: 1;
    background: var(--surface);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-box .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--amber);
}

.stat-box .stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.process-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.process-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    border-color: var(--amber);
}

.process-card .btn {
    transition: all 0.2s ease;
}

.process-card .btn:hover {
    transform: scale(1.05);
}

.process-card h6 {
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.process-card .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    font-weight: 600;
}

.process-card .small {
    font-size: 0.85rem;
}

.btn-ver-processo,
.btn-baixar-processo {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-ver-processo {
    background: var(--success-color);
    color: #fff;
}

.btn-ver-processo:hover {
    filter: brightness(0.9);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.35);
}

.btn-baixar-processo {
    background: var(--amber);
    color: #fff;
}

.btn-baixar-processo:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(var(--amber-rgb), 0.4);
    filter: brightness(1.05);
}

/* TJSP document search extras */
.results-table {
    margin-top: 2rem;
}

.results-table th {
    background: var(--surface);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}

.results-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
}

.badge-exists {
    background: var(--success-color);
}

.badge-new {
    background: var(--warning-color);
    color: var(--text);
}

/* Changelog release form */
.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.publish-toggle {
    background: var(--surface);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.publish-toggle .form-check {
    margin: 0;
}

.publish-toggle .form-check-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.publish-toggle .form-text {
    margin: 0;
}

.entries-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.btn-add-entry {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.btn-add-entry:hover {
    background: var(--border);
}

.entry-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.entry-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.entry-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.btn-remove-entry {
    background: none;
    border: none;
    color: var(--muted);
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.btn-remove-entry:hover {
    color: var(--danger-color);
    background: var(--surface);
}

.entry-card-body {
    padding: 16px;
}

.empty-entries {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.empty-entries i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.empty-entries p {
    margin-bottom: 12px;
    font-size: 14px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-actions .btn.v2-btn-primary {
    padding: 10px 24px;
    font-weight: 500;
}

.form-actions .btn-link {
    color: var(--muted);
    text-decoration: none;
}

.form-actions .btn-link:hover {
    color: var(--text);
}

.preview-container {
    min-height: 120px;
}

.preview-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
}

.preview-empty i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.preview-empty p {
    margin: 0;
    font-size: 13px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.preview-version {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--surface);
    background: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.preview-group {
    margin-bottom: 12px;
}

.preview-group:last-child {
    margin-bottom: 0;
}

.preview-type-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.preview-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.preview-type-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.preview-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}

.preview-list li {
    position: relative;
    padding: 4px 0 4px 12px;
}

.preview-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 4px;
    height: 4px;
    background: var(--muted);
    border-radius: 50%;
}

.preview-item-title {
    font-size: 13px;
    color: var(--text);
}

.preview-item-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.preview-item-desc p {
    margin: 0;
}

/* Changelog release detail */
.entry-description {
    font-size: 0.9rem;
    line-height: 1.6;
}

.entry-description p {
    margin-bottom: 0.5rem;
}

.entry-description p:last-child {
    margin-bottom: 0;
}

.entry-description code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

.entry-description pre {
    background: var(--surface);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
}

.entry-description ul, .entry-description ol {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

/* Changelog release list */
.release-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
    background: var(--surface);
    transition: box-shadow 0.2s;
}

.release-card:last-child {
    margin-bottom: 0;
}

.release-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.release-card.release-unread {
    border-left: 3px solid var(--amber);
}

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.release-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.release-version {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.release-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.release-date {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.release-entries {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.entry-type-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.entry-type-badge {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-feature { background-color: #198754; }
.badge-improvement { background-color: #0d6efd; }
.badge-bugfix { background-color: var(--amber); }
.badge-removal { background-color: var(--danger-color); }

.entry-type-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.entry-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}

.entry-list li {
    position: relative;
    font-size: 14px;
    color: var(--text);
    padding: 2px 0;
    padding-left: 12px;
}

.entry-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 4px;
    height: 4px;
    background: var(--muted);
    border-radius: 50%;
}

.latest-entries {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.latest-entries .entry-group {
    gap: 8px;
}

.latest-entries .entry-list li {
    padding: 4px 0 4px 12px;
}

.latest-entries .entry-list li strong {
    font-weight: 600;
    color: var(--text);
}

.entry-desc {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

/* Page-specific utilities -- batch 2 */

/* company/detail */
/* Company detail V2 */
.cd-info-card { margin-bottom: 16px; }
.cd-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.cd-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cd-company-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.cd-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 32px;
}
.cd-info-item-wide { grid-column: span 2; }
.cd-info-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.cd-info-value {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}
.cd-admin-name {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.cd-admin-email {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.cd-users-card { margin-bottom: 16px; }
.cd-users-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.cd-users-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}
.cd-users-card .table th {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  background: var(--surface);
}
.cd-users-card .table td {
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cd-col-email { color: var(--muted); font-size: 0.78rem; }
.cd-col-date { font-size: 0.78rem; color: var(--muted); }
.cd-users-card .pagination-container,
.cd-payments-card .pagination-container {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
}
.cd-users-card .pagination,
.cd-payments-card .pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
}
.cd-users-card .pagination li,
.cd-payments-card .pagination li {
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  transition: all 0.15s;
}
.cd-users-card .pagination li:hover:not(.disabled),
.cd-payments-card .pagination li:hover:not(.disabled) {
  background: var(--hover-bg);
  color: var(--text);
}
.cd-users-card .pagination .active,
.cd-payments-card .pagination .active {
  background: var(--amber);
  color: #fff;
}
.cd-users-card .pagination .disabled,
.cd-payments-card .pagination .disabled {
  opacity: 0.4;
  cursor: default;
}
@media (max-width: 768px) {
  .cd-info-grid { grid-template-columns: 1fr; gap: 14px; }
  .cd-info-item-wide { grid-column: span 1; }
  .cd-users-card .table th:nth-child(3),
  .cd-users-card .table td:nth-child(3) { display: none; }
}

.cd-info-card.editing {
  border-color: var(--amber);
  transition: border-color 0.2s;
}
.cd-info-item.editing {
  border-left: 2px solid var(--amber);
  padding-left: 10px;
  transition: border-left 0.2s, padding-left 0.2s;
}
.cd-header-left.editing {
  border-left: 2px solid var(--amber);
  padding-left: 10px;
  transition: border-left 0.2s, padding-left 0.2s;
}
.cd-edit-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 0.82rem;
  width: 100%;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.cd-edit-input:focus {
  border-color: var(--amber);
}
.cd-edit-input-name {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 4px 10px;
}

/* process/detail */
#processing-status-card {
  border-left: 4px solid;
  border-radius: 4px;
}
#processing-status-card.alert-info {
  border-left-color: var(--bs-info, #0dcaf0);
  background-color: var(--bs-info-bg-subtle, #cff4fc);
}
#processing-status-card.alert-success {
  border-left-color: var(--bs-success, #198754);
  background-color: var(--bs-success-bg-subtle, #d1e7dd);
}
#processing-status-card.alert-warning {
  border-left-color: var(--bs-warning, #ffc107);
  background-color: var(--bs-warning-bg-subtle, #fff3cd);
}
#processing-status-card.alert-danger {
  border-left-color: var(--bs-danger, #dc3545);
  background-color: var(--bs-danger-bg-subtle, #f8d7da);
}
#processing-status-card.alert-secondary {
  border-left-color: var(--bs-secondary, #6c757d);
  background-color: var(--bs-secondary-bg-subtle, #e2e3e5);
}

/* calculator */
.result-highlight {
  background: var(--amber);
  color: white;
  border-radius: 10px;
}
.period-card {
  border-left: 4px solid var(--amber);
  background-color: var(--light-bg);
}
.money-display { font-size: 1.2em; font-weight: bold; }

/* lead/detail */
#exportTable thead tr {
  background-color: var(--amber);
  color: white;
  text-align: left;
}
.skeleton {
  animation: skeleton-loading 1s linear infinite alternate;
}
@keyframes skeleton-loading {
  0% { background-color: var(--border); }
  100% { background-color: var(--light-bg); }
}
.skeleton-text {
  width: 100%;
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}
.skeleton-title {
  width: 60%;
  height: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 0.25rem;
}
.skeleton-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

/* User list V2 */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.65rem; color: #fff; flex-shrink: 0;
  text-transform: uppercase;
}
.user-name { font-weight: 600; font-size: 0.82rem; color: var(--text); }
.user-email { font-size: 0.72rem; color: var(--muted); }
.empresa-tag { font-size: 0.8rem; font-weight: 500; color: var(--text); }

/* Company expandable rows */
.company-col-chevron { width: 40px; text-align: center; }
.company-chevron {
  transition: transform 0.2s;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}
.company-chevron.expanded {
  transform: rotate(90deg);
  color: var(--amber);
}
.company-row-main { cursor: pointer; transition: background 0.15s; }
.company-row-main:hover { background: var(--hover-bg); }
.company-row-main.expanded { background: var(--hover-bg); }
.company-expand-row { display: none; }
.company-expand-row.show { display: table-row; }
.company-expand-row td { padding: 0 !important; border-bottom: 1px solid var(--border); }
.company-expand-content {
  padding: 16px 24px 16px 48px;
  background: var(--hover-bg);
}
.company-expand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.company-expand-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.company-expand-value {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}
.company-expand-actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.btn-expand-action {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-expand-action:hover {
  border-color: var(--amber);
  color: var(--amber);
  text-decoration: none;
}
.btn-expand-action.primary {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
}
.btn-expand-action.primary:hover {
  background: var(--amber-hover, #d99400);
  color: #fff;
  text-decoration: none;
}

/*--------------------------------------------------------------
# Process Detail — Compact Cards (pd-)
--------------------------------------------------------------*/
.pd-page-header { margin-bottom: 24px; }
.pd-page-header h1 { font-size: 1.35rem; font-weight: 700; color: var(--text); letter-spacing: -0.3px; margin: 0 0 4px; }
.pd-page-header p { font-size: 0.82rem; color: var(--muted); margin: 0; }

.pd-cards-row { display: flex; gap: 16px; margin-bottom: 16px; }
.pd-card-processo { flex: 6; min-width: 0; }
.pd-card-valores { flex: 4; min-width: 0; }

.pd-entity-name { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 10px; }
.pd-badges-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
.pd-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.pd-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px; }
.pd-field-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 3px; }
.pd-field-value { font-size: 0.88rem; color: var(--text); font-weight: 500; }
.pd-field-value-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.84rem; letter-spacing: 0.3px; }
.pd-field-full { grid-column: span 2; }

.pd-valor-block { margin-bottom: 12px; }
.pd-valor-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 3px; }
.pd-valor-amount { font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.pd-valor-corrected { color: #16a34a; }
[data-theme="dark"] .pd-valor-corrected { color: #4ade80; }

.pd-process-numbers { margin-bottom: 8px; }
.pd-process-number-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); margin-bottom: 2px; }
.pd-process-number-value { font-family: 'JetBrains Mono', monospace; font-size: 0.84rem; color: var(--text); font-weight: 600; word-break: break-all; margin-bottom: 10px; }

.pd-correcao-box { border-left: 3px solid var(--amber); padding: 14px 16px; background: var(--hover-bg); border-radius: 0 var(--radius, 6px) var(--radius, 6px) 0; }
.pd-correcao-title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.pd-correcao-desc { font-size: 0.72rem; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.pd-correcao-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-correcao-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; font-size: 0.78rem; font-weight: 600; border-radius: 6px; border: none; cursor: pointer; transition: all 0.2s; }
.pd-correcao-btn-view { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.pd-correcao-btn-view:hover { background: var(--hover-bg); border-color: var(--amber); color: var(--amber); }
.pd-correcao-btn-pdf { background: var(--amber); color: #fff; }
.pd-correcao-btn-pdf:hover { background: #d4900a; color: #fff; }
.pd-correcao-btn i { font-size: 0.9rem; }

/* Fix: quando modal abre, .main e sidebar ficam atras do backdrop */
body.modal-open .main,
body.modal-open .sidebar,
body.modal-open .header { z-index: 1 !important; }
.modal-backdrop { z-index: 1050 !important; }
.modal { z-index: 1060 !important; }

/* Correcao Monetaria Modal — sem overrides especificos, usa o global */
.cm-period-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 6px); overflow: hidden; height: 100%; }
.cm-period-header { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cm-period-title { font-size: 0.82rem; font-weight: 700; color: var(--text); margin: 0; }
.cm-period-badge { display: inline-block; font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 4px; margin-left: 8px; }
.cm-period-badge-pre { background: rgba(240,165,0,0.1); color: var(--amber); }
.cm-period-badge-graca { background: rgba(59,130,246,0.1); color: #3b82f6; }
.cm-period-badge-pos { background: rgba(34,197,94,0.1); color: #16a34a; }
.cm-period-body { padding: 0; }
.cm-detail-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cm-detail-section:last-child { border-bottom: none; }
.cm-detail-index { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--amber); margin-bottom: 10px; }
.cm-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.cm-detail-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); margin-bottom: 1px; }
.cm-detail-value { font-size: 0.82rem; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.cm-detail-value-money { font-weight: 600; }
.cm-detail-value-highlight { color: var(--amber); font-weight: 700; }
.cm-empty { padding: 24px 18px; text-align: center; color: var(--muted); font-size: 0.82rem; }

.pd-tab-content { padding: 16px 0; }

/* Process detail tab pagination */
.tab-pane .pagination { justify-content: flex-end; gap: 4px; margin: 16px 16px 8px; }
.tab-pane .pagination .page-item .page-link {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  transition: all 0.15s;
}
.tab-pane .pagination .page-item .page-link:hover { background: var(--hover-bg); border-color: var(--amber); color: var(--amber); }
.tab-pane .pagination .page-item.active .page-link { background: var(--amber); border-color: var(--amber); color: #fff; font-weight: 600; }
.tab-pane .pagination .page-item.disabled .page-link { opacity: 0.4; pointer-events: none; }
.tab-pane .pagination .page-item .page-link i { font-size: 0.72rem; }

/* O bloco `.app-toast*` que ficava aqui saiu: era o estilo da definição morta
   de showToast em main.js (sobrescrita pela do fim do arquivo, portanto nunca
   executada). O aviso do sistema agora é o toast do SweetAlert2, tematizado em
   css/design/swal.css, com fallback `.ds-toast` em css/design/components.css. */

/* RRA/PSS Popover */
.rra-pss-popover { max-width: 360px !important; }
.rra-pss-popover .popover-body { padding: 16px 18px; font-size: 0.85rem; color: var(--text); background: var(--surface); border-radius: var(--radius); }
.rra-pss-popover .popover-arrow::after { border-bottom-color: var(--surface) !important; }
.rra-pss-popover .rra-pss-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rra-pss-popover .rra-pss-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); }
.rra-pss-popover .rra-pss-value { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.rra-pss-popover .rra-pss-divider { border-top: 1px solid var(--border); margin: 10px 0; }
.rra-pss-popover .rra-pss-source { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; background: var(--amber-light, #fffbeb); color: var(--amber); font-weight: 600; }
.rra-pss-popover .rra-pss-comp { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.82rem; }
.rra-pss-popover .rra-pss-comp-name { color: var(--muted); }
.rra-pss-popover .rra-pss-comp-value { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 991px) {
  .pd-cards-row { flex-direction: column; }
}
@media (max-width: 480px) {
  .pd-fields-grid { grid-template-columns: 1fr; }
  .pd-field-full { grid-column: span 1; }
}

/* ===== Price Table - Master Detail ===== */
.pt-split {
  display: flex;
  gap: 16px;
  height: calc(100vh - var(--header-h) - 120px);
  min-height: 500px;
}

.pt-list-panel {
  width: 30%;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease;
}

.pt-split[data-layout="40"] .pt-list-panel { width: 40%; }
.pt-split[data-layout="25"] .pt-list-panel { width: 25%; }

.pt-detail-panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.pt-detail-panel::-webkit-scrollbar { width: 5px; }
.pt-detail-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.pt-detail-panel::-webkit-scrollbar-track { background: transparent; }

.pt-list-filters {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pt-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.pt-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-light);
  font-size: 0.78rem;
}

.pt-search-input {
  padding-left: 32px !important;
  font-size: 0.82rem !important;
  height: 36px;
}

.pt-filter-row {
  display: flex;
  gap: 6px;
}

.pt-filter-select {
  font-size: 0.78rem !important;
  height: 32px;
  padding: 2px 8px !important;
}

.pt-list-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.pt-list-scroll::-webkit-scrollbar { width: 4px; }
.pt-list-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.pt-list-scroll::-webkit-scrollbar-track { background: transparent; }

.pt-list-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border-left: 3px solid transparent;
}

.pt-list-item:hover {
  background: var(--hover-bg);
}

.pt-list-item.active {
  background: var(--hover-bg);
  border-left-color: var(--amber);
}

.pt-list-item-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-list-item-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-list-item-badges {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
}

.pt-list-item-badges .v2-badge {
  font-size: 0.58rem;
  padding: 2px 6px;
}

.pt-list-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.pt-list-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pt-list-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.pt-list-empty i {
  font-size: 2rem;
  opacity: 0.3;
  display: block;
  margin-bottom: 8px;
}

.pt-list-empty div {
  font-size: 0.82rem;
}

.pt-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.pt-detail-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.pt-detail-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pt-detail-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.pt-detail-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.pt-detail-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.pt-detail-info {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.pt-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 24px;
}

.pt-info-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 2px;
}

.pt-info-value {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
}

.pt-detail-tables {
  padding: 16px 24px 24px;
}

.pt-tables-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pt-tables-list {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.pt-table thead th {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 8px 14px;
  background: var(--hover-bg);
  border-bottom: 1px solid var(--border);
}

.pt-table tbody td {
  padding: 8px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.pt-table tbody tr:last-child td {
  border-bottom: none;
}

.pt-table tbody tr:hover {
  background: var(--hover-bg);
}

.pt-table-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.pt-inline-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.82rem;
  color: var(--text);
  width: 80px;
  font-family: inherit;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.pt-inline-input:hover {
  border-color: var(--border);
  background: var(--surface);
}

.pt-inline-input:focus {
  border-color: var(--amber) !important;
  background: var(--surface) !important;
  box-shadow: 0 0 0 2px rgba(var(--amber-rgb), 0.12) !important;
  outline: none;
}

.pt-inline-saving {
  opacity: 0.5;
  pointer-events: none;
}

.pt-layout-switcher {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

.pt-layout-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pt-layout-btn:hover {
  color: var(--text);
}

.pt-layout-btn.active {
  background: var(--surface);
  color: var(--amber);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

@media (max-width: 768px) {
  .pt-split {
    flex-direction: column;
    height: auto;
  }
  .pt-list-panel {
    width: 100% !important;
    max-height: 300px;
  }
  .pt-detail-panel {
    min-height: 400px;
  }
  .pt-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pt-layout-switcher {
    display: none;
  }
}


/*--------------------------------------------------------------
  # Shell do sistema (base.html)
  --------------------------------------------------------------
  base.html é carregado por TODAS as telas: um `style=` ali não é "uma
  exceção nesta tela", é uma exceção que vale no sistema inteiro e que
  nenhuma folha vence sem !important. As regras abaixo vieram de lá — os
  três atributos inline e o <style> solto que ficava no meio do <body>,
  logo depois do modal de logout.
  --------------------------------------------------------------*/

/* A regra do ícone de saldo (.credit-container .credit-icon) morava aqui.
   Saiu junto com o próprio ícone: a moeda âmbar de 20px foi removida do
   cabeçalho e não há mais o que pintar. Ver .credit-container, que agora é
   uma pílula sem ícone. */

/* Modal de logout: eram style="font-size:0.88rem" no texto e style="margin:0"
   no <form> que embrulha o botão Sair (sem isso o form empurra o rodapé do
   modal com a margem padrão). 0.88rem virou o degrau de corpo da escala. */
#modal-logout .logout-msg { font-size: var(--ds-fs-3); }
#modal-logout .logout-form { margin: 0; }

/* O X do Bootstrap é uma imagem preta embutida: no escuro ele some.
   É a mesma regra que components.css já aplica em `.ds-modal .btn-close`;
   este modal ainda não é `.ds-modal`, então ela mora aqui até ele migrar. */
[data-theme="dark"] #modal-logout .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}
