
/*
  Brasil Certificadora — Redesign visual
  Etapa 1: branco absoluto e preto OLED.
  Não altera funcionalidades.
*/

html:not([data-theme="dark"]) {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #f0f0f0;

  --line: #e8e8e8;
  --line-strong: #d6d6d6;

  --text: #111111;
  --muted: #666666;

  --navy: #111111;
  --navy-2: #333333;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #101010;
  --surface-2: #171717;
  --surface-3: #202020;

  --line: #292929;
  --line-strong: #404040;

  --text: #f5f5f5;
  --muted: #a1a1a1;

  --navy: #ffffff;
  --navy-2: #dedede;
}

html,
body {
  background-color: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] main {
  background-color: #000000;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .crm-nav,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .management-card,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .login-card {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

/* Vidro moderado apenas em superfícies de navegação. */

.topbar,
.crm-nav {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] .crm-nav button {
  color: var(--muted);
}

html[data-theme="dark"] .crm-nav button:hover {
  background-color: var(--surface-3);
  color: var(--text);
}

html[data-theme="dark"]
.crm-nav button[aria-current="page"] {
  background-color: #ffffff;
  color: #000000;
}

/* Acessibilidade: sem animações obrigatórias. */

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .crm-nav {
    scroll-behavior: auto;
  }
}


/* REDESIGN_ETAPA_2A
   Cabeçalho e navegação minimalistas.
   Somente aparência; nenhuma alteração funcional.
*/

/* Cabeçalho: vidro discreto e cores neutras. */

html:not([data-theme="dark"]) .topbar {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid #eaeaea;
  box-shadow: 0 5px 24px rgba(0,0,0,.035);
}

html[data-theme="dark"] .topbar {
  background: rgba(0,0,0,.94);
  border-bottom: 1px solid #242424;
  box-shadow: 0 5px 24px rgba(0,0,0,.35);
}

.topbar {
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  transition:
    background-color .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}

/* Logotipo original: apenas acabamento do contêiner. */

.topbar .brand-link {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow:
    0 2px 8px rgba(0,0,0,.035),
    0 8px 24px rgba(0,0,0,.025);
  transition:
    box-shadow .22s ease,
    transform .22s ease;
}

@media (hover: hover) {
  .topbar .brand-link:hover {
    transform: translateY(-1px);
    box-shadow:
      0 4px 12px rgba(0,0,0,.06),
      0 10px 28px rgba(0,0,0,.035);
  }
}

/* Informações da conta. */

html:not([data-theme="dark"])
.topbar .account-copy strong {
  color: #111111;
}

html:not([data-theme="dark"])
.topbar .account-copy span {
  color: #777777;
}

html[data-theme="dark"]
.topbar .account-copy strong {
  color: #ffffff;
}

html[data-theme="dark"]
.topbar .account-copy span {
  color: #aaaaaa;
}

.topbar .account-copy strong {
  font-weight: 600;
  letter-spacing: -.015em;
}

/* Avatar: relevo discreto. */

.topbar .avatar {
  border-radius: 50%;
  background: #f3f3f3;
  color: #222222;
  border: 1px solid #e5e5e5;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 2px 5px rgba(0,0,0,.045);
}

html[data-theme="dark"] .topbar .avatar {
  background: #171717;
  color: #ffffff;
  border-color: #343434;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 2px 7px rgba(0,0,0,.3);
}

/* Botão de sair: mantém o SVG e o evento atuais. */

.topbar #logoutBtn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  background: #f5f5f5;
  color: #222222;
  border: 1px solid #e9e9e9;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 2px 6px rgba(0,0,0,.035);
  transition:
    transform .2s ease,
    background-color .2s ease,
    box-shadow .2s ease,
    border-color .2s ease;
}

.topbar #logoutBtn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
}

html[data-theme="dark"] .topbar #logoutBtn {
  background: #161616;
  color: #eeeeee;
  border-color: #303030;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 3px 9px rgba(0,0,0,.3);
}

@media (hover: hover) {
  .topbar #logoutBtn:hover {
    transform: translateY(-1px);
    background: #ebebeb;
    box-shadow: 0 5px 12px rgba(0,0,0,.07);
  }

  html[data-theme="dark"]
  .topbar #logoutBtn:hover {
    background: #242424;
    border-color: #454545;
  }
}

.topbar #logoutBtn:active {
  transform: scale(.96);
}

/* Não interferir no botão 3D de tema. */

/* Navegação: botões minimalistas em formato pílula. */

.crm-nav {
  border-color: var(--line);
}

.crm-nav button {
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: -.01em;
  transition:
    background-color .2s ease,
    color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

html:not([data-theme="dark"])
.crm-nav button {
  color: #555555;
}

html:not([data-theme="dark"])
.crm-nav button:hover {
  background: #f1f1f1;
  color: #111111;
}

html:not([data-theme="dark"])
.crm-nav button[aria-current="page"] {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
  box-shadow: 0 3px 9px rgba(0,0,0,.10);
}

html[data-theme="dark"] .crm-nav {
  background: #000000;
  border-color: #242424;
}

html[data-theme="dark"]
.crm-nav button {
  color: #bcbcbc;
}

html[data-theme="dark"]
.crm-nav button:hover {
  background: #191919;
  color: #ffffff;
}

html[data-theme="dark"]
.crm-nav button[aria-current="page"] {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 3px 12px rgba(255,255,255,.07);
}

/* Foco visível para teclado. */

.topbar .brand-link:focus-visible,
.topbar #logoutBtn:focus-visible,
.crm-nav button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Respeitar as dimensões atuais do cabeçalho móvel. */

@media (max-width: 720px) {
  .topbar {
    gap: 10px;
  }

  .topbar #logoutBtn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* Sem movimento para quem desativou animações. */

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .topbar .brand-link,
  .topbar #logoutBtn,
  .crm-nav button {
    transition: none;
  }

  .topbar .brand-link:hover,
  .topbar #logoutBtn:hover {
    transform: none;
  }
}


/* REDESIGN_ETAPA_2B
   Ícones monocromáticos do menu.
*/

.crm-nav button[data-view] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.crm-nav .crm-nav-icon {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  pointer-events: none;
  transition: transform .2s ease;
}

@media (hover: hover) {
  .crm-nav button[data-view]:hover
  .crm-nav-icon {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crm-nav .crm-nav-icon {
    transition: none;
  }
}


/* REDESIGN_ETAPA_3
   Cartões, botões e formulários.
   Exclusivamente visual.
*/

/* Cartões principais */

.metric,
.management-card,
.panel,
.login-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  transition:
    border-color .22s ease,
    box-shadow .22s ease,
    background-color .22s ease;
}

html:not([data-theme="dark"]) .metric,
html:not([data-theme="dark"]) .management-card,
html:not([data-theme="dark"]) .panel,
html:not([data-theme="dark"]) .login-card {
  background: #ffffff;
  border-color: #e9e9e9;
  box-shadow:
    0 2px 8px rgba(0,0,0,.025),
    0 12px 34px rgba(0,0,0,.035);
}

html[data-theme="dark"] .metric,
html[data-theme="dark"] .management-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .login-card {
  background: #101010;
  color: #f5f5f5;
  border-color: #292929;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    0 12px 34px rgba(0,0,0,.22);
}

/* Movimento discreto apenas nos cartões de resumo. */

@media (hover: hover) {
  .metric:hover {
    border-color: var(--line-strong);
    box-shadow:
      0 4px 14px rgba(0,0,0,.045),
      0 16px 38px rgba(0,0,0,.055);
  }

  html[data-theme="dark"] .metric:hover {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.045),
      0 12px 34px rgba(0,0,0,.32);
  }
}

/* Ícones dos cartões */

.metric-icon {
  border-radius: 14px;
}

html:not([data-theme="dark"]) .metric-icon {
  background: #f3f3f3;
  color: #222222;
  border: 1px solid #eaeaea;
}

html[data-theme="dark"] .metric-icon {
  background: #1d1d1d;
  color: #f5f5f5;
  border: 1px solid #343434;
}

/* Tipografia dos indicadores */

.metric-copy strong {
  letter-spacing: -.045em;
  font-weight: 650;
}

.metric-copy span {
  letter-spacing: -.01em;
}

/* Botões comuns */

.btn {
  border-radius: 13px;
  font-weight: 600;
  letter-spacing: -.015em;
  transition:
    transform .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

/* Botões principais monocromáticos */

html:not([data-theme="dark"]) .btn-primary {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
  box-shadow: 0 3px 9px rgba(0,0,0,.09);
}

html[data-theme="dark"] .btn-primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 3px 12px rgba(255,255,255,.045);
}

@media (hover: hover) {
  html:not([data-theme="dark"]) .btn-primary:hover {
    background: #303030;
    border-color: #303030;
    box-shadow: 0 5px 14px rgba(0,0,0,.14);
  }

  html[data-theme="dark"] .btn-primary:hover {
    background: #e9e9e9;
    border-color: #e9e9e9;
  }

  .btn:not(:disabled):hover {
    transform: translateY(-1px);
  }
}

.btn:not(:disabled):active {
  transform: scale(.985);
}

/* Campos e seletores */

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-radius: 12px;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background-color .18s ease;
}

html:not([data-theme="dark"])
input:not([type="checkbox"]):not([type="radio"]),
html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea {
  background-color: #ffffff;
  color: #111111;
  border-color: #dedede;
}

html[data-theme="dark"]
input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #171717;
  color: #f5f5f5;
  border-color: #393939;
}

/* Foco visível */

input:not([type="checkbox"]):not([type="radio"]):focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Redução de movimento */

@media (prefers-reduced-motion: reduce) {
  .metric,
  .management-card,
  .panel,
  .login-card,
  .btn,
  input,
  select,
  textarea {
    transition: none;
  }

  .btn:not(:disabled):hover,
  .btn:not(:disabled):active {
    transform: none;
  }
}


/* REDESIGN_ETAPA_4
   Kanban, tabelas e indicadores.
   Exclusivamente visual.
   Arraste e seletor "Mover para" preservados.
*/

/* Colunas do Kanban */

#kanbanBoard > .column {
  border-radius: 18px;
  transition:
    background-color .2s ease,
    border-color .2s ease;
}

html:not([data-theme="dark"])
#kanbanBoard > .column {
  background: #f6f6f6;
  border-color: #e8e8e8;
  box-shadow: none;
}

html[data-theme="dark"]
#kanbanBoard > .column {
  background: #101010;
  border-color: #292929;
  box-shadow: none;
}

/* Neutralizar fundos antigos por status,
   sem alterar os indicadores coloridos. */

html:not([data-theme="dark"])
#kanbanBoard > .column[data-status] {
  background: #f6f6f6;
}

html[data-theme="dark"]
#kanbanBoard > .column[data-status] {
  background: #101010;
}

/* Cabeçalhos */

html:not([data-theme="dark"])
#kanbanBoard .column-title strong {
  color: #222222;
}

html[data-theme="dark"]
#kanbanBoard .column-title strong {
  color: #f5f5f5;
}

html:not([data-theme="dark"])
#kanbanBoard .column-count {
  background: #ffffff;
  color: #333333;
  border: 1px solid #e5e5e5;
  box-shadow: none;
}

html[data-theme="dark"]
#kanbanBoard .column-count {
  background: #202020;
  color: #eeeeee;
  border: 1px solid #383838;
  box-shadow: none;
}

/* Cartões */

#kanbanBoard .card {
  border-radius: 15px;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

html:not([data-theme="dark"])
#kanbanBoard .card {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  box-shadow:
    0 2px 6px rgba(0,0,0,.025),
    0 8px 22px rgba(0,0,0,.035);
}

html[data-theme="dark"]
#kanbanBoard .card {
  background: #191919;
  color: #eeeeee;
  border: 1px solid #333333;
  box-shadow:
    0 3px 12px rgba(0,0,0,.22);
}

/* Retirar apenas a decoração lateral antiga. */

#kanbanBoard .card::before {
  display: none;
}

/* Estados visuais do arraste existente */

#kanbanBoard .card[draggable="true"] {
  cursor: grab;
}

#kanbanBoard .card.dragging {
  cursor: grabbing;
  opacity: .55;
  transform: scale(.985);
}

html:not([data-theme="dark"])
#kanbanBoard .column.drag-over {
  background: #ededed;
  border-color: #aaaaaa;
}

html[data-theme="dark"]
#kanbanBoard .column.drag-over {
  background: #1d1d1d;
  border-color: #666666;
}

/* Seletor "Mover para":
   mantido, com acabamento minimalista. */

#kanbanBoard .kanban-move-label {
  margin-top: 12px;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
}

html:not([data-theme="dark"])
#kanbanBoard .kanban-move-label {
  color: #666666;
}

html[data-theme="dark"]
#kanbanBoard .kanban-move-label {
  color: #aaaaaa;
}

#kanbanBoard .kanban-move-select {
  width: 100%;
  min-height: 40px;
  border-radius: 11px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

html:not([data-theme="dark"])
#kanbanBoard .kanban-move-select {
  background: #fafafa;
  color: #222222;
  border: 1px solid #dedede;
}

html[data-theme="dark"]
#kanbanBoard .kanban-move-select {
  background: #242424;
  color: #eeeeee;
  border: 1px solid #424242;
}

/* Foco acessível */

#kanbanBoard .kanban-move-select:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Tabelas */

html:not([data-theme="dark"])
.base-table th {
  background: #f6f6f6;
  color: #555555;
  border-bottom-color: #e8e8e8;
}

html[data-theme="dark"]
.base-table th {
  background: #1b1b1b;
  color: #cccccc;
  border-bottom-color: #333333;
}

html:not([data-theme="dark"])
.base-table td {
  border-bottom-color: #ededed;
}

html[data-theme="dark"]
.base-table td {
  border-bottom-color: #303030;
}

@media (hover: hover) {
  html:not([data-theme="dark"])
  .base-table tbody tr:hover {
    background: #f8f8f8;
  }

  html[data-theme="dark"]
  .base-table tbody tr:hover {
    background: #1b1b1b;
  }

  #kanbanBoard .card:not(.dragging):hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
  }
}

/* Indicadores de renovação */

.renewal-stat {
  border-radius: 16px;
}

html:not([data-theme="dark"])
.renewal-stat {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  box-shadow: 0 4px 18px rgba(0,0,0,.035);
}

html[data-theme="dark"]
.renewal-stat {
  background: #171717;
  color: #aaaaaa;
  border: 1px solid #303030;
  box-shadow: none;
}

html[data-theme="dark"]
.renewal-stat strong {
  color: #ffffff;
}

/* Adaptação visual para telas menores.
   Nenhuma alteração na lógica de movimentação. */

@media (max-width: 720px) {
  #kanbanBoard .card {
    border-radius: 13px;
  }

  #kanbanBoard .kanban-move-select {
    min-height: 44px;
  }
}

/* Preferência por movimento reduzido */

@media (prefers-reduced-motion: reduce) {
  #kanbanBoard .card,
  #kanbanBoard > .column {
    transition: none;
  }

  #kanbanBoard .card:not(.dragging):hover {
    transform: none;
  }
}


/* REDESIGN_ETAPA_5
   Relatórios e indicadores.
   Exclusivamente visual.
   Gráficos, cálculos e animações preservados.
*/

/* Indicadores de renovação */

.renewal-stats {
  gap: 14px;
}

.renewal-stat {
  border-radius: 18px;
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background-color .2s ease;
}

html:not([data-theme="dark"])
.renewal-stat {
  background: #ffffff;
  color: #666666;
  border: 1px solid #e8e8e8;
  box-shadow:
    0 2px 8px rgba(0,0,0,.025),
    0 12px 30px rgba(0,0,0,.035);
}

html[data-theme="dark"]
.renewal-stat {
  background: #141414;
  color: #aaaaaa;
  border: 1px solid #303030;
  box-shadow: none;
}

.renewal-stat strong {
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.1;
}

html:not([data-theme="dark"])
.renewal-stat strong {
  color: #111111;
}

html[data-theme="dark"]
.renewal-stat strong {
  color: #ffffff;
}

/* Painel escuro existente.
   Preservar seu fundo escuro também no tema claro. */

.renewal-dark-panel {
  background: #1c1c1c;
  border: 1px solid #343434;
  border-radius: 20px;
  box-shadow:
    0 12px 36px rgba(0,0,0,.12);
}

/* Acabamento dos cartões de resumo */

html:not([data-theme="dark"])
.metric {
  background: #ffffff;
  border-color: #e8e8e8;
}

html[data-theme="dark"]
.metric {
  background: #141414;
  border-color: #303030;
}

.metric-copy strong {
  font-weight: 650;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}

/* Contêineres de relatórios.
   Aplicados somente se existirem no CRM. */

.report-card,
.report-panel,
.reports-card,
.reports-panel {
  border-radius: 20px;
  border: 1px solid var(--line);
}

html:not([data-theme="dark"])
.report-card,
html:not([data-theme="dark"])
.report-panel,
html:not([data-theme="dark"])
.reports-card,
html:not([data-theme="dark"])
.reports-panel {
  background: #ffffff;
  color: #111111;
  border-color: #e8e8e8;
  box-shadow:
    0 2px 8px rgba(0,0,0,.025),
    0 12px 32px rgba(0,0,0,.035);
}

html[data-theme="dark"]
.report-card,
html[data-theme="dark"]
.report-panel,
html[data-theme="dark"]
.reports-card,
html[data-theme="dark"]
.reports-panel {
  background: #141414;
  color: #f5f5f5;
  border-color: #303030;
  box-shadow: none;
}

/* Áreas de gráficos.
   Não alterar canvas, SVG ou animações. */

.report-chart,
.reports-chart {
  border-radius: 16px;
}

html:not([data-theme="dark"])
.report-chart,
html:not([data-theme="dark"])
.reports-chart {
  background: #fafafa;
  border: 1px solid #eeeeee;
}

html[data-theme="dark"]
.report-chart,
html[data-theme="dark"]
.reports-chart {
  background: #1b1b1b;
  border: 1px solid #303030;
}

/* Tabelas de relatórios */

.report-table,
.reports-table {
  width: 100%;
}

html:not([data-theme="dark"])
.report-table th,
html:not([data-theme="dark"])
.reports-table th {
  background: #f7f7f7;
  color: #555555;
  border-bottom-color: #e8e8e8;
}

html[data-theme="dark"]
.report-table th,
html[data-theme="dark"]
.reports-table th {
  background: #202020;
  color: #cccccc;
  border-bottom-color: #383838;
}

/* Dispositivos menores */

@media (max-width: 720px) {
  .renewal-stats {
    gap: 10px;
  }

  .renewal-stat {
    border-radius: 15px;
  }

  .report-card,
  .report-panel,
  .reports-card,
  .reports-panel {
    border-radius: 16px;
  }
}

/* Preferência por menos movimento.
   Não interfere nas animações dos gráficos. */

@media (prefers-reduced-motion: reduce) {
  .renewal-stat {
    transition: none;
  }
}


/* REDESIGN_ETAPA_5_GRAFICOS_REAIS
   Correção visual dos componentes reais.
   Nenhum cálculo ou comportamento alterado.
*/

/* Seção principal */

html:not([data-theme="dark"])
#portfolioReports.reports-section {
  background: #ffffff;
  color: #111111;
  border: 1px solid #e8e8e8;
  border-radius: 24px;
  box-shadow: 0 10px 35px rgba(0,0,0,.035);
}

html[data-theme="dark"]
#portfolioReports.reports-section {
  background: #000000;
  color: #f5f5f5;
  border: 1px solid #292929;
  border-radius: 24px;
  box-shadow: none;
}

/* Título e identificação */

#portfolioReports .reports-heading h2 {
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.2;
}

#portfolioReports .reports-label {
  border-radius: 999px;
  font-weight: 500;
}

html:not([data-theme="dark"])
#portfolioReports .reports-label {
  background: #f6f6f6;
  border-color: #e8e8e8;
  color: #555555;
}

html[data-theme="dark"]
#portfolioReports .reports-label {
  background: #171717;
  border-color: #333333;
  color: #cccccc;
}

/* Indicadores numéricos */

#portfolioReports .reports-kpi {
  border-radius: 18px;
  transition:
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

html:not([data-theme="dark"])
#portfolioReports .reports-kpi {
  background: #f9f9f9;
  border-color: #ebebeb;
  box-shadow: none;
}

html[data-theme="dark"]
#portfolioReports .reports-kpi {
  background: #151515;
  border-color: #303030;
  box-shadow: none;
}

#portfolioReports .reports-kpi strong {
  font-weight: 650;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

html:not([data-theme="dark"])
#portfolioReports .reports-kpi strong {
  color: #111111;
}

html[data-theme="dark"]
#portfolioReports .reports-kpi strong {
  color: #ffffff;
}

/* Painéis dos gráficos */

#portfolioReports .reports-panel {
  border-radius: 20px;
}

html:not([data-theme="dark"])
#portfolioReports .reports-panel {
  background: #ffffff;
  color: #111111;
  border-color: #e8e8e8;
  box-shadow:
    0 2px 8px rgba(0,0,0,.025),
    0 12px 30px rgba(0,0,0,.025);
}

html[data-theme="dark"]
#portfolioReports .reports-panel {
  background: #141414;
  color: #eeeeee;
  border-color: #303030;
  box-shadow: none;
}

#portfolioReports .reports-panel h3 {
  font-weight: 650;
  letter-spacing: -.025em;
}

/* Barras de vencimentos e etapas.
   Mantém as larguras calculadas pelo JavaScript. */

#portfolioReports .reports-bar-track {
  height: 12px;
  border-radius: 999px;
}

html:not([data-theme="dark"])
#portfolioReports .reports-bar-track {
  background: #eaeaea;
}

html[data-theme="dark"]
#portfolioReports .reports-bar-track {
  background: #343434;
}

#portfolioReports .reports-bar-fill {
  border-radius: 999px;
}

html:not([data-theme="dark"])
#portfolioReports .reports-bar-fill {
  background: #303030;
}

html[data-theme="dark"]
#portfolioReports .reports-bar-fill {
  background: #eeeeee;
}

/* Gráfico circular.
   Preservar o conic-gradient gerado pelo JS:
   suas cores distinguem as situações dos certificados. */

#portfolioReports .reports-donut {
  box-shadow: 0 8px 24px rgba(0,0,0,.055);
}

#portfolioReports .reports-donut-center {
  border: 1px solid var(--line);
}

html:not([data-theme="dark"])
#portfolioReports .reports-donut-center {
  background: #ffffff;
  border-color: #eeeeee;
  color: #111111;
}

html[data-theme="dark"]
#portfolioReports .reports-donut-center {
  background: #141414;
  border-color: #303030;
  color: #ffffff;
}

#portfolioReports .reports-donut-center strong {
  font-weight: 650;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

/* Legenda do gráfico circular */

#portfolioReports .reports-legend > div {
  padding: 8px 10px;
  border-radius: 10px;
}

html:not([data-theme="dark"])
#portfolioReports .reports-legend > div {
  background: #f8f8f8;
}

html[data-theme="dark"]
#portfolioReports .reports-legend > div {
  background: #202020;
}

#portfolioReports .reports-legend strong {
  font-variant-numeric: tabular-nums;
}

/* Gráfico de pedidos.
   Manter as duas cores para diferenciar
   registrados e concluídos. */

#portfolioReports .reports-orders-columns > div {
  border-radius: 7px 7px 0 0;
}

html:not([data-theme="dark"])
#portfolioReports .reports-orders-columns {
  border-bottom-color: #e8e8e8;
}

html[data-theme="dark"]
#portfolioReports .reports-orders-columns {
  border-bottom-color: #383838;
}

/* Estados vazios */

html:not([data-theme="dark"])
#portfolioReports .reports-empty {
  color: #777777;
}

html[data-theme="dark"]
#portfolioReports .reports-empty {
  color: #aaaaaa;
}

/* Responsividade:
   manter a estrutura existente dos gráficos. */

@media (max-width: 720px) {
  #portfolioReports.reports-section {
    border-radius: 18px;
  }

  #portfolioReports .reports-kpi,
  #portfolioReports .reports-panel {
    border-radius: 15px;
  }

  #portfolioReports .reports-heading h2 {
    font-size: clamp(20px, 5vw, 24px);
  }
}

/* Não modificar regras de animação dos gráficos. */

@media (prefers-reduced-motion: reduce) {
  #portfolioReports .reports-kpi {
    transition: none;
  }
}


/* REPORTS_LINE_CHART_VENCIMENTOS
   Gráfico de linha/área para "Vencimentos por mês" */

#portfolioReports .reports-line-card {
  padding-top: 2px;
}

#portfolioReports .reports-line-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

#portfolioReports .reports-line-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

#portfolioReports .reports-line-grid {
  stroke: rgba(127,127,127,.22);
  stroke-width: 1;
}

#portfolioReports .reports-line-axis-label {
  font-size: 11px;
  fill: var(--muted);
}

#portfolioReports .reports-line-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: reportsLineDraw .9s ease forwards;
}

html:not([data-theme="dark"])
#portfolioReports .reports-line-path {
  stroke: #111111;
}

html[data-theme="dark"]
#portfolioReports .reports-line-path {
  stroke: #f5f5f5;
}

#portfolioReports .reports-line-area {
  fill: url(#reportsLineAreaGradient);
  opacity: 0;
  animation: reportsLineAreaFade .7s ease .18s forwards;
}

html:not([data-theme="dark"])
#portfolioReports .reports-line-stop-top {
  stop-color: #111111;
  stop-opacity: .28;
}

html:not([data-theme="dark"])
#portfolioReports .reports-line-stop-bottom {
  stop-color: #111111;
  stop-opacity: 0;
}

html[data-theme="dark"]
#portfolioReports .reports-line-stop-top {
  stop-color: #ffffff;
  stop-opacity: .26;
}

html[data-theme="dark"]
#portfolioReports .reports-line-stop-bottom {
  stop-color: #ffffff;
  stop-opacity: 0;
}

#portfolioReports .reports-line-point {
  stroke-width: 2.5;
}

html:not([data-theme="dark"])
#portfolioReports .reports-line-point {
  fill: #ffffff;
  stroke: #111111;
}

html[data-theme="dark"]
#portfolioReports .reports-line-point {
  fill: #000000;
  stroke: #ffffff;
}

#portfolioReports .reports-line-value {
  font-size: 11px;
  font-weight: 700;
  fill: var(--text);
  font-variant-numeric: tabular-nums;
}

#portfolioReports .reports-line-point-group {
  opacity: 0;
  animation: reportsLinePointIn .35s ease forwards;
}

@keyframes reportsLineDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes reportsLineAreaFade {
  to {
    opacity: .28;
  }
}

@keyframes reportsLinePointIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #portfolioReports .reports-line-path,
  #portfolioReports .reports-line-area,
  #portfolioReports .reports-line-point-group {
    animation: none !important;
    opacity: 1 !important;
  }

  #portfolioReports .reports-line-path {
    stroke-dashoffset: 0 !important;
  }
}


/* ETAPA 6B — Refino visual do donut e da legenda */
#portfolioReports #reportsValidity .reports-donut-layout {
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 240px;
}

#portfolioReports #reportsValidity .reports-donut {
  width: 164px;
  height: 164px;
  box-shadow: none;
  filter: saturate(.92);
}

#portfolioReports #reportsValidity .reports-donut-center {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

html:not([data-theme="dark"])
#portfolioReports #reportsValidity .reports-donut-center {
  background: #ffffff;
  border-color: #ececec;
  color: #111111;
}

html[data-theme="dark"]
#portfolioReports #reportsValidity .reports-donut-center {
  background: #0a0a0a;
  border-color: #2c2c2c;
  color: #ffffff;
}

#portfolioReports #reportsValidity .reports-donut-center strong {
  font-size: 22px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.045em;
}

#portfolioReports #reportsValidity .reports-donut-center span {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: .01em;
}

html:not([data-theme="dark"])
#portfolioReports #reportsValidity .reports-donut-center span {
  color: #6a6a6a;
}

html[data-theme="dark"]
#portfolioReports #reportsValidity .reports-donut-center span {
  color: #a4a4a4;
}

#portfolioReports #reportsValidity .reports-legend {
  min-width: 260px;
  display: grid;
  gap: 14px;
}

#portfolioReports #reportsValidity .reports-legend > div {
  display: grid;
  grid-template-columns: 14px minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: none;
}

html:not([data-theme="dark"])
#portfolioReports #reportsValidity .reports-legend > div {
  background: #fbfbfb;
  border-color: #ececec;
}

html[data-theme="dark"]
#portfolioReports #reportsValidity .reports-legend > div {
  background: linear-gradient(180deg,#151515,#111111);
  border-color: #2a2a2a;
}

#portfolioReports #reportsValidity .reports-legend i {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  opacity: .95;
  box-shadow: none;
}

#portfolioReports #reportsValidity .reports-legend span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.01em;
}

html:not([data-theme="dark"])
#portfolioReports #reportsValidity .reports-legend span {
  color: #1a1a1a;
}

html[data-theme="dark"]
#portfolioReports #reportsValidity .reports-legend span {
  color: #f0f0f0;
}

#portfolioReports #reportsValidity .reports-legend strong {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

html:not([data-theme="dark"])
#portfolioReports #reportsValidity .reports-legend strong {
  color: #111111;
}

html[data-theme="dark"]
#portfolioReports #reportsValidity .reports-legend strong {
  color: #ffffff;
}

@media (max-width: 720px) {
  #portfolioReports #reportsValidity .reports-donut-layout {
    gap: 20px;
  }

  #portfolioReports #reportsValidity .reports-donut {
    width: 148px;
    height: 148px;
  }

  #portfolioReports #reportsValidity .reports-donut-center {
    width: 96px;
    height: 96px;
  }

  #portfolioReports #reportsValidity .reports-legend {
    min-width: 100%;
  }
}


/* REDESIGN_LAYOUT_RELATORIOS_6
   Inteligência da carteira em duas linhas.
   Somente CSS. Sem alteração de dados.
*/

/* Organização principal */

#portfolioReports .reports-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

/* O gráfico anual ocupa toda a primeira linha. */

#portfolioReports .reports-grid
> .reports-panel:first-child {
  grid-column: 1 / -1;
}

/* Demais painéis na segunda linha. */

#portfolioReports .reports-grid
> .reports-panel {
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: start;
  padding: clamp(18px, 2vw, 28px);
  border-radius: 20px;
}

/* Manter o título próximo do gráfico. */

#portfolioReports .reports-panel > h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.025em;
}

#portfolioReports .reports-panel > p {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.4;
}

/* Gráfico anual:
   largura confortável e altura proporcional. */

#portfolioReports #reportsExpirations {
  min-width: 0;
  width: 100%;
}

#portfolioReports #reportsExpirations
.reports-line-wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  overflow-x: auto;
  overflow-y: hidden;
}

#portfolioReports #reportsExpirations
.reports-line-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  max-height: 370px;
  height: auto;
  margin-inline: auto;
}

/* Donut e legenda:
   divisão equilibrada e menos espaços vazios. */

#portfolioReports #reportsValidity
.reports-donut-layout {
  display: grid;
  grid-template-columns:
    minmax(140px, .8fr)
    minmax(180px, 1fr);
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 0;
}

#portfolioReports #reportsValidity
.reports-donut {
  justify-self: center;
  flex: none;
}

#portfolioReports #reportsValidity
.reports-legend {
  width: 100%;
  min-width: 0;
  gap: 9px;
}

#portfolioReports #reportsValidity
.reports-legend > div {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 12px;
  gap: 10px;
}

#portfolioReports #reportsValidity
.reports-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

#portfolioReports #reportsValidity
.reports-legend strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Kanban:
   rótulos legíveis e barras mais delicadas. */

#portfolioReports #reportsStages
.reports-bars {
  gap: 17px;
}

#portfolioReports #reportsStages
.reports-bar-row {
  display: grid;
  grid-template-columns:
    minmax(105px, 138px)
    minmax(0, 1fr)
    24px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

#portfolioReports #reportsStages
.reports-bar-label {
  line-height: 1.4;
  overflow-wrap: normal;
}

#portfolioReports #reportsStages
.reports-bar-track {
  height: 7px;
  border-radius: 999px;
}

#portfolioReports #reportsStages
.reports-bar-fill {
  border-radius: 999px;
}

/* Quaisquer painéis adicionais ocupam
   uma linha própria. */

#portfolioReports .reports-grid
> .reports-panel:nth-child(n+4) {
  grid-column: 1 / -1;
}

/* Telas intermediárias:
   painel por linha quando falta espaço. */

@media (max-width: 1050px) {
  #portfolioReports .reports-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  #portfolioReports .reports-grid
  > .reports-panel {
    grid-column: 1 / -1;
  }

  #portfolioReports #reportsValidity
  .reports-donut-layout {
    grid-template-columns:
      minmax(150px, .65fr)
      minmax(190px, 1fr);
  }
}

/* Celular:
   conteúdo empilhado e gráfico anual rolável. */

@media (max-width: 600px) {
  #portfolioReports .reports-grid {
    gap: 14px;
  }

  #portfolioReports .reports-grid
  > .reports-panel {
    padding: 17px;
    border-radius: 16px;
  }

  #portfolioReports #reportsValidity
  .reports-donut-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 22px;
  }

  #portfolioReports #reportsValidity
  .reports-legend {
    width: 100%;
    max-width: 400px;
  }

  #portfolioReports #reportsStages
  .reports-bar-row {
    grid-template-columns:
      minmax(90px, 112px)
      minmax(0, 1fr)
      20px;
    gap: 8px;
  }

  #portfolioReports #reportsExpirations
  .reports-line-wrap {
    -webkit-overflow-scrolling: touch;
  }
}


/* REDESIGN_DONUT_PALETA_SUAVE_V1
   Primeira paleta escolhida.
   Legenda minimalista, sem alterar layout ou dados.
*/

#portfolioReports #reportsValidity
.reports-legend {
  gap: 10px;
}

#portfolioReports #reportsValidity
.reports-legend > div {
  border-radius: 13px;
  border: 1px solid var(--line);
  box-shadow: none;
  transition:
    border-color .18s ease,
    background-color .18s ease;
}

/* Tema claro */

html:not([data-theme="dark"])
#portfolioReports #reportsValidity
.reports-legend > div {
  background: #fafafa;
  border-color: #ebebeb;
  color: #222222;
}

/* Tema escuro */

html[data-theme="dark"]
#portfolioReports #reportsValidity
.reports-legend > div {
  background: #1b1b1b;
  border-color: #303030;
  color: #f0f0f0;
}

/* Marcadores suaves, mantendo a cor
   correspondente a cada segmento. */

#portfolioReports #reportsValidity
.reports-legend i {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  box-shadow: none;
  opacity: 1;
}

/* Valores com alinhamento consistente */

#portfolioReports #reportsValidity
.reports-legend strong {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

/* Interação sutil */

@media (hover: hover) {
  html:not([data-theme="dark"])
  #portfolioReports #reportsValidity
  .reports-legend > div:hover {
    background: #f5f5f5;
    border-color: #dcdcdc;
  }

  html[data-theme="dark"]
  #portfolioReports #reportsValidity
  .reports-legend > div:hover {
    background: #222222;
    border-color: #414141;
  }
}

@media (prefers-reduced-motion: reduce) {
  #portfolioReports #reportsValidity
  .reports-legend > div {
    transition: none;
  }
}


/* ETAPA 7A — resumo da carteira sem acento amarelo */

.hierarchy-summary {
  margin-top: 18px;
}

.hierarchy-summary-cards {
  gap: 14px;
}

.hierarchy-summary-cards .metric,
.hierarchy-summary .metric {
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--line) !important;
  box-shadow: none;
}

html:not([data-theme="dark"]) .hierarchy-summary-cards .metric,
html:not([data-theme="dark"]) .hierarchy-summary .metric {
  background: #ffffff;
  border-color: #26262620;
  color: #111111;
}

html[data-theme="dark"] .hierarchy-summary-cards .metric,
html[data-theme="dark"] .hierarchy-summary .metric {
  background: #101010;
  border-color: #2f2f2f;
  color: #f5f5f5;
}

/* Remove qualquer faixa/acento lateral antigo */
.hierarchy-summary-cards .metric::before,
.hierarchy-summary-cards .metric::after,
.hierarchy-summary .metric::before,
.hierarchy-summary .metric::after {
  content: none !important;
  display: none !important;
}

/* Uniformiza texto */
.hierarchy-summary-cards .metric .metric-copy span,
.hierarchy-summary .metric .metric-copy span {
  color: var(--muted);
  font-weight: 600;
}

.hierarchy-summary-cards .metric .metric-copy strong,
.hierarchy-summary .metric .metric-copy strong {
  color: var(--text);
  font-weight: 650;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

/* Mensagem abaixo dos cards */
#summaryMessage {
  margin-top: 14px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .hierarchy-summary-cards {
    gap: 10px;
  }

  .hierarchy-summary-cards .metric,
  .hierarchy-summary .metric {
    border-radius: 16px;
  }
}


/* REDESIGN_PAINEIS_ALTURA_UNIFORME_V1
   Os três painéis têm a mesma altura no desktop.
   Sem alterações nos gráficos ou nos cálculos.
*/

/* Duas linhas de 450 px. */

@media (min-width: 1181px) {

  #portfolioReports .reports-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    grid-template-rows: 450px 450px;
    align-items: stretch;
    gap: 20px;
  }

  #portfolioReports .reports-grid
  > .reports-panel:nth-child(-n+3) {
    height: 450px;
    min-height: 0;
    box-sizing: border-box;
    align-self: stretch;
  }

  /* O gráfico anual ocupa a primeira linha. */

  #portfolioReports .reports-grid
  > .reports-panel:first-child {
    grid-column: 1 / -1;
  }

  /* Limitar a largura do desenho para
     reduzir sua altura proporcional. */

  #portfolioReports #reportsExpirations
  .reports-line-wrap {
    width: 100%;
    max-width: 980px;
    margin-inline: auto;
    box-sizing: border-box;
  }

  #portfolioReports #reportsExpirations
  .reports-line-chart {
    width: 100%;
    max-width: 940px;
    max-height: 310px;
    height: auto;
    margin-inline: auto;
  }

  /* Manter os painéis inferiores
     proporcionais ao conteúdo. */

  #portfolioReports #reportsValidity
  .reports-donut-layout {
    min-height: 0;
  }
}

/* Tablet e celular:
   os painéis ficam empilhados e assumem
   a altura necessária ao conteúdo. */

@media (max-width: 1180px) {

  #portfolioReports .reports-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    align-items: stretch;
    gap: 16px;
  }

  #portfolioReports .reports-grid
  > .reports-panel {
    grid-column: 1 / -1;
    height: auto;
    min-height: 0;
  }
}


/* REDESIGN_GRAFICO_LARGURA_TOTAL_V1
   Gráfico anual com proporção horizontal.
   Painel de 450 px preservado.
*/

/* Remover o limite de largura anterior. */

#portfolioReports #reportsExpirations
.reports-line-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* A nova proporção do SVG permite
   usar toda a largura sem aumentar
   excessivamente a altura. */

#portfolioReports #reportsExpirations
.reports-line-chart {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  max-height: none;
  height: auto;
  margin: 0;
}

/* No computador, distribuir o gráfico
   por todo o espaço disponível. */

@media (min-width: 901px) {
  #portfolioReports #reportsExpirations
  .reports-line-wrap {
    padding: 0 6px;
    box-sizing: border-box;
  }
}

/* Em telas menores, permitir rolagem
   para que os 12 meses permaneçam legíveis. */

@media (max-width: 900px) {
  #portfolioReports #reportsExpirations
  .reports-line-chart {
    width: 100%;
    min-width: 1000px;
  }

  #portfolioReports #reportsExpirations
  .reports-line-wrap {
    -webkit-overflow-scrolling: touch;
  }
}


/* REDESIGN_RELATORIOS_ALTURA_AJUSTADA_V1
   Ajuste fino das alturas dos quadros da Inteligência da carteira.
   Somente layout.
*/

#portfolioReports .reports-grid {
  align-items: stretch;
  grid-auto-rows: auto;
}

#portfolioReports .reports-panel {
  height: auto !important;
  min-height: 0 !important;
  padding-bottom: 24px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

/* O gráfico superior continua largo,
   porém sem sobrar área vazia embaixo. */
#portfolioReports #reportsExpirations {
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Ajustar o invólucro do gráfico superior */
#portfolioReports #reportsExpirations .reports-line-wrap,
#portfolioReports #reportsExpirations .reports-chart-wrap,
#portfolioReports #reportsExpirations .reports-chart,
#portfolioReports #reportsExpirations svg {
  margin-bottom: 0 !important;
}

/* Os dois quadros de baixo ficam com altura enxuta,
   mas iguais entre si pela própria linha do grid */
#portfolioReports #reportsValidity,
#portfolioReports #reportsStages {
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Evitar sobras internas */
#portfolioReports .reports-panel > *:last-child,
#portfolioReports .reports-panel .reports-donut-layout:last-child,
#portfolioReports .reports-panel .reports-bars:last-child,
#portfolioReports .reports-panel .reports-legend:last-child {
  margin-bottom: 0 !important;
}

/* Ajuste fino do painel de pizza */
#portfolioReports #reportsValidity .reports-donut-layout {
  min-height: 0 !important;
  align-items: center;
}

/* Ajuste fino do painel de etapas */
#portfolioReports #reportsStages .reports-bars {
  margin-bottom: 0 !important;
}

/* Em telas menores, manter comportamento natural */
@media (max-width: 1100px) {
  #portfolioReports .reports-panel {
    height: auto !important;
    min-height: 0 !important;
  }
}


/* REDESIGN_GRID_ALTURA_NATURAL_V2

   Correção da causa do espaço vazio:
   substituir as linhas fixas de 450px
   por linhas ajustadas ao conteúdo.
*/

/* Computador */

@media (min-width: 1181px) {

  #portfolioReports .reports-grid {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    /* Esta é a correção principal. */
    grid-template-rows:
      max-content max-content !important;

    grid-auto-rows: max-content !important;
    align-items: stretch !important;
    gap: 20px;
  }

  #portfolioReports .reports-grid
  > .reports-panel {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
    box-sizing: border-box;
  }

  /* Gráfico anual: primeira linha inteira. */

  #portfolioReports .reports-grid
  > .reports-panel:first-child {
    grid-column: 1 / -1;
  }

  /* Painéis inferiores:
     ambos se estendem até a mesma altura
     determinada pelo maior conteúdo. */

  #portfolioReports .reports-grid
  > .reports-panel:nth-child(2),
  #portfolioReports .reports-grid
  > .reports-panel:nth-child(3) {
    align-self: stretch !important;
    height: auto !important;
  }
}

/* Espaçamento interno:
   manter respiro sem criar altura artificial. */

#portfolioReports .reports-grid
> .reports-panel {
  padding-bottom: 22px !important;
}

/* O gráfico superior não precisa
   de uma altura mínima adicional. */

#portfolioReports #reportsExpirations {
  min-height: 0 !important;
}

/* Tablet e celular:
   uma coluna, altura natural. */

@media (max-width: 1180px) {

  #portfolioReports .reports-grid {
    grid-template-columns:
      minmax(0, 1fr) !important;

    grid-template-rows: none !important;
    grid-auto-rows: max-content !important;
    align-items: stretch !important;
  }

  #portfolioReports .reports-grid
  > .reports-panel {
    grid-column: 1 / -1;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}


/* REDESIGN_RESUMO_ENTRE_KANBAN_RENOVACAO_V1
   Nova posição e cores neutras do resumo.
   Sem alterar os indicadores ou seus cálculos.
*/

#view-carteira .hierarchy-summary {
  width: 100%;
  min-width: 0;
  margin: 26px 0;
}

/* Filtros de mês e ano */

#view-carteira .hierarchy-summary
.summary-period {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

#view-carteira .hierarchy-summary
.summary-period .field {
  min-width: 0;
  flex: 0 1 240px;
  gap: 8px;
}

#view-carteira .hierarchy-summary
.summary-period select {
  min-height: 48px;
  border-radius: 13px;
  font-weight: 500;
  box-shadow: none;
}

html:not([data-theme="dark"])
#view-carteira .hierarchy-summary
.summary-period select {
  background: #f7f7f7 !important;
  color: #111111 !important;
  border: 1px solid #dedede !important;
}

html[data-theme="dark"]
#view-carteira .hierarchy-summary
.summary-period select {
  background: #1d1d1d !important;
  color: #f5f5f5 !important;
  border: 1px solid #383838 !important;
}

/* Quatro indicadores */

#view-carteira .hierarchy-summary-cards {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 14px;
}

#view-carteira .hierarchy-summary-cards
.metric {
  min-width: 0;
  min-height: 130px;
  padding: 22px;
  border-radius: 19px;
  border-left-width: 1px !important;
  box-shadow: none;
}

html:not([data-theme="dark"])
#view-carteira .hierarchy-summary-cards
.metric {
  background: #ffffff;
  border-color: #e8e8e8;
}

html[data-theme="dark"]
#view-carteira .hierarchy-summary-cards
.metric {
  background: #171717;
  border-color: #303030;
}

/* Garantir que a faixa amarela antiga
   continue desativada. */

#view-carteira .hierarchy-summary-cards
.metric::before,
#view-carteira .hierarchy-summary-cards
.metric::after {
  content: none !important;
  display: none !important;
}

/* Textos e números */

#view-carteira .hierarchy-summary-cards
.metric strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

html:not([data-theme="dark"])
#view-carteira .hierarchy-summary-cards
.metric {
  color: #111111;
}

html[data-theme="dark"]
#view-carteira .hierarchy-summary-cards
.metric {
  color: #f5f5f5;
}

html:not([data-theme="dark"])
#view-carteira .hierarchy-summary-cards
.metric .metric-copy span {
  color: #666666;
}

html[data-theme="dark"]
#view-carteira .hierarchy-summary-cards
.metric .metric-copy span {
  color: #aaaaaa;
}

#view-carteira #summaryMessage {
  margin: 14px 2px 0;
  color: var(--muted);
}

/* Tablet */

@media (max-width: 1100px) {
  #view-carteira .hierarchy-summary-cards {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

/* Celular */

@media (max-width: 600px) {
  #view-carteira .hierarchy-summary {
    margin: 22px 0;
  }

  #view-carteira .hierarchy-summary
  .summary-period .field {
    flex: 1 1 145px;
  }

  #view-carteira .hierarchy-summary-cards {
    gap: 10px;
  }

  #view-carteira .hierarchy-summary-cards
  .metric {
    min-height: 112px;
    padding: 16px;
    border-radius: 15px;
  }
}

@media (max-width: 390px) {
  #view-carteira .hierarchy-summary-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* REDESIGN_ETAPA_7B_CARTEIRA_RENOVACAO
   Acabamento visual da Carteira & Renovação.
   Nenhuma funcionalidade modificada.
*/

/* Painel principal */

html:not([data-theme="dark"])
section.renewal-dark-panel {
  background: #ffffff !important;
  color: #111111;
  border: 1px solid #e8e8e8 !important;
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(0,0,0,.035);
}

html[data-theme="dark"]
section.renewal-dark-panel {
  background: #101010 !important;
  color: #f5f5f5;
  border: 1px solid #303030 !important;
  border-radius: 22px;
  box-shadow: none;
}

/* Títulos e textos */

section.renewal-dark-panel h2,
section.renewal-dark-panel h3 {
  letter-spacing: -.035em;
  line-height: 1.2;
}

html:not([data-theme="dark"])
section.renewal-dark-panel h2,
html:not([data-theme="dark"])
section.renewal-dark-panel h3 {
  color: #111111 !important;
}

html[data-theme="dark"]
section.renewal-dark-panel h2,
html[data-theme="dark"]
section.renewal-dark-panel h3 {
  color: #ffffff !important;
}

/* Indicadores */

section.renewal-dark-panel .renewal-stats {
  gap: 14px;
}

section.renewal-dark-panel .renewal-stat {
  min-width: 0;
  border-radius: 18px;
  padding: 20px;
  box-shadow: none;
  border-left-width: 1px;
  transition:
    border-color .2s ease,
    background-color .2s ease;
}

html:not([data-theme="dark"])
section.renewal-dark-panel .renewal-stat {
  background: #f8f8f8 !important;
  border: 1px solid #e8e8e8 !important;
  color: #666666 !important;
}

html[data-theme="dark"]
section.renewal-dark-panel .renewal-stat {
  background: #1b1b1b !important;
  border: 1px solid #353535 !important;
  color: #aaaaaa !important;
}

section.renewal-dark-panel .renewal-stat strong {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: 1.1;
}

html:not([data-theme="dark"])
section.renewal-dark-panel .renewal-stat strong {
  color: #111111 !important;
}

html[data-theme="dark"]
section.renewal-dark-panel .renewal-stat strong {
  color: #ffffff !important;
}

/* Remover apenas possíveis faixas decorativas
   dos indicadores dessa seção. */

section.renewal-dark-panel
.renewal-stat::before,
section.renewal-dark-panel
.renewal-stat::after {
  content: none !important;
  display: none !important;
}

/* Campos e filtros */

section.renewal-dark-panel
.portfolio-actions {
  gap: 12px;
}

section.renewal-dark-panel
.portfolio-actions .field {
  gap: 7px;
}

section.renewal-dark-panel
.portfolio-actions input,
section.renewal-dark-panel
.portfolio-actions select {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: none;
}

html:not([data-theme="dark"])
section.renewal-dark-panel
.portfolio-actions input,
html:not([data-theme="dark"])
section.renewal-dark-panel
.portfolio-actions select {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #dedede !important;
}

html[data-theme="dark"]
section.renewal-dark-panel
.portfolio-actions input,
html[data-theme="dark"]
section.renewal-dark-panel
.portfolio-actions select {
  background: #202020 !important;
  color: #f5f5f5 !important;
  border-color: #414141 !important;
}

/* Rótulos dos filtros */

html:not([data-theme="dark"])
section.renewal-dark-panel
.portfolio-actions .field {
  color: #555555;
}

html[data-theme="dark"]
section.renewal-dark-panel
.portfolio-actions .field {
  color: #bbbbbb;
}

/* Botões da seção */

section.renewal-dark-panel .btn {
  border-radius: 12px;
}

/* Foco para navegação por teclado */

section.renewal-dark-panel
input:focus-visible,
section.renewal-dark-panel
select:focus-visible,
section.renewal-dark-panel
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Telas menores */

@media (max-width: 720px) {
  section.renewal-dark-panel {
    border-radius: 18px;
  }

  section.renewal-dark-panel
  .renewal-stats {
    gap: 10px;
  }

  section.renewal-dark-panel
  .renewal-stat {
    padding: 16px;
    border-radius: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  section.renewal-dark-panel
  .renewal-stat {
    transition: none;
  }
}


/* REDESIGN_ETAPA_7C_TELAS_RESPONSIVIDADE
   Escritórios, Pedidos, Comissões e Administração.
   Acabamento visual e responsividade.
   Nenhuma lógica modificada.
*/

/* 1. Cabeçalhos das telas administrativas */

#view-escritorios .view-head,
#view-pedidos .view-head,
#view-comissoes .view-head,
#view-administracao .view-head {
  gap: 16px;
  margin-bottom: 24px;
}

#view-escritorios .view-head h1,
#view-pedidos .view-head h1,
#view-comissoes .view-head h1,
#view-administracao .view-head h1 {
  letter-spacing: -.045em;
  line-height: 1.2;
}

/* 2. Cartões de gerenciamento */

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .management-card {
  min-width: 0;
  border-radius: 20px;
  box-shadow: none;
}

html:not([data-theme="dark"])
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .management-card {
  background: #ffffff;
  border: 1px solid #e8e8e8;
}

html[data-theme="dark"]
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .management-card {
  background: #141414;
  border: 1px solid #303030;
}

/* Títulos internos */

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .management-card h2 {
  font-weight: 650;
  letter-spacing: -.03em;
  line-height: 1.3;
}

html:not([data-theme="dark"])
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .management-card h2 {
  color: #111111;
}

html[data-theme="dark"]
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .management-card h2 {
  color: #ffffff;
}

/* 3. Tabelas: manter rolagem horizontal
   e evitar cortes de colunas. */

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 13px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

html:not([data-theme="dark"])
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .table-scroll {
  border-color: #e8e8e8;
}

html[data-theme="dark"]
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .table-scroll {
  border-color: #333333;
}

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .base-table th {
  font-weight: 650;
  letter-spacing: .035em;
}

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .base-table td {
  line-height: 1.5;
}

/* Os botões de ação não devem encolher
   até ficarem ilegíveis. */

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .row-actions {
  gap: 7px;
}

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .row-actions .btn {
  min-height: 36px;
  border-radius: 10px;
}

/* 4. Filtros dos escritórios e resumos */

#view-escritorios .hierarchy-toolbar {
  border-radius: 17px;
  box-shadow: none;
}

html:not([data-theme="dark"])
#view-escritorios .hierarchy-toolbar {
  background: #fafafa;
  border-color: #e8e8e8;
}

html[data-theme="dark"]
#view-escritorios .hierarchy-toolbar {
  background: #191919;
  border-color: #333333;
}

/* 5. Textos auxiliares */

html:not([data-theme="dark"])
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .small-note {
  color: #666666;
}

html[data-theme="dark"]
:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) .small-note {
  color: #b5b5b5;
}

/* 6. Foco visível nos controles */

:is(
  #view-escritorios,
  #view-pedidos,
  #view-comissoes,
  #view-administracao
) :is(
  button,
  a,
  input,
  select,
  textarea
):focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* 7. Tablet */

@media (max-width: 1100px) {
  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .management-card {
    padding: 20px;
  }
}

/* 8. Celular */

@media (max-width: 720px) {
  #crmNav {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .view-head {
    gap: 14px;
    margin-bottom: 20px;
  }

  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .view-head h1 {
    font-size: clamp(23px, 6vw, 29px);
  }

  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .management-card {
    min-width: 0;
    padding: 16px;
    border-radius: 16px;
  }

  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .base-table {
    font-size: 12px;
  }

  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .base-table td,
  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .base-table th {
    padding: 11px 10px;
  }

  #view-escritorios .hierarchy-toolbar {
    padding: 14px;
  }

  #view-escritorios
  .hierarchy-toolbar .field {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}

/* 9. Movimento reduzido */

@media (prefers-reduced-motion: reduce) {
  :is(
    #view-escritorios,
    #view-pedidos,
    #view-comissoes,
    #view-administracao
  ) .management-card {
    transition: none;
  }
}


/* ETAPA 7E — Tabela de clientes: botões e alinhamento */

/* Melhor alinhamento geral da tabela */
.base-table td {
  vertical-align: middle;
}

#portfolioRows td {
  padding-top: 22px;
  padding-bottom: 22px;
}

#portfolioRows td:last-child {
  min-width: 460px;
}

/* Bloco principal da coluna Ações */
#portfolioRows .base-stage-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  width: 100%;
}

/* Linha superior: contato + ações */
#portfolioRows .base-stage-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: nowrap;
}

/* Coluna de contato */
#portfolioRows .client-contact-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 176px;
  flex: 0 0 176px;
}

#portfolioRows .client-contact-btn {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
  box-sizing: border-box;
}

/* Botões de contato — tema claro */
html:not([data-theme="dark"]) #portfolioRows .client-contact-email {
  background: #eef4fb;
  color: #18324f !important;
  border: 1px solid #cfdceb;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

html:not([data-theme="dark"]) #portfolioRows .client-contact-whatsapp {
  background: #edf6f0;
  color: #204a33 !important;
  border: 1px solid #cfe2d5;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Botões de contato — tema escuro */
html[data-theme="dark"] #portfolioRows .client-contact-email {
  background: linear-gradient(180deg, #314c6f 0%, #2a4363 100%);
  color: #eef6ff !important;
  border: 1px solid rgba(138,170,214,.36);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 8px 20px rgba(0,0,0,.18);
}

html[data-theme="dark"] #portfolioRows .client-contact-whatsapp {
  background: linear-gradient(180deg, #21624c 0%, #184f3d 100%);
  color: #effff6 !important;
  border: 1px solid rgba(116,196,159,.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 8px 20px rgba(0,0,0,.18);
}

/* Estado desabilitado */
#portfolioRows .client-contact-disabled {
  background: #2a2a2a;
  color: #8f8f8f !important;
  border: 1px solid #3a3a3a;
  cursor: not-allowed;
  box-shadow: none;
}

html:not([data-theme="dark"]) #portfolioRows .client-contact-disabled {
  background: #f2f2f2;
  color: #8a8a8a !important;
  border: 1px solid #dddddd;
}

/* Hover/focus */
#portfolioRows .client-contact-btn:hover,
#portfolioRows .row-actions .btn:hover,
#portfolioRows .quick-new-lead:hover {
  transform: translateY(-1px);
}

#portfolioRows .client-contact-btn:focus-visible,
#portfolioRows .row-actions .btn:focus-visible,
#portfolioRows .quick-new-lead:focus-visible,
#portfolioRows .quick-stage:focus-visible {
  outline: 2px solid #69a7ff;
  outline-offset: 2px;
}

/* Coluna de botões de ação */
#portfolioRows .row-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(132px, 1fr));
  gap: 12px;
  align-items: stretch;
  min-width: 420px;
}

/* Botão Novo Lead ocupa linha própria à esquerda */
#portfolioRows .quick-new-lead {
  min-width: 132px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  white-space: nowrap;
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

/* Ações padrão */
#portfolioRows .row-actions .btn {
  min-height: 54px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  padding: 0 18px;
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

/* Tema claro */
html:not([data-theme="dark"]) #portfolioRows .quick-new-lead {
  background: #e8f5ee;
  color: #14452f;
  border: 1px solid #c9e3d6;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

html:not([data-theme="dark"]) #portfolioRows .row-actions .btn {
  background: #ffffff;
  color: #161616;
  border: 1px solid #dddddd;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Tema escuro */
html[data-theme="dark"] #portfolioRows .quick-new-lead {
  background: linear-gradient(180deg, #165342 0%, #134638 100%);
  color: #dff8ef;
  border: 1px solid rgba(79,177,139,.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 8px 18px rgba(0,0,0,.18);
}

html[data-theme="dark"] #portfolioRows .row-actions .btn {
  background: linear-gradient(180deg, #1d1d1f 0%, #171719 100%);
  color: #f5f5f7;
  border: 1px solid #343438;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 8px 18px rgba(0,0,0,.14);
}

/* Remover com destaque mais elegante */
html[data-theme="dark"] #portfolioRows .row-actions .btn:last-child {
  background: linear-gradient(180deg, #4a2328 0%, #3d1d22 100%);
  color: #ffbcbc;
  border-color: rgba(255,134,134,.28);
}

html:not([data-theme="dark"]) #portfolioRows .row-actions .btn:last-child {
  background: #fff4f4;
  color: #a33c3c;
  border-color: #efcaca;
}

/* Select da etapa */
#portfolioRows .quick-stage {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  box-sizing: border-box;
}

html[data-theme="dark"] #portfolioRows .quick-stage {
  background: #11253a;
  color: #f5f7fb;
  border: 1px solid #21415f;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 8px 18px rgba(0,0,0,.14);
}

html:not([data-theme="dark"]) #portfolioRows .quick-stage {
  background: #f8fbff;
  color: #1a2530;
  border: 1px solid #d8e2ee;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Ajuste para telas médias */
@media (max-width: 1400px) {
  #portfolioRows td:last-child {
    min-width: 400px;
  }

  #portfolioRows .base-stage-buttons {
    gap: 14px;
  }

  #portfolioRows .client-contact-actions {
    width: 160px;
    flex-basis: 160px;
  }

  #portfolioRows .row-actions {
    grid-template-columns: repeat(2, minmax(132px, 1fr));
    min-width: 290px;
  }
}

/* Ajuste para telas menores */
@media (max-width: 1100px) {
  #portfolioRows td:last-child {
    min-width: 340px;
  }

  #portfolioRows .base-stage-buttons {
    flex-direction: column;
    gap: 14px;
  }

  #portfolioRows .client-contact-actions {
    width: 100%;
    flex: none;
  }

  #portfolioRows .row-actions {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* REDESIGN_ETAPA_7E_COMPACTA_V2
   Correção dos tamanhos, cores e alinhamentos.
   Mantém todas as funcionalidades existentes.
*/

/* Tabela mais compacta */

#portfolioRows td {
  vertical-align: middle;
  padding-top: 15px;
  padding-bottom: 15px;
}

/* Desfazer a largura exagerada anterior */

#portfolioRows td:last-child {
  min-width: 0;
}

#portfolioRows .base-stage-actions {
  width: 100%;
  gap: 10px;
}

#portfolioRows .base-stage-buttons {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

/* Contato */

#portfolioRows .client-contact-actions {
  display: flex;
  flex-direction: column;
  flex: 0 0 120px;
  width: 120px;
  gap: 8px;
}

#portfolioRows .client-contact-btn {
  width: 100%;
  min-height: 39px;
  height: 39px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: none;
  transform: none;
}

/* Ícones locais ao lado dos nomes */

#portfolioRows
.client-contact-email::before,
#portfolioRows
.client-contact-whatsapp::before {
  content: "";
  display: block;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

#portfolioRows
.client-contact-email::before {
  background-image: url("contact-gmail.svg");
}

#portfolioRows
.client-contact-whatsapp::before {
  background-image: url("contact-whatsapp.svg");
}

/* Tema escuro: contatos neutros */

html[data-theme="dark"]
#portfolioRows .client-contact-email,
html[data-theme="dark"]
#portfolioRows .client-contact-whatsapp {
  background: #252525;
  color: #f1f1f1 !important;
  border: 1px solid #424242;
  box-shadow: none;
}

/* Tema claro: contatos neutros */

html:not([data-theme="dark"])
#portfolioRows .client-contact-email,
html:not([data-theme="dark"])
#portfolioRows .client-contact-whatsapp {
  background: #ffffff;
  color: #222222 !important;
  border: 1px solid #dedede;
  box-shadow: none;
}

/* Ações: tamanhos menores e proporcionais */

#portfolioRows .row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  min-width: 0;
}

#portfolioRows .quick-new-lead,
#portfolioRows .row-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 39px;
  height: 39px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
}

/* Remover o excesso de cores */

html[data-theme="dark"]
#portfolioRows .quick-new-lead,
html[data-theme="dark"]
#portfolioRows .row-actions .btn {
  background: #252525;
  color: #f1f1f1;
  border: 1px solid #424242;
  box-shadow: none;
}

html:not([data-theme="dark"])
#portfolioRows .quick-new-lead,
html:not([data-theme="dark"])
#portfolioRows .row-actions .btn {
  background: #ffffff;
  color: #222222;
  border: 1px solid #dedede;
  box-shadow: none;
}

/* Remover: destaque de risco discreto */

html[data-theme="dark"]
#portfolioRows .row-actions .btn:last-child {
  background: #302224;
  color: #e8a2a7;
  border-color: #654044;
}

html:not([data-theme="dark"])
#portfolioRows .row-actions .btn:last-child {
  background: #fff5f5;
  color: #a34750;
  border-color: #e9ced1;
}

/* Seletor de etapa neutro */

#portfolioRows .quick-stage {
  width: 100%;
  min-width: 0;
  min-height: 41px;
  height: 41px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

html[data-theme="dark"]
#portfolioRows .quick-stage {
  background: #252525;
  color: #f1f1f1;
  border: 1px solid #424242;
  box-shadow: none;
}

html:not([data-theme="dark"])
#portfolioRows .quick-stage {
  background: #ffffff;
  color: #222222;
  border: 1px solid #dedede;
  box-shadow: none;
}

/* Interações discretas */

@media (hover: hover) {
  #portfolioRows .client-contact-btn:hover,
  #portfolioRows .quick-new-lead:hover,
  #portfolioRows .row-actions .btn:hover {
    transform: translateY(-1px);
  }
}

#portfolioRows .client-contact-btn:focus-visible,
#portfolioRows .quick-new-lead:focus-visible,
#portfolioRows .row-actions .btn:focus-visible,
#portfolioRows .quick-stage:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Evitar que os botões cresçam nas telas menores */

@media (max-width: 1100px) {
  #portfolioRows td:last-child {
    min-width: 0;
  }

  #portfolioRows .base-stage-buttons {
    flex-direction: column;
    gap: 9px;
  }

  #portfolioRows .client-contact-actions {
    width: 120px;
    flex: none;
  }

  #portfolioRows .row-actions {
    width: auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #portfolioRows .client-contact-btn,
  #portfolioRows .quick-new-lead,
  #portfolioRows .row-actions .btn {
    transition: none;
    transform: none;
  }
}


/* REDESIGN_ETAPA_7E_BOTOES_MESMA_LINHA_V3
   Quatro botões de ação em uma única linha.
   Seletor da etapa permanece abaixo.
*/

/* Evitar que a coluna de ações
   comprima os botões até quebrarem. */

#portfolioRows td:last-child {
  min-width: 0;
}

#portfolioRows .base-stage-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: max-content;
  min-width: 100%;
  max-width: none;
}

/* A área de contato continua separada
   do grupo dos quatro botões. */

#portfolioRows .base-stage-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  width: max-content;
  max-width: none;
}

/* Esta é a correção principal:
   impedir a quebra entre os quatro botões. */

#portfolioRows .row-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;
}

/* Todos os botões ocupam apenas
   o espaço necessário para seus textos. */

#portfolioRows .row-actions > *,
#portfolioRows .row-actions .btn,
#portfolioRows .quick-new-lead {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box;
}

/* Proporções compactas e uniformes. */

#portfolioRows .quick-new-lead,
#portfolioRows .row-actions .btn {
  min-height: 38px;
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

/* O seletor da etapa fica logo
   abaixo da linha de ações. */

#portfolioRows .quick-stage {
  min-height: 40px;
  height: 40px;
  border-radius: 10px;
  margin-top: 0;
}

/* As tabelas podem rolar horizontalmente
   sem cortar as ações. */

.table-scroll:has(#portfolioRows) {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

/* Sobrescrever também a regra antiga
   para telas menores, que empilhava ações. */

@media (max-width: 1100px) {
  #portfolioRows .base-stage-buttons {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }

  #portfolioRows .row-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: max-content !important;
  }
}


/* REDESIGN_ETAPA_7E4_AJUSTE_FINO_TABELA
   Ajuste fino dos botões da tabela de clientes.
   Apenas visual.
*/

/* Coluna de contato */
#portfolioRows td:nth-child(6) {
  vertical-align: middle;
}

#portfolioRows .client-contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

#portfolioRows .client-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 180px;
  min-width: 180px;
  height: 58px;
  min-height: 58px;
  padding: 0 16px;
  box-sizing: border-box;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

#portfolioRows .client-contact-btn span:last-child {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

#portfolioRows .contact-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}

#portfolioRows .contact-icon svg {
  display: block;
}

#portfolioRows .client-contact-email {
  color: #f5f5f5 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border-color: rgba(255,255,255,.11);
}

#portfolioRows .client-contact-whatsapp {
  color: #f5f5f5 !important;
  background: linear-gradient(180deg, rgba(87,214,141,.10), rgba(87,214,141,.05));
  border-color: rgba(87,214,141,.24);
}

#portfolioRows .client-contact-disabled {
  color: rgba(255,255,255,.50) !important;
  border-color: rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  cursor: not-allowed;
  opacity: .72;
}

/* Coluna de ações */
#portfolioRows td:last-child {
  vertical-align: middle;
}

#portfolioRows .base-stage-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

#portfolioRows .base-stage-buttons {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

#portfolioRows .row-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 14px !important;
  min-width: 0;
  width: auto;
}

#portfolioRows .quick-new-lead,
#portfolioRows .row-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  height: 56px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  min-width: 0 !important;
  width: auto !important;
}

/* Mesmo espaçamento visual entre todos */
#portfolioRows .quick-new-lead {
  margin: 0 !important;
}

#portfolioRows .row-actions .btn {
  margin: 0 !important;
}

/* Select abaixo, alinhado */
#portfolioRows .quick-stage {
  width: 100%;
  min-height: 60px;
  height: 60px;
  border-radius: 18px;
  font-size: 15px;
  padding-inline: 18px;
}

/* Estado desabilitado mais discreto */
#portfolioRows .quick-new-lead:disabled,
#portfolioRows .row-actions .btn:disabled {
  opacity: .48;
}

/* Ajuste responsivo sem quebrar o alinhamento */
@media (max-width: 1400px) {
  #portfolioRows .client-contact-btn {
    width: 168px;
    min-width: 168px;
    height: 54px;
    min-height: 54px;
    font-size: 15px;
  }

  #portfolioRows .quick-new-lead,
  #portfolioRows .row-actions .btn {
    height: 52px;
    min-height: 52px;
    padding: 0 16px;
    font-size: 14px;
  }

  #portfolioRows .quick-stage {
    min-height: 56px;
    height: 56px;
    font-size: 14px;
  }
}


/* REDESIGN_ETAPA_7E5_COMPACTAR_BOTOES
   Ajuste final compacto da tabela de clientes.
*/

#portfolioRows .client-contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

#portfolioRows .client-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 148px;
  min-width: 148px;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

#portfolioRows .contact-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

#portfolioRows .client-contact-email {
  color: #f3f3f3 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border-color: rgba(255,255,255,.09);
}

#portfolioRows .client-contact-whatsapp {
  color: #f3f3f3 !important;
  background: linear-gradient(180deg, rgba(87,214,141,.09), rgba(87,214,141,.04));
  border-color: rgba(87,214,141,.20);
}

#portfolioRows .client-contact-disabled {
  color: rgba(255,255,255,.46) !important;
  border-color: rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  cursor: not-allowed;
  opacity: .75;
}

/* Bloco de ações: menor distância possível sem grudar */
#portfolioRows .base-stage-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

#portfolioRows .base-stage-buttons {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

#portfolioRows .row-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: auto;
  min-width: 0;
}

#portfolioRows .quick-new-lead,
#portfolioRows .row-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  min-width: 0 !important;
  width: auto !important;
  margin: 0 !important;
}

#portfolioRows .quick-stage {
  width: 100%;
  min-height: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 12px;
  padding-inline: 14px;
}

/* contato e ações mais alinhados no centro da célula */
#portfolioRows td:nth-child(6),
#portfolioRows td:last-child {
  vertical-align: middle;
}

@media (max-width: 1400px) {
  #portfolioRows .client-contact-btn {
    width: 138px;
    min-width: 138px;
    font-size: 11.5px;
  }

  #portfolioRows .quick-new-lead,
  #portfolioRows .row-actions .btn {
    padding: 0 12px;
    font-size: 11.5px;
  }
}


/* REDESIGN_ETAPA_7E6_FINAL_COMPACTO
   Remover ícones duplicados.
   Compactar contato e ações.
   Nenhum JavaScript alterado.
*/

/* Remover os ícones antigos do CSS.
   Preservar o SVG inserido dentro de cada botão. */

#portfolioRows
.client-contact-email::before,
#portfolioRows
.client-contact-whatsapp::before {
  content: none !important;
  display: none !important;
  background-image: none !important;
}

/* Coluna de contato */

#portfolioRows .client-contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 126px !important;
  min-width: 126px;
  flex: 0 0 126px;
  gap: 7px;
}

#portfolioRows .client-contact-btn {
  width: 126px !important;
  min-width: 126px !important;
  height: 37px !important;
  min-height: 37px !important;
  padding: 0 9px !important;
  border-radius: 10px;
  gap: 7px;
  font-size: 12px !important;
  font-weight: 600;
  box-shadow: none;
}

#portfolioRows .contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

#portfolioRows .contact-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* Ações: distância mínima e uniforme */

#portfolioRows .base-stage-actions {
  gap: 7px !important;
}

#portfolioRows .base-stage-buttons {
  display: flex;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 6px !important;
  width: max-content;
}

#portfolioRows .row-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 6px !important;
  width: max-content !important;
  min-width: max-content !important;
}

#portfolioRows .quick-new-lead,
#portfolioRows .row-actions .btn {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 37px !important;
  min-height: 37px !important;
  padding: 0 10px !important;
  border-radius: 10px;
  font-size: 12px !important;
  font-weight: 600;
  margin: 0 !important;
  white-space: nowrap;
  box-shadow: none;
}

/* Seletor logo abaixo dos botões */

#portfolioRows .quick-stage {
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 10px;
  padding: 0 11px !important;
  font-size: 12px !important;
}

/* Não aumentar os controles em telas menores. */

@media (max-width: 1400px) {
  #portfolioRows .client-contact-actions,
  #portfolioRows .client-contact-btn {
    width: 126px !important;
    min-width: 126px !important;
  }

  #portfolioRows .quick-new-lead,
  #portfolioRows .row-actions .btn {
    height: 37px !important;
    min-height: 37px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 1100px) {
  #portfolioRows .base-stage-buttons {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
}


/* REDESIGN_CONTATO_MONOCROMATICO_V1
   Ícones alinhados à esquerda.
   Brancos no tema escuro e pretos no claro.
   Mantém tamanhos e funcionalidades.
*/

/* Dois botões alinhados pela borda esquerda */

#portfolioRows .client-contact-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: center;
  gap: 7px;
  width: 126px !important;
  min-width: 126px !important;
}

/* Conteúdo alinhado à esquerda */

#portfolioRows .client-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start !important;
  text-align: left;
  gap: 9px !important;

  width: 126px !important;
  min-width: 126px !important;
  height: 37px !important;
  min-height: 37px !important;

  padding: 0 13px !important;
  box-sizing: border-box;
}

/* Um único ícone, sempre na mesma posição */

#portfolioRows .client-contact-btn
.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
}

#portfolioRows .client-contact-btn
.contact-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* Manter os ícones antigos do CSS ocultos */

#portfolioRows
.client-contact-email::before,
#portfolioRows
.client-contact-whatsapp::before {
  content: none !important;
  display: none !important;
}

/* Tema escuro: ambos os ícones brancos */

html[data-theme="dark"]
#portfolioRows .client-contact-btn
.contact-icon svg {
  filter: brightness(0) invert(1) !important;
  opacity: .95;
}

/* Tema claro: ambos os ícones pretos */

html:not([data-theme="dark"])
#portfolioRows .client-contact-btn
.contact-icon svg {
  filter: brightness(0) !important;
  opacity: .92;
}

/* Fundos neutros nos dois temas */

html[data-theme="dark"]
#portfolioRows .client-contact-btn:not(
  .client-contact-disabled
) {
  background: #252525;
  color: #f5f5f5 !important;
  border-color: #424242;
}

html:not([data-theme="dark"])
#portfolioRows .client-contact-btn:not(
  .client-contact-disabled
) {
  background: #ffffff;
  color: #111111 !important;
  border-color: #dedede;
}

/* Texto na mesma linha e sem deslocamentos */

#portfolioRows .client-contact-btn
span:last-child {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
}

/* Em telas menores, preservar as proporções */

@media (max-width: 1400px) {
  #portfolioRows .client-contact-actions,
  #portfolioRows .client-contact-btn {
    width: 126px !important;
    min-width: 126px !important;
  }
}


/* REDESIGN_LOGO_ADAPTATIVA_V3
   Sem cartão branco, deslocamento ou recorte.
   Tema escuro: marca branca.
   Tema claro: cores originais.
*/

/* Eliminar a placa branca do cabeçalho. */

.topbar .brand-link {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;

  width: 245px !important;
  height: 62px !important;
  aspect-ratio: auto !important;
  flex: 0 0 auto !important;

  margin: 0 !important;
  padding: 0 !important;

  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;

  overflow: visible !important;
}

/* Restaurar o posicionamento natural da imagem.
   As regras antigas ampliavam e cortavam a logo. */

.topbar .brand-link img.brand-logo {
  position: static !important;
  inset: auto !important;

  display: block !important;

  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 62px !important;

  margin: 0 !important;
  padding: 0 !important;

  transform: none !important;

  object-fit: contain !important;
  object-position: left center !important;

  background: transparent !important;
  background-image: none !important;

  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Tema claro: identidade original. */

html:not([data-theme="dark"])
.topbar .brand-link img.brand-logo {
  filter: none !important;
}

/* Tema escuro: imagem inteiramente branca,
   mantendo a transparência existente. */

html[data-theme="dark"]
.topbar .brand-link img.brand-logo {
  filter: brightness(0) invert(1) !important;
}

/* Hover discreto, sem sombra ou movimento. */

.topbar .brand-link:hover {
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: .88;
}

/* Celular */

@media (max-width: 720px) {
  .topbar .brand-link {
    width: 164px !important;
    height: 44px !important;
  }

  .topbar .brand-link img.brand-logo {
    max-height: 44px !important;
  }
}


/* REDESIGN_MENU_HORIZONTAL_CORRIGIDO_V3
   Logo, menu e conta em uma única barra.
   Nenhuma lógica de navegação modificada.
*/

.topbar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;

  gap: clamp(10px, 1.2vw, 20px);

  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* 1. Logo à esquerda */

.topbar > .brand {
  order: 1 !important;
  flex: 0 0 auto !important;
  min-width: 0;
}

/* 2. Menu horizontal no centro */

.topbar > #crmNav {
  order: 2 !important;

  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;

  align-items: center !important;
  justify-content: flex-start !important;

  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;

  gap: 4px !important;

  margin: 0 !important;
  padding: 0 !important;

  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;

  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;

  overflow-x: auto !important;
  overflow-y: hidden !important;

  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.topbar > #crmNav::-webkit-scrollbar {
  display: none;
}

/* Botões na mesma linha, sem quebra */

.topbar > #crmNav button[data-view] {
  display: inline-flex !important;

  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;

  gap: 7px !important;

  min-height: 40px;
  padding: 9px 11px !important;
  margin: 0 !important;

  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;

  white-space: nowrap !important;
}

.topbar > #crmNav
button[data-view] svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* 3. Conta e alternância de tema
   permanecem à direita */

.topbar > .account {
  order: 3 !important;

  display: flex !important;
  align-items: center !important;

  flex: 0 0 auto !important;
  margin-left: auto !important;

  min-width: 0;
}

/* Tema claro */

html:not([data-theme="dark"])
.topbar > #crmNav button[data-view] {
  color: #555555;
}

html:not([data-theme="dark"])
.topbar > #crmNav
button[data-view][aria-current="page"] {
  background: #171717;
  color: #ffffff;
}

/* Tema escuro */

html[data-theme="dark"]
.topbar > #crmNav button[data-view] {
  color: #b5b5b5;
}

html[data-theme="dark"]
.topbar > #crmNav
button[data-view][aria-current="page"] {
  background: #ffffff;
  color: #111111;
}

/* Telas menores:
   o menu permanece horizontal
   e permite rolagem lateral. */

@media (max-width: 1100px) {
  .topbar {
    gap: 10px;
  }

  .topbar > #crmNav {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }

  .topbar > #crmNav button[data-view] {
    padding: 9px 10px !important;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: nowrap !important;
    gap: 8px;
    padding: 10px 12px;
  }

  .topbar .brand-link {
    width: clamp(
      105px,
      30vw,
      150px
    ) !important;
  }

  .topbar > #crmNav {
    min-width: 45px !important;
  }

  .topbar > #crmNav button[data-view] {
    min-height: 38px;
    font-size: 12px;
  }

  .topbar .account-copy {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }

  .topbar > .account {
    gap: 5px;
    margin-left: 0 !important;
  }
}


/* TOPBAR_REORDER_THEME_AND_REMOVE_CRM_PARCEIROS_V1
   - Remove "CRM PARCEIROS"
   - Reorganiza o bloco final da conta
   - Mantém tema e sair no extremo direito
*/

/* 1) Remover o texto secundário da marca */
.topbar .brand-copy {
  display: none !important;
}

/* Ajuste fino de espaço da marca */
.topbar > .brand {
  gap: 10px !important;
}

/* 2) Organizar a área da conta no canto direito */
.topbar > .account {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-left: auto !important;
  min-width: 0;
}

/* Ordem visual do bloco da direita */
.topbar > .account #accountAvatar {
  order: 1 !important;
}

.topbar > .account .account-copy {
  order: 2 !important;
  text-align: right !important;
  min-width: max-content;
}

.topbar > .account #themeToggle {
  order: 3 !important;
  margin-left: 4px !important;
}

.topbar > .account #logoutBtn {
  order: 4 !important;
  margin-left: 2px !important;
  margin-right: 0 !important;
}

/* Mantém os dois botões finais bem encaixados no canto */
.topbar > .account #themeToggle,
.topbar > .account #logoutBtn {
  flex: 0 0 auto !important;
}

/* Se quiser o bloco de texto um pouco mais compacto */
.topbar > .account .account-copy strong {
  margin: 0 !important;
}

.topbar > .account .account-copy span {
  margin-top: 2px !important;
}

/* Mobile */
@media (max-width: 720px) {
  .topbar .brand-copy {
    display: none !important;
  }

  .topbar > .account {
    gap: 8px !important;
  }

  .topbar > .account .account-copy {
    display: none !important;
  }
}


/* AJUSTE FINAL DO CABEÇALHO: ordem da conta e sem avatar */
.topbar .account {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.topbar .account-copy {
  order: 1;
  text-align: right;
  min-width: max-content;
}

.topbar #logoutBtn {
  order: 2;
}

.topbar #themeToggle {
  order: 3;
  margin-right: 0;
}

.topbar .avatar,
.topbar #accountAvatar {
  display: none !important;
}

.topbar .account-copy strong {
  margin: 0;
  line-height: 1.1;
}

.topbar .account-copy span {
  display: block;
  margin-top: 4px;
  line-height: 1.1;
}

@media (max-width: 980px) {
  .topbar .account {
    gap: 10px;
  }

  .topbar .account-copy strong {
    font-size: 14px;
  }

  .topbar .account-copy span {
    font-size: 12px;
  }
}


/* REDESIGN_TOPO_REFINADO_ORDEM_CORRIGIDA_V1
   Ajustes exclusivamente visuais.
*/

/* 1. Ordem correta do bloco da direita.
   As regras anteriores tinham !important;
   por isso repetimos a prioridade aqui. */

html body .topbar > .account {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  margin-left: auto !important;
}

/* Ocultar definitivamente o avatar. */

html body .topbar .account #accountAvatar {
  display: none !important;
}

/* Primeiro: perfil e nome. */

html body .topbar > .account > .account-copy {
  order: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  min-width: max-content;
  margin: 0 !important;
  text-align: right !important;
}

/* Segundo: Sair.
   Sobrescreve explicitamente a ordem
   antiga que estava impedindo a mudança. */

html body .topbar > .account > #logoutBtn {
  order: 2 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

/* Terceiro: controle de tema.
   Funciona tanto com o botão diretamente
   na conta quanto dentro de um contêiner. */

html body .topbar > .account > #themeToggle,
html body .topbar > .account > :has(#themeToggle) {
  order: 3 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

/* Avatar oculto; demais elementos da conta
   não devem ocupar a posição final. */

html body .topbar > .account > #accountAvatar {
  order: 0 !important;
}

/* 2. Menu horizontal um pouco mais compacto. */

.topbar > #crmNav {
  gap: 2px !important;
}

.topbar > #crmNav button[data-view] {
  padding: 9px 10px !important;
  gap: 7px !important;
}

/* 3. Cartões de indicadores: grafite,
   sem faixas decorativas coloridas. */

html:not([data-theme="dark"])
.metrics .metric {
  background: #ffffff !important;
  color: #111111;
  border: 1px solid #e8e8e8 !important;
  box-shadow: 0 5px 20px rgba(0,0,0,.025);
}

html[data-theme="dark"]
.metrics .metric {
  background: #171717 !important;
  color: #f5f5f5;
  border: 1px solid #303030 !important;
  box-shadow: none;
}

/* Remover somente os acentos decorativos
   dos quatro cartões de indicadores. */

.metrics .metric::before,
.metrics .metric::after {
  content: none !important;
  display: none !important;
}

.metrics .metric {
  border-left-width: 1px !important;
  border-radius: 19px;
}

/* 4. Filtros superiores: cores neutras. */

html[data-theme="dark"]
.toolbar select,
html[data-theme="dark"]
.toolbar input {
  background: #202020 !important;
  color: #f5f5f5 !important;
  border-color: #414141 !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"])
.toolbar select,
html:not([data-theme="dark"])
.toolbar input {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #dedede !important;
  box-shadow: none !important;
}

/* Filtros da carteira: mesma paleta. */

html[data-theme="dark"]
.portfolio-actions select,
html[data-theme="dark"]
.portfolio-actions input {
  background: #202020 !important;
  color: #f5f5f5 !important;
  border-color: #414141 !important;
}

html:not([data-theme="dark"])
.portfolio-actions select,
html:not([data-theme="dark"])
.portfolio-actions input {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #dedede !important;
}

/* 5. Acabamento do título da página. */

.page-head h1 {
  letter-spacing: -.045em;
  line-height: 1.08;
}

/* Telas menores: preservar a ordem.
   O menu continua com rolagem horizontal. */

@media (max-width: 720px) {
  html body .topbar > .account {
    gap: 7px !important;
  }

  html body .topbar > .account
  > .account-copy {
    display: none !important;
  }

  .topbar > #crmNav {
    gap: 2px !important;
  }
}


/* TOPO_AJUSTE_FINO_ALINHAMENTO_V1
   Ajuste final do cabeçalho:
   - mais espaço entre logo e menu
   - alinhamento fino do bloco da direita
*/

.topbar {
  align-items: center !important;
}

.topbar > .brand,
.topbar > #crmNav,
.topbar > .account {
  align-self: center !important;
}

/* Dá um respiro maior entre a logo e o menu */
.topbar > #crmNav {
  margin-left: clamp(18px, 1.8vw, 32px) !important;
}

/* Bloco da direita: alinhamento vertical refinado */
.topbar > .account {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Perfil/nome */
.topbar > .account > .account-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.08 !important;
}

.topbar > .account > .account-copy strong {
  margin: 0 !important;
  line-height: 1.05 !important;
}

.topbar > .account > .account-copy span {
  margin-top: 5px !important;
  line-height: 1.05 !important;
}

/* Botão sair e botão tema perfeitamente centrados */
.topbar > .account > #logoutBtn,
.topbar > .account > #themeToggle {
  align-self: center !important;
  margin: 0 !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
}

/* Pequeno refinamento na navegação */
.topbar > #crmNav button[data-view] {
  align-items: center !important;
}

/* Responsivo */
@media (max-width: 1100px) {
  .topbar > #crmNav {
    margin-left: 14px !important;
  }

  .topbar > .account {
    gap: 10px !important;
  }
}

@media (max-width: 720px) {
  .topbar > #crmNav {
    margin-left: 8px !important;
  }
}


/* REDESIGN_MENU_ALINHAMENTO_FINAL_V1
   Todos os botões centrais com a mesma altura.
   Preserva posição, temas e permissões.
*/

/* Centralização vertical do menu inteiro */

html body .topbar > #crmNav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;

  align-items: center !important;
  justify-content: flex-start !important;

  align-self: center !important;
  gap: 6px !important;

  min-height: 48px !important;
  height: 48px !important;
}

/* Todos os botões: exatamente 48 px */

html body .topbar > #crmNav
button[data-view] {
  display: inline-flex !important;
  flex: 0 0 auto !important;

  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;

  gap: 9px !important;

  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;

  padding: 0 14px !important;
  margin: 0 !important;

  border-radius: 14px !important;

  box-sizing: border-box !important;

  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* Ícones com dimensões idênticas */

html body .topbar > #crmNav
button[data-view] svg {
  display: block !important;

  width: 18px !important;
  height: 18px !important;

  min-width: 18px !important;
  flex: 0 0 18px !important;

  margin: 0 !important;
  vertical-align: middle !important;
}

/* Mesmo tamanho para botão ativo e inativos */

html body .topbar > #crmNav
button[data-view][aria-current="page"] {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;

  padding: 0 14px !important;
}

/* Tema claro */

html:not([data-theme="dark"])
.topbar > #crmNav
button[data-view][aria-current="page"] {
  background: #171717 !important;
  color: #ffffff !important;
}

/* Tema escuro */

html[data-theme="dark"]
.topbar > #crmNav
button[data-view][aria-current="page"] {
  background: #ffffff !important;
  color: #111111 !important;
}

/* Celular: manter todos alinhados,
   apenas com um pouco menos de largura */

@media (max-width: 720px) {
  html body .topbar > #crmNav {
    height: 42px !important;
    min-height: 42px !important;
  }

  html body .topbar > #crmNav
  button[data-view],
  html body .topbar > #crmNav
  button[data-view][aria-current="page"] {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;

    padding: 0 11px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
  }
}


/* REDESIGN_ENQUADRAR_MENU_NO_ESPACO_V2
   Enquadra o menu exatamente no espaço entre logo e conta.
*/

/* Barra principal em 3 blocos:
   logo | menu | conta */
html body .topbar {
  display: grid !important;
  grid-template-columns: auto minmax(0,1fr) auto !important;
  align-items: center !important;
  column-gap: 28px !important;
}

/* Logo */
html body .topbar .brand {
  flex: none !important;
  min-width: auto !important;
  margin: 0 !important;
}

/* Área central do menu */
html body .topbar #crmNav {
  grid-column: 2 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;

  gap: 10px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Botões do menu */
html body .topbar #crmNav button[data-view] {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: max-content !important;

  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;

  padding: 0 16px !important;
  border-radius: 14px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;

  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* Ícones do menu */
html body .topbar #crmNav button[data-view] svg {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  flex: 0 0 17px !important;
  margin: 0 !important;
}

/* Botão ativo */
html body .topbar #crmNav button[data-view][aria-current="page"] {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 18px !important;
}

/* Bloco da conta no lado direito */
html body .topbar .account {
  grid-column: 3 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;

  gap: 14px !important;
  margin: 0 !important;
  min-width: auto !important;
}

/* Texto da conta */
html body .topbar .account-copy {
  margin: 0 !important;
  text-align: right !important;
  align-self: center !important;
}

/* Botões sair e tema alinhados */
html body .topbar #logoutBtn,
html body .topbar #themeToggle {
  align-self: center !important;
}

/* Dá um pequeno respiro entre logo e menu */
html body .topbar .brand + #crmNav,
html body .topbar .brand + nav#crmNav {
  margin-left: 6px !important;
}

/* Ajuste fino em telas um pouco menores */
@media (max-width: 1500px) {
  html body .topbar {
    column-gap: 20px !important;
  }

  html body .topbar #crmNav {
    gap: 8px !important;
  }

  html body .topbar #crmNav button[data-view] {
    padding: 0 13px !important;
    font-size: 11px !important;
  }

  html body .topbar #crmNav button[data-view][aria-current="page"] {
    padding: 0 15px !important;
  }
}

/* Em telas menores, mantém funcional */
@media (max-width: 1280px) {
  html body .topbar {
    grid-template-columns: auto 1fr auto !important;
    column-gap: 16px !important;
  }

  html body .topbar #crmNav {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }

  html body .topbar #crmNav::-webkit-scrollbar {
    display: none !important;
  }
}



/* ====================================================
   REDESIGN_WOW_8A_PRIMEIRA_DOBRA_V1

   Primeira impressão premium:
   - hero com profundidade discreta
   - filtros em superfícies neutras
   - hierarquia dos botões
   - indicadores com acabamento refinado
   - toolbar consistente

   Somente visual. Nenhum comportamento alterado.
   ==================================================== */


/* 1. TOKENS EXCLUSIVOS DA PRIMEIRA TELA */

html:not([data-theme="dark"]) #view-carteira {
  --wow-surface: #ffffff;
  --wow-raised: #fafafa;
  --wow-control: #f7f7f7;
  --wow-border: rgba(17,17,17,.09);
  --wow-text: #111111;
  --wow-secondary: #666666;
  --wow-highlight: rgba(255,255,255,.9);
}

html[data-theme="dark"] #view-carteira {
  --wow-surface: #141515;
  --wow-raised: #1b1c1c;
  --wow-control: #232424;
  --wow-border: rgba(255,255,255,.105);
  --wow-text: #ffffff;
  --wow-secondary: #b0b0b0;
  --wow-highlight: rgba(255,255,255,.045);
}


/* 2. HERO: TÍTULO E APRESENTAÇÃO */

#view-carteira .page-head {
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin-bottom: 25px;
}

#view-carteira .page-head h1 {
  font-size: clamp(32px, 3.5vw, 49px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.055em;
}

#view-carteira .page-head p {
  line-height: 1.5;
}

/* Uma luz ambiente sutil, sem caixa colorida. */

html[data-theme="dark"]
#view-carteira .page-head::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;

  width: min(58vw, 650px);
  height: 210px;
  right: 0;
  top: -65px;

  background: radial-gradient(
    ellipse at center,
    rgba(42,122,112,.13) 0%,
    rgba(38,95,104,.055) 36%,
    transparent 72%
  );

  filter: blur(28px);
}

html:not([data-theme="dark"])
#view-carteira .page-head::before {
  content: none;
}


/* 3. PAINEL DOS FILTROS SUPERIORES */

/* Abrange a toolbar existente da carteira,
   sem modificar seus controles nem eventos. */

#view-carteira .toolbar {
  position: relative;
  min-width: 0;

  border: 1px solid var(--wow-border);
  border-radius: 22px;

  background: var(--wow-surface);
  color: var(--wow-text);

  padding: clamp(16px, 2vw, 24px);
  margin-bottom: 22px;
}

html[data-theme="dark"]
#view-carteira .toolbar {
  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.045),
      rgba(255,255,255,0) 58%
    ),
    #171919;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 16px 38px rgba(0,0,0,.18);
}

html:not([data-theme="dark"])
#view-carteira .toolbar {
  box-shadow:
    0 1px 3px rgba(0,0,0,.025),
    0 14px 32px rgba(0,0,0,.035);
}


/* 4. CAMPOS NEUTROS, SEM O AZUL ANTIGO */

#view-carteira .toolbar select,
#view-carteira .toolbar input,
#view-carteira .hierarchy-toolbar select,
#view-carteira .hierarchy-toolbar input,
#view-carteira .portfolio-actions select,
#view-carteira .portfolio-actions input {
  min-height: 46px;
  border-radius: 13px;

  background: var(--wow-control) !important;
  color: var(--wow-text) !important;
  border: 1px solid var(--wow-border) !important;

  box-shadow: none !important;

  transition:
    border-color .2s ease,
    background-color .2s ease,
    box-shadow .2s ease;
}

#view-carteira .toolbar select:focus-visible,
#view-carteira .toolbar input:focus-visible,
#view-carteira .hierarchy-toolbar select:focus-visible,
#view-carteira .hierarchy-toolbar input:focus-visible,
#view-carteira .portfolio-actions select:focus-visible,
#view-carteira .portfolio-actions input:focus-visible {
  outline: 2px solid var(--wow-text);
  outline-offset: 3px;
}


/* 5. AÇÕES PRINCIPAIS */

/* Todos os botões mantêm seus IDs e funções. */

#view-carteira #newCustomerBtn,
#view-carteira #importOpen,
#view-carteira #exportBase {
  min-height: 46px;
  border-radius: 13px;
  padding: 11px 18px;

  font-weight: 650;
  letter-spacing: -.015em;

  transition:
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

/* Novo Cliente: ação principal. */

html[data-theme="dark"]
#view-carteira #newCustomerBtn {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #ffffff !important;

  box-shadow:
    0 4px 16px rgba(255,255,255,.075);
}

html:not([data-theme="dark"])
#view-carteira #newCustomerBtn {
  background: #111111 !important;
  color: #ffffff !important;
  border: 1px solid #111111 !important;

  box-shadow: 0 5px 16px rgba(0,0,0,.105);
}

/* Importar: superfície elevada. */

#view-carteira #importOpen {
  background: var(--wow-raised) !important;
  color: var(--wow-text) !important;
  border: 1px solid var(--wow-border) !important;

  box-shadow:
    inset 0 1px 0 var(--wow-highlight);
}

/* Exportar: ação secundária discreta. */

#view-carteira #exportBase {
  background: transparent !important;
  color: var(--wow-secondary) !important;
  border: 1px solid var(--wow-border) !important;
  box-shadow: none !important;
}

@media (hover: hover) {
  #view-carteira #newCustomerBtn:hover,
  #view-carteira #importOpen:hover,
  #view-carteira #exportBase:hover {
    transform: translateY(-1px);
  }
}


/* 6. QUATRO INDICADORES DA PRIMEIRA TELA */

#view-carteira .metrics {
  gap: 16px;
  align-items: stretch;
  margin-bottom: 24px;
}

#view-carteira .metrics .metric {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  min-width: 0;
  min-height: 126px;
  padding: clamp(17px, 1.6vw, 24px);

  border: 1px solid var(--wow-border) !important;
  border-radius: 22px;

  color: var(--wow-text);
  background: var(--wow-surface) !important;

  transition:
    transform .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}

/* Eliminar as antigas faixas coloridas. */

#view-carteira .metrics .metric::before,
#view-carteira .metrics .metric::after {
  content: none !important;
  display: none !important;
}

/* Refinamento de luz, não uma nova cor. */

html[data-theme="dark"]
#view-carteira .metrics .metric {
  background:
    linear-gradient(
      150deg,
      rgba(255,255,255,.055),
      rgba(255,255,255,0) 55%
    ),
    #171818 !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 10px 30px rgba(0,0,0,.12);
}

html:not([data-theme="dark"])
#view-carteira .metrics .metric {
  background: #ffffff !important;

  box-shadow:
    0 2px 7px rgba(0,0,0,.018),
    0 12px 30px rgba(0,0,0,.035);
}

#view-carteira .metrics .metric strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.055em;
  line-height: 1.08;
}

/* Ícones alinhados, sem cores decorativas. */

#view-carteira .metrics .metric-icon {
  border: 1px solid var(--wow-border);
  border-radius: 14px;

  background: var(--wow-raised);
  color: var(--wow-text);

  box-shadow: none;
}

@media (hover: hover) {
  #view-carteira .metrics .metric:hover {
    transform: translateY(-2px);
    border-color: rgba(150,170,164,.3) !important;
  }
}


/* 7. FILTROS DE BUSCA: UMA LINGUAGEM ÚNICA */

#view-carteira .filters,
#view-carteira .filter-bar {
  min-width: 0;

  border-radius: 19px;
  border: 1px solid var(--wow-border);

  background: var(--wow-surface);

  box-shadow:
    inset 0 1px 0 var(--wow-highlight);
}

#view-carteira .filters input,
#view-carteira .filters select,
#view-carteira .filter-bar input,
#view-carteira .filter-bar select {
  min-height: 44px;

  border-radius: 12px;
  background: var(--wow-control) !important;
  color: var(--wow-text) !important;

  border: 1px solid var(--wow-border) !important;
  box-shadow: none !important;
}


/* 8. RESPONSIVIDADE SEM MUDAR FUNÇÕES */

@media (max-width: 720px) {
  #view-carteira .page-head {
    margin-bottom: 18px;
  }

  #view-carteira .page-head h1 {
    font-size: clamp(28px, 7vw, 36px);
  }

  #view-carteira .toolbar {
    padding: 16px;
    border-radius: 18px;
  }

  #view-carteira .metrics {
    gap: 10px;
  }

  #view-carteira .metrics .metric {
    min-height: 110px;
    padding: 16px;
    border-radius: 17px;
  }

  #view-carteira #newCustomerBtn,
  #view-carteira #importOpen,
  #view-carteira #exportBase {
    min-height: 43px;
    padding: 10px 14px;
  }
}


/* 9. ACESSIBILIDADE E MOVIMENTO REDUZIDO */

@media (prefers-reduced-motion: reduce) {
  #view-carteira .metrics .metric,
  #view-carteira #newCustomerBtn,
  #view-carteira #importOpen,
  #view-carteira #exportBase,
  #view-carteira .toolbar select,
  #view-carteira .toolbar input {
    transition: none !important;
    transform: none !important;
  }

  html[data-theme="dark"]
  #view-carteira .page-head::before {
    filter: none;
  }
}


/* REDESIGN_HERO_INSTITUCIONAL_V1
   Apresentação compartilhada entre os três perfis.
   Não modifica dados, ações ou permissões.
*/

#view-carteira .wow-hero-kicker {
  display: block;
  margin-bottom: 12px;

  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;

  letter-spacing: .15em !important;
  text-transform: uppercase;

  color: #8aada1 !important;
}

#view-carteira .wow-hero-title {
  margin: 0 0 15px;
  max-width: 1100px;

  font-size: clamp(32px, 3.5vw, 54px) !important;
  line-height: 1.08 !important;
  letter-spacing: -.055em !important;
  font-weight: 700 !important;

  text-wrap: balance;
}

html[data-theme="dark"]
#view-carteira .wow-hero-title {
  color: #ffffff !important;
}

html:not([data-theme="dark"])
#view-carteira .wow-hero-title {
  color: #111111 !important;
}

html[data-theme="dark"]
#view-carteira .wow-hero-accent {
  color: #a7c5b8;
}

html:not([data-theme="dark"])
#view-carteira .wow-hero-accent {
  color: #287b69;
}

#view-carteira .wow-hero-subtitle {
  max-width: 850px;

  font-size: clamp(15px, 1.2vw, 19px) !important;
  line-height: 1.55 !important;
  letter-spacing: -.015em;
}

html[data-theme="dark"]
#view-carteira .wow-hero-subtitle {
  color: #b8c2bf !important;
}

html:not([data-theme="dark"])
#view-carteira .wow-hero-subtitle {
  color: #626d69 !important;
}

@media (max-width: 720px) {
  #view-carteira .wow-hero-title {
    font-size: clamp(30px, 7vw, 40px) !important;
    margin-bottom: 12px;
  }

  #view-carteira .wow-hero-kicker {
    margin-bottom: 10px;
  }
}



/* ==================================================
   REDESIGN_WOW_8B_HERO_SIGNATURE_V1

   Hero Signature:
   iluminação ambiente, glass refinado,
   profundidade e microinterações.

   Nenhuma alteração funcional.
   ================================================== */


/* 1. HERO PRINCIPAL */

#view-carteira .page-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  padding:
    clamp(25px, 3vw, 44px)
    clamp(24px, 3.5vw, 54px);

  margin-bottom: 18px;

  border-radius: 27px;

  transition:
    border-color .3s ease,
    box-shadow .3s ease;
}


/* 2. TEMA ESCURO: ILUMINAÇÃO E PROFUNDIDADE */

html[data-theme="dark"]
#view-carteira .page-head {
  color: #ffffff;

  background:
    radial-gradient(
      ellipse 64% 110% at 95% -12%,
      rgba(39,146,122,.23) 0%,
      rgba(30,96,89,.085) 48%,
      transparent 76%
    ),
    linear-gradient(
      125deg,
      #191e1c 0%,
      #111513 48%,
      #0b0d0c 100%
    );

  border: 1px solid rgba(183,223,207,.16);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.09),
    inset 0 -1px 0 rgba(255,255,255,.015),
    0 18px 50px rgba(0,0,0,.19);
}


/* 3. TEMA CLARO: MESMA LINGUAGEM */

html:not([data-theme="dark"])
#view-carteira .page-head {
  color: #111111;

  background:
    radial-gradient(
      ellipse 62% 100% at 100% -15%,
      rgba(54,154,126,.12),
      transparent 76%
    ),
    linear-gradient(
      125deg,
      #ffffff,
      #f8faf9
    );

  border: 1px solid rgba(30,88,69,.115);

  box-shadow:
    inset 0 1px 0 #ffffff,
    0 15px 45px rgba(0,0,0,.045);
}


/* 4. REFLEXO SUPERIOR
   Fica atrás do texto e não bloqueia cliques. */

#view-carteira .page-head::before {
  content: "";
  position: absolute;

  z-index: -1;
  pointer-events: none;

  inset: 0;

  width: auto;
  height: auto;

  background:
    linear-gradient(
      112deg,
      transparent 0%,
      rgba(255,255,255,.065) 35%,
      transparent 57%
    );

  opacity: .48;
  filter: none;
}


/* 5. REFLEXO LATERAL CONTROLADO */

#view-carteira .page-head::after {
  content: "";
  position: absolute;

  right: -65px;
  top: -125px;

  width: 340px;
  height: 340px;

  border-radius: 50%;

  pointer-events: none;
  z-index: -1;

  border: 1px solid rgba(160,218,191,.095);

  box-shadow:
    0 0 0 38px rgba(130,192,168,.025),
    0 0 0 90px rgba(130,192,168,.016);
}

html:not([data-theme="dark"])
#view-carteira .page-head::after {
  border-color: rgba(37,119,88,.095);
}


/* 6. TIPOGRAFIA DO HERO */

#view-carteira .page-head h1 {
  max-width: 1150px;

  font-size: clamp(34px, 3.5vw, 57px);
  font-weight: 700;

  line-height: 1.075;
  letter-spacing: -.057em;

  text-wrap: balance;
}

#view-carteira .page-head
.wow-hero-accent {
  color: #b0d0c2;
}

html:not([data-theme="dark"])
#view-carteira .page-head
.wow-hero-accent {
  color: #287d65;
}

#view-carteira .page-head
.wow-hero-kicker {
  color: #a9c8ba !important;

  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .17em !important;
}

html:not([data-theme="dark"])
#view-carteira .page-head
.wow-hero-kicker {
  color: #387c67 !important;
}

#view-carteira .page-head
.wow-hero-subtitle {
  max-width: 790px;

  margin-top: 13px;

  font-size: clamp(15px, 1.2vw, 19px);
  line-height: 1.55;
}


/* 7. PAINEL DOS FILTROS
   Preserva os selects e seus eventos. */

#view-carteira .toolbar {
  position: relative;

  border-radius: 21px;

  transition:
    border-color .2s ease,
    box-shadow .2s ease;
}

html[data-theme="dark"]
#view-carteira .toolbar {
  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.055),
      rgba(255,255,255,.008) 62%
    ),
    #171b19;

  border: 1px solid rgba(255,255,255,.115);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 12px 32px rgba(0,0,0,.12);
}

html:not([data-theme="dark"])
#view-carteira .toolbar {
  background: #ffffff;

  border: 1px solid #e3ebe6;

  box-shadow:
    0 9px 30px rgba(0,0,0,.04);
}


/* 8. MICROINTERAÇÕES NOS CONTROLES */

@media (hover: hover) {

  #view-carteira .toolbar:hover {
    border-color: rgba(132,181,157,.32);
  }

  #view-carteira .metrics .metric:hover {
    transform: translateY(-3px);

    border-color:
      rgba(154,190,172,.32) !important;
  }

  #view-carteira #newCustomerBtn:hover {
    transform: translateY(-2px);
  }

  #view-carteira #importOpen:hover,
  #view-carteira #exportBase:hover {
    transform: translateY(-1px);
  }
}


/* 9. TRANSIÇÕES CURTAS, SEM EXAGERO */

#view-carteira .metrics .metric {
  transition:
    transform .23s cubic-bezier(.2,.8,.2,1),
    border-color .23s ease,
    box-shadow .23s ease;
}

#view-carteira #newCustomerBtn,
#view-carteira #importOpen,
#view-carteira #exportBase {
  transition:
    transform .2s cubic-bezier(.2,.8,.2,1),
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}


/* 10. TELAS MENORES */

@media (max-width: 720px) {

  #view-carteira .page-head {
    padding: 25px 21px;
    border-radius: 21px;
  }

  #view-carteira .page-head h1 {
    font-size: clamp(30px, 7vw, 39px);
  }

  #view-carteira .page-head::after {
    right: -170px;
    top: -180px;
  }
}


/* 11. REDUÇÃO DE MOVIMENTO */

@media (prefers-reduced-motion: reduce) {

  #view-carteira .page-head,
  #view-carteira .toolbar,
  #view-carteira .metrics .metric,
  #view-carteira #newCustomerBtn,
  #view-carteira #importOpen,
  #view-carteira #exportBase {
    transition: none !important;
    transform: none !important;
  }
}



/* ==================================================
   REDESIGN_WOW_8C_MONOGRAMA_MOUSE_V1
   Monograma equilibrado e reflexo seguindo o mouse.
   Apenas interface. Nenhuma regra funcional alterada.
   ================================================== */

/* 1. Fundo completamente neutro */

html[data-theme="dark"]
#view-carteira .page-head {
  background:
    radial-gradient(
      ellipse at 85% 5%,
      rgba(255,255,255,.075),
      transparent 48%
    ),
    linear-gradient(
      125deg,
      #1b1b1b 0%,
      #121212 55%,
      #0b0b0b 100%
    ) !important;

  border-color: #444444 !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 18px 45px rgba(0,0,0,.18);
}

html:not([data-theme="dark"])
#view-carteira .page-head {
  background:
    radial-gradient(
      ellipse at 85% 5%,
      rgba(0,0,0,.055),
      transparent 49%
    ),
    linear-gradient(
      125deg,
      #ffffff,
      #f5f5f5
    ) !important;

  border-color: #dddddd !important;
}

/* 2. O reflexo que acompanha o mouse */

#view-carteira .page-head::before {
  content: "" !important;

  position: absolute !important;
  inset: 0 !important;

  width: 100% !important;
  height: 100% !important;

  z-index: 0 !important;

  pointer-events: none !important;

  border-radius: inherit;

  background:
    radial-gradient(
      circle 360px at
      var(--wow-mouse-x, 70%)
      var(--wow-mouse-y, 30%),
      rgba(255,255,255,.15),
      rgba(255,255,255,.055) 36%,
      transparent 73%
    ) !important;

  opacity:
    var(--wow-flash-opacity, 0) !important;

  filter: none !important;

  transition: opacity .28s ease !important;
}

html:not([data-theme="dark"])
#view-carteira .page-head::before {
  background:
    radial-gradient(
      circle 360px at
      var(--wow-mouse-x, 70%)
      var(--wow-mouse-y, 30%),
      rgba(0,0,0,.07),
      rgba(0,0,0,.02) 36%,
      transparent 73%
    ) !important;
}

/* 3. Substituir o círculo decorativo
   pelo monograma BC em prata/grafite. */

#view-carteira .page-head::after {
  content: "" !important;

  position: absolute !important;

  top: 50% !important;
  right: -2% !important;
  left: auto !important;
  bottom: auto !important;

  width: min(38%, 510px) !important;
  height: auto !important;

  aspect-ratio: 1075 / 746;

  z-index: 0 !important;
  pointer-events: none !important;

  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;

  transform: translateY(-50%) !important;

  -webkit-mask-image:
    url("brand-monogram-wow.svg");
  mask-image:
    url("brand-monogram-wow.svg");

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-size: contain;
  mask-size: contain;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Marca prata no tema escuro */

html[data-theme="dark"]
#view-carteira .page-head::after {
  background:
    linear-gradient(
      150deg,
      #f2f2f2,
      #969696 60%,
      #555555
    ) !important;

  opacity: .15 !important;
}

/* Marca grafite no tema claro */

html:not([data-theme="dark"])
#view-carteira .page-head::after {
  background: #171717 !important;
  opacity: .075 !important;
}

/* 4. Texto sempre na frente da iluminação */

#view-carteira .page-head > * {
  position: relative;
  z-index: 1;
}

/* O título ganha prata, nunca verde.
   Os outros textos conservam suas cores. */

html[data-theme="dark"]
#view-carteira .page-head
.wow-hero-accent {
  color: #d1d3d6 !important;
}

html:not([data-theme="dark"])
#view-carteira .page-head
.wow-hero-accent {
  color: #555555 !important;
}

/* 5. Evitar concorrência com o texto
   em telas menores. */

@media (max-width: 900px) {
  #view-carteira .page-head::after {
    width: 43% !important;
    opacity: .055 !important;
    right: -5% !important;
  }
}

@media (max-width: 720px) {
  #view-carteira .page-head::after {
    width: 55% !important;
    right: -20% !important;
    opacity: .035 !important;
  }

  #view-carteira .page-head::before {
    background: none !important;
  }
}

/* 6. Respeitar redução de movimento */

@media (prefers-reduced-motion: reduce) {
  #view-carteira .page-head::before {
    display: none !important;
    transition: none !important;
  }
}



/* HERO_LIMPEZA_SEGURA_7D2A: TEXTOS */
html[data-theme="dark"]
#view-carteira .page-head
.wow-hero-accent {
  color: #31977f !important;
}
html:not([data-theme="dark"])
#view-carteira .page-head
.wow-hero-accent {
  color: #247b65 !important;
}
#view-carteira .page-head
.hero-context-removed {
  display: none !important;
}
html[data-theme="dark"]
#view-carteira .page-head
.hero-context-subtitle {
  color: #31977f !important;
}
html:not([data-theme="dark"])
#view-carteira .page-head
.hero-context-subtitle {
  color: #247b65 !important;
}
#view-carteira .page-head
.hero-context-subtitle {
  display: block;
  margin-top: 19px;
  max-width: 1050px;
  font-size: clamp(
    15px,
    1.25vw,
    19px
  ) !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
  letter-spacing: -.015em;
}
#view-carteira .page-head
.wow-hero-title {
  margin-bottom: 0 !important;
}
@media (max-width: 720px) {
  #view-carteira .page-head
  .hero-context-subtitle {
    margin-top: 14px;
    font-size: 15px !important;
  }
}
html body #view-carteira .page-head {
  min-height: 0;
  padding:
    clamp(31px, 3.2vw, 49px)
    clamp(25px, 3.8vw, 65px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
html body #view-carteira
.page-head h1.wow-hero-title {
  display: block !important;
  width: auto;
  max-width: 100%;
  margin: 0 !important;
  font-size: clamp(
    31px,
    3.35vw,
    57px
  ) !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  letter-spacing: -.052em !important;
  white-space: normal !important;
  text-wrap: balance;
}
html body #view-carteira
.page-head h1 .wow-hero-accent {
  display: block !important;
  width: fit-content;
  max-width: 100%;
  margin-top: 3px !important;
  color: #399d85 !important;
  line-height: 1.12 !important;
}
html body #view-carteira
.page-head .hero-context-subtitle {
  display: block !important;
  max-width: 900px;
  margin:
    clamp(18px, 2vw, 27px)
    0 0 !important;
  color: #399d85 !important;
  font-size: clamp(
    15px,
    1.2vw,
    19px
  ) !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  letter-spacing: -.012em;
}
html body #view-carteira
.page-head::after {
  width: min(33%, 455px) !important;
  right: 1.5% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}
html:not([data-theme="dark"])
#view-carteira .page-head
.wow-hero-accent,
html:not([data-theme="dark"])
#view-carteira .page-head
.hero-context-subtitle {
  color: #247b65 !important;
}
@media (max-width: 1250px) {
  html body #view-carteira
  .page-head h1.wow-hero-title {
    font-size: clamp(
      30px,
      3.5vw,
      48px
    ) !important;
  }
  html body #view-carteira
  .page-head::after {
    width: 30% !important;
    right: -3% !important;
    opacity: .09 !important;
  }
}
@media (max-width: 720px) {
  html body #view-carteira
  .page-head {
    padding: 29px 22px;
  }
  html body #view-carteira
  .page-head h1.wow-hero-title {
    font-size: clamp(
      28px,
      7vw,
      39px
    ) !important;
    line-height: 1.15 !important;
  }
  html body #view-carteira
  .page-head h1 .wow-hero-accent {
    margin-top: 4px !important;
  }
  html body #view-carteira
  .page-head .hero-context-subtitle {
    margin-top: 19px !important;
    font-size: 15px !important;
  }
  html body #view-carteira
  .page-head::after {
    width: 48% !important;
    right: -16% !important;
    opacity: .035 !important;
  }
}
/* REDESIGN_BARRA_CARTEIRA_UNIFICADA_V1
   Escritório | Novo Escritório |
   Novo Cliente | Exportar base.

   Importação na linha secundária.
*/

/* Superfície principal */

#view-carteira #portfolioControlBar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;

  gap: 12px;

  min-width: 0;
  margin: 0 0 24px;
  padding: 20px 22px;

  border-radius: 21px;
  border: 1px solid var(--line);
}

html[data-theme="dark"]
#view-carteira #portfolioControlBar {
  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.04),
      transparent 65%
    ),
    #191919;

  border-color: #383838;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045);
}

html:not([data-theme="dark"])
#view-carteira #portfolioControlBar {
  background: #fafafa;
  border-color: #e7e7e7;

  box-shadow:
    0 8px 26px rgba(0,0,0,.025);
}

/* Os contêineres deixam de criar
   duas barras independentes.
   Os controles internos permanecem reais. */

#view-carteira
#portfolioControlBar #hierarchyToolbar,
#view-carteira
#portfolioControlBar .main-client-actions {
  display: contents !important;
}

/* Preservar o hidden controlado
   pelo perfil do usuário. */

#view-carteira
#portfolioControlBar #hierarchyToolbar[hidden],
#view-carteira
#portfolioControlBar .main-client-actions[hidden] {
  display: none !important;
}

#view-carteira
#portfolioControlBar [hidden] {
  display: none !important;
}

/* Representante, quando disponível,
   permanece acima da barra de ações. */

#view-carteira
#portfolioControlBar
#representanteSelectorField {
  flex: 0 0 100%;
  width: 100%;
  max-width: none;

  margin: 0;
}

#view-carteira
#portfolioControlBar
#representanteSelector {
  max-width: 330px;
}

/* Escritório: primeiro controle
   da linha principal. */

#view-carteira
#portfolioControlBar
#officeSelectorField {
  order: 1;

  display: flex;
  flex-direction: column;

  flex: 1 1 260px;
  max-width: 360px;
  min-width: 210px;

  margin: 0;

  gap: 7px;
}

#view-carteira
#portfolioControlBar
#officeSelector {
  width: 100%;
  height: 46px !important;
  min-height: 46px !important;

  padding: 0 13px;
  border-radius: 13px;
  box-sizing: border-box;
}

html[data-theme="dark"]
#view-carteira
#portfolioControlBar
#officeSelector {
  background: #252525 !important;
  color: #ffffff !important;
  border: 1px solid #454545 !important;
}

html:not([data-theme="dark"])
#view-carteira
#portfolioControlBar
#officeSelector {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #dedede !important;
}

/* Os três botões principais
   têm altura exatamente igual. */

#view-carteira
#portfolioControlBar
#portfolioNewOffice {
  order: 2;
}

#view-carteira
#portfolioControlBar
#newCustomerBtn {
  order: 3;
}

#view-carteira
#portfolioControlBar
#exportBase {
  order: 4;
}

#view-carteira
#portfolioControlBar
:is(
  #portfolioNewOffice,
  #newCustomerBtn,
  #exportBase
) {
  display: inline-flex;
  flex: 0 0 auto;

  align-items: center;
  justify-content: center;

  gap: 8px;

  height: 46px !important;
  min-height: 46px !important;

  margin: 0 !important;
  padding: 0 17px !important;

  border-radius: 13px !important;

  font-size: 13px;
  font-weight: 650;

  line-height: 1.2;
  white-space: nowrap;
}

/* Botões principais */

html[data-theme="dark"]
#view-carteira
#portfolioControlBar
:is(#portfolioNewOffice,#newCustomerBtn) {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #ffffff !important;
}

html:not([data-theme="dark"])
#view-carteira
#portfolioControlBar
:is(#portfolioNewOffice,#newCustomerBtn) {
  background: #111111 !important;
  color: #ffffff !important;
  border: 1px solid #111111 !important;
}

/* Exportar base: secundário */

html[data-theme="dark"]
#view-carteira
#portfolioControlBar
#exportBase {
  background: #282828 !important;
  color: #ffffff !important;
  border: 1px solid #454545 !important;
}

html:not([data-theme="dark"])
#view-carteira
#portfolioControlBar
#exportBase {
  background: #ffffff !important;
  color: #222222 !important;
  border: 1px solid #dedede !important;
}

/* Importação permanece acessível,
   mas não interfere na linha principal. */

#view-carteira
#portfolioControlBar::after {
  content: "";
  order: 5;
  flex: 0 0 100%;
  height: 0;
  margin: -6px 0;
}

#view-carteira
#portfolioControlBar
#importOpen {
  order: 6;

  min-height: 40px;
  margin: 0;

  border-radius: 11px;
  font-size: 12px;
}

/* Telas intermediárias */

@media (max-width: 1100px) {
  #view-carteira #portfolioControlBar {
    padding: 16px;
    gap: 10px;
  }

  #view-carteira
  #portfolioControlBar
  #officeSelectorField {
    flex: 1 1 220px;
    max-width: 100%;
  }
}

/* Celular: controles preservados,
   com quebra natural de linha. */

@media (max-width: 720px) {
  #view-carteira #portfolioControlBar {
    padding: 15px;
    border-radius: 17px;
    gap: 10px;
  }

  #view-carteira
  #portfolioControlBar
  #officeSelectorField {
    flex: 1 1 100%;
    min-width: 0;
  }

  #view-carteira
  #portfolioControlBar
  :is(
    #portfolioNewOffice,
    #newCustomerBtn,
    #exportBase
  ) {
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 13px !important;
  }
}



/* COMISSOES_OLHO_WOW_V1
   Visual premium para o botão do olhinho em Comissões.
   Somente aparência. Nenhuma função foi alterada.
*/

#view-comissoes :is(.view-head, .page-head) .icon-btn {
  position: relative;
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
  transition:
    transform .22s ease,
    box-shadow .28s ease,
    border-color .28s ease,
    background-color .28s ease,
    color .28s ease;
}

#view-comissoes :is(.view-head, .page-head) .icon-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  z-index: 0;
  transition: opacity .28s ease, transform .28s ease;
}

#view-comissoes :is(.view-head, .page-head) .icon-btn::after {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
  transition:
    opacity .28s ease,
    transform .28s ease;
}

#view-comissoes :is(.view-head, .page-head) .icon-btn > * {
  position: relative;
  z-index: 1;
}

#view-comissoes :is(.view-head, .page-head) .icon-btn svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.9;
  transition:
    transform .22s ease,
    opacity .22s ease;
}

/* TEMA CLARO */
html:not([data-theme="dark"])
#view-comissoes :is(.view-head, .page-head) .icon-btn {
  color: #111111;
  border: 1px solid #cfd5dc;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f6f8 100%);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, .07),
    inset 0 1px 0 rgba(255,255,255,.9);
}

html:not([data-theme="dark"])
#view-comissoes :is(.view-head, .page-head) .icon-btn::before {
  background:
    linear-gradient(145deg,
      rgba(255,255,255,.92) 0%,
      rgba(248,250,252,.86) 55%,
      rgba(234,239,244,.92) 100%);
}

html:not([data-theme="dark"])
#view-comissoes :is(.view-head, .page-head) .icon-btn::after {
  background:
    radial-gradient(circle at 30% 25%,
      rgba(255,255,255,.96) 0%,
      rgba(255,255,255,.55) 22%,
      rgba(255,255,255,0) 50%),
    radial-gradient(circle at 78% 82%,
      rgba(0,0,0,.08) 0%,
      rgba(0,0,0,0) 42%);
}

/* TEMA ESCURO */
html[data-theme="dark"]
#view-comissoes :is(.view-head, .page-head) .icon-btn {
  color: #f6f7f9;
  border: 1px solid #36383c;
  background:
    linear-gradient(180deg, #191b1e 0%, #111214 100%);
  box-shadow:
    0 12px 28px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.05);
}

html[data-theme="dark"]
#view-comissoes :is(.view-head, .page-head) .icon-btn::before {
  background:
    linear-gradient(145deg,
      rgba(255,255,255,.06) 0%,
      rgba(255,255,255,.025) 45%,
      rgba(0,0,0,.06) 100%);
}

html[data-theme="dark"]
#view-comissoes :is(.view-head, .page-head) .icon-btn::after {
  background:
    radial-gradient(circle at 28% 24%,
      rgba(255,255,255,.18) 0%,
      rgba(255,255,255,.08) 18%,
      rgba(255,255,255,0) 42%),
    radial-gradient(circle at 78% 82%,
      rgba(0,170,255,.12) 0%,
      rgba(0,170,255,0) 40%);
}

/* HOVER / FOCO */
#view-comissoes :is(.view-head, .page-head) .icon-btn:hover,
#view-comissoes :is(.view-head, .page-head) .icon-btn:focus-visible {
  transform: translateY(-1px) scale(1.02);
  outline: none;
}

#view-comissoes :is(.view-head, .page-head) .icon-btn:hover svg,
#view-comissoes :is(.view-head, .page-head) .icon-btn:focus-visible svg {
  transform: scale(1.06);
}

html:not([data-theme="dark"])
#view-comissoes :is(.view-head, .page-head) .icon-btn:hover,
html:not([data-theme="dark"])
#view-comissoes :is(.view-head, .page-head) .icon-btn:focus-visible {
  border-color: #bfc7d1;
  box-shadow:
    0 14px 30px rgba(15, 23, 42, .10),
    inset 0 1px 0 rgba(255,255,255,.95);
}

html[data-theme="dark"]
#view-comissoes :is(.view-head, .page-head) .icon-btn:hover,
html[data-theme="dark"]
#view-comissoes :is(.view-head, .page-head) .icon-btn:focus-visible {
  border-color: #4a4d52;
  box-shadow:
    0 14px 32px rgba(0,0,0,.34),
    0 0 0 1px rgba(255,255,255,.02),
    inset 0 1px 0 rgba(255,255,255,.07);
}

/* ACTIVE */
#view-comissoes :is(.view-head, .page-head) .icon-btn:active {
  transform: translateY(0) scale(.985);
}

/* REDUÇÃO DE MOVIMENTO */
@media (prefers-reduced-motion: reduce) {
  #view-comissoes :is(.view-head, .page-head) .icon-btn,
  #view-comissoes :is(.view-head, .page-head) .icon-btn::before,
  #view-comissoes :is(.view-head, .page-head) .icon-btn::after,
  #view-comissoes :is(.view-head, .page-head) .icon-btn svg {
    transition: none !important;
  }
}



/* REDESIGN_KANBAN_COMPACTO_V1 */

/* 1. Versão compacta:
   cabeçalho, botão e validade visíveis. */

#view-carteira
.cards > .card.kanban-compact-card:not(.is-expanded)
> :not(.card-top):not(.small-note):not(.kanban-compact-toggle) {
  display: none !important;
}

/* 2. Cartão compacto */

#view-carteira
.cards > .card.kanban-compact-card {
  min-height: 0 !important;
  height: auto !important;

  padding: 15px !important;

  border-radius: 17px;

  transition:
    box-shadow .22s ease,
    border-color .22s ease,
    transform .22s ease;
}

/* 3. Cabeçalho:
   nome e produto mantidos. */

#view-carteira
.cards > .card.kanban-compact-card
.card-top {
  margin-bottom: 10px;
}

/* 4. Validade:
   leitura rápida sem ocupar muito espaço. */

#view-carteira
.cards > .card.kanban-compact-card
.small-note {
  margin: 12px 0 0 !important;

  padding: 10px 12px !important;

  border-radius: 11px;

  font-size: 12px !important;
  line-height: 1.45;
}

/* 5. Botão individual */

#view-carteira
.cards > .card
.kanban-compact-toggle {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-height: 30px;

  margin: 2px 0 0;
  padding: 5px 10px;

  border: 1px solid currentColor;
  border-radius: 9px;

  background: transparent;

  font-size: 11px;
  font-weight: 650;

  cursor: pointer;
  opacity: .8;

  transition:
    opacity .2s ease,
    background-color .2s ease;
}

#view-carteira
.cards > .card
.kanban-compact-toggle:hover {
  opacity: 1;
}

#view-carteira
.cards > .card
.kanban-compact-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* 6. Reduzir espaços no modo compacto */

#view-carteira
.cards > .card.kanban-compact-card:not(.is-expanded)
.card-top {
  margin-bottom: 0 !important;
}

/* 7. Controle geral acima do Kanban */

#view-carteira
.kanban-compact-toolbar {
  display: flex;

  align-items: center;
  justify-content: space-between;

  flex-wrap: wrap;
  gap: 10px;

  margin: 0 0 14px;
  padding: 0 3px;

  font-size: 12px;
  font-weight: 600;
}

#view-carteira
.kanban-compact-toolbar button {
  min-height: 36px;

  padding: 7px 13px;

  border-radius: 11px;

  font: inherit;
  cursor: pointer;

  transition:
    border-color .2s ease,
    background-color .2s ease;
}

/* 8. Tema escuro */

html[data-theme="dark"]
#view-carteira
.kanban-compact-toolbar {
  color: #bcbcbc;
}

html[data-theme="dark"]
#view-carteira
.kanban-compact-toolbar button {
  color: #f6f6f6;
  background: #242424;
  border: 1px solid #454545;
}

html[data-theme="dark"]
#view-carteira
.cards > .card
.kanban-compact-toggle {
  color: #cccccc;
  border-color: #494949;
}

html[data-theme="dark"]
#view-carteira
.cards > .card
.kanban-compact-toggle:hover {
  background: #292929;
}

/* 9. Tema claro */

html:not([data-theme="dark"])
#view-carteira
.kanban-compact-toolbar {
  color: #535e65;
}

html:not([data-theme="dark"])
#view-carteira
.kanban-compact-toolbar button {
  color: #242424;
  background: #ffffff;
  border: 1px solid #d8dfe3;
}

html:not([data-theme="dark"])
#view-carteira
.cards > .card
.kanban-compact-toggle {
  color: #52616a;
  border-color: #d9e0e4;
}

html:not([data-theme="dark"])
#view-carteira
.cards > .card
.kanban-compact-toggle:hover {
  background: #f3f6f8;
}

/* 10. Celular */

@media (max-width: 720px) {
  #view-carteira
  .cards > .card.kanban-compact-card {
    padding: 13px !important;
  }
}

/* 11. Redução de movimento */

@media (prefers-reduced-motion: reduce) {
  #view-carteira
  .cards > .card.kanban-compact-card,
  #view-carteira
  .kanban-compact-toggle,
  #view-carteira
  .kanban-compact-toolbar button {
    transition: none !important;
  }
}



/* ==================================================
   REDESIGN_KANBAN_ALTURA_DINAMICA_V1

   Colunas acompanham seu conteúdo.
   Sem alterações em JavaScript ou funcionalidades.
   ================================================== */

/* 1. Cada coluna termina depois de seu conteúdo.

   :has(> .cards) identifica precisamente
   as colunas criadas pelo Kanban existente.
*/

#view-carteira :has(> .cards) {
  height: fit-content !important;
  min-height: 0 !important;
  max-height: none !important;

  align-self: start !important;

  padding-bottom: 12px;
}

/* 2. O contêiner dos cartões não precisa
   reservar espaço quando estiver vazio. */

#view-carteira .cards {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  flex: 0 0 auto !important;

  align-content: start !important;
}

/* 3. Preservar espaço interno uniforme
   entre cartões e borda inferior. */

#view-carteira :has(> .cards) > .cards {
  margin-bottom: 0 !important;
}

/* 4. Se houver uma mensagem de coluna vazia,
   mantê-la compacta e centralizada. */

#view-carteira .cards > .empty {
  min-height: 85px !important;
  height: auto !important;

  padding: 20px 12px !important;

  box-sizing: border-box;
}

/* 5. Evitar espaço inferior adicional
   nos cartões compactos. */

#view-carteira
.cards > .card.kanban-compact-card:last-child {
  margin-bottom: 0 !important;
}

/* 6. Responsividade: as colunas continuam
   usando a largura original do Kanban. */

@media (max-width: 720px) {
  #view-carteira :has(> .cards) {
    padding-bottom: 10px;
  }
}



/* REDESIGN_DETALHES_NEUTRO_V1
   Detalhes é o terceiro botão da barra.
   Evita herdar o estilo vermelho de último botão.
*/

/* TEMA CLARO */

html:not([data-theme="dark"])
#view-carteira #portfolioRows
.base-stage-buttons > button:nth-of-type(3) {
  background: #ffffff !important;
  color: #171717 !important;
  border: 1px solid #dedede !important;
  box-shadow: none !important;
}

/* TEMA ESCURO */

html[data-theme="dark"]
#view-carteira #portfolioRows
.base-stage-buttons > button:nth-of-type(3) {
  background: #252525 !important;
  color: #ffffff !important;
  border: 1px solid #454545 !important;
  box-shadow: none !important;
}

/* HOVER NEUTRO */

html:not([data-theme="dark"])
#view-carteira #portfolioRows
.base-stage-buttons > button:nth-of-type(3):hover {
  background: #f4f4f4 !important;
  border-color: #bcbcbc !important;
}

html[data-theme="dark"]
#view-carteira #portfolioRows
.base-stage-buttons > button:nth-of-type(3):hover {
  background: #333333 !important;
  border-color: #666666 !important;
}

/* Foco visível para navegação por teclado */

#view-carteira #portfolioRows
.base-stage-buttons > button:nth-of-type(3):focus-visible {
  outline: 2px solid currentColor !important;
  outline-offset: 3px;
}



/* REDESIGN_DETALHES_CLASSE_PROPRIA_V2
   Detalhes sempre neutro, independentemente
   da quantidade e da posição dos botões.
*/

html body #view-carteira
#portfolioRows .base-stage-buttons
button.portfolio-details-btn,
html body #view-carteira
#portfolioRows .base-stage-buttons
button.portfolio-details-btn:last-child {
  color: #171717 !important;
  background: #ffffff !important;
  border: 1px solid #dedede !important;
  box-shadow: none !important;
  background-image: none !important;
}

/* Hover: tema claro */

html:not([data-theme="dark"]) body
#view-carteira #portfolioRows
.base-stage-buttons
button.portfolio-details-btn:hover {
  color: #111111 !important;
  background: #f3f3f3 !important;
  border-color: #bcbcbc !important;
}

/* Tema escuro */

html[data-theme="dark"] body
#view-carteira #portfolioRows
.base-stage-buttons
button.portfolio-details-btn,
html[data-theme="dark"] body
#view-carteira #portfolioRows
.base-stage-buttons
button.portfolio-details-btn:last-child {
  color: #ffffff !important;
  background: #252525 !important;
  border: 1px solid #454545 !important;
  box-shadow: none !important;
  background-image: none !important;
}

/* Hover: tema escuro */

html[data-theme="dark"] body
#view-carteira #portfolioRows
.base-stage-buttons
button.portfolio-details-btn:hover {
  color: #ffffff !important;
  background: #333333 !important;
  border-color: #666666 !important;
}

/* Acessibilidade */

html body #view-carteira
#portfolioRows .base-stage-buttons
button.portfolio-details-btn:focus-visible {
  outline: 2px solid currentColor !important;
  outline-offset: 3px;
}

/* REDESIGN_DETALHES_CORRECAO_REAL_V3 */



/* ==================================================
   REDESIGN_TIPOGRAFIA_APPLE_2026_V1

   Fonte nativa Apple em macOS e iOS.
   Alternativas nativas em Windows e Linux.

   Sem downloads de fontes.
   Sem alterações nas funcionalidades.
   ================================================== */


/* 1. Família tipográfica principal */

html body,
html body button,
html body input,
html body select,
html body textarea,
html body table {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Helvetica Neue",
    Arial,
    sans-serif !important;
}


/* 2. Herdar a tipografia nos componentes
   sem alterar ícones ou arquivos SVG. */

html body h1,
html body h2,
html body h3,
html body h4,
html body p,
html body label,
html body th,
html body td {
  font-family: inherit;
}


/* 3. Renderização refinada */

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  -moz-osx-font-smoothing: grayscale;
}


/* 4. Títulos: espaçamento característico
   das interfaces Apple. */

html body h1,
html body h2,
html body h3 {
  font-feature-settings:
    "kern" 1;

  font-kerning: normal;
  text-wrap: balance;
}


/* 5. Números dos indicadores:
   alinhamento visual consistente. */

#view-carteira .metrics .metric strong,
#view-carteira .renewal-stats strong,
#view-carteira .kanban-column .count {
  font-variant-numeric: tabular-nums;
}


/* 6. Tabelas:
   números legíveis sem alterar larguras. */

html body table {
  font-variant-numeric: tabular-nums;
}


/* 7. Campos e botões:
   preservar pesos e tamanhos existentes. */

html body button,
html body input,
html body select,
html body textarea {
  font-kerning: normal;
}


/* 8. Não modificar a tipografia
   da marca ou de ícones especializados. */

html body svg {
  font-family: initial;
}



/* HERO_LIMPEZA_SEGURA_7D2A: LAYOUT */
html body #view-carteira .page-head {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  row-gap: 0 !important;
  padding-top: clamp(
    36px, 3.2vw, 49px
  ) !important;
  padding-bottom: clamp(
    36px, 3.2vw, 49px
  ) !important;
}
html body #view-carteira
.page-head h1 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  position: relative;
  z-index: 1;
}
html body #view-carteira
.page-head h1 .wow-hero-accent {
  display: block !important;
  margin-top: 5px !important;
  margin-bottom: 0 !important;
}
html body #view-carteira
.page-head .hero-context-subtitle {
  display: block !important;
  width: auto;
  max-width: min(100%, 790px);
  margin-top: 27px !important;
  margin-bottom: 0 !important;
  position: relative;
  z-index: 1;
}
@media (min-width: 721px)
and (max-width: 1100px) {
  html body #view-carteira
  .page-head .hero-context-subtitle {
    max-width: 75%;
    margin-top: 23px !important;
  }
}
@media (max-width: 720px) {
  html body #view-carteira .page-head {
    padding-top: 29px !important;
    padding-bottom: 29px !important;
  }
  html body #view-carteira
  .page-head h1 .wow-hero-accent {
    margin-top: 5px !important;
  }
  html body #view-carteira
  .page-head .hero-context-subtitle {
    max-width: 100%;
    margin-top: 20px !important;
  }
}
/* ==================================================
   REDESIGN_MOBILE_CONSOLIDADO_7D1
   Cabeçalho e navegação mobile.
   Consolidação das quatro versões anteriores.
   Desktop não alterado.
   ================================================== */

@media screen and (max-width: 767px) {

  /* Cabeçalho: logo e conta na primeira linha,
     navegação na segunda. */

  html body .topbar {
    display: grid !important;
    grid-template-columns:
      minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand account"
      "nav nav" !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 12px 14px 0 !important;
    box-sizing: border-box !important;
  }

  html body .topbar > .brand {
    grid-area: brand !important;
    min-width: 0 !important;
    width: auto !important;
    justify-self: start !important;
    align-self: center !important;
    margin: 0 !important;
  }

  html body .topbar .brand-logo {
    display: block;
    width: min(100%, 160px) !important;
    height: auto !important;
    max-height: 46px !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  html body .topbar > .account {
    grid-area: account !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    justify-self: end !important;
    gap: 7px !important;
    min-width: 0 !important;
    width: auto !important;
    margin: 0 !important;
  }

  html body .topbar
  > .account > #logoutBtn {
    flex: 0 0 auto !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 8px !important;
  }

  /* Faixa de navegação horizontal. */

  html body .topbar > #crmNav {
    grid-area: nav !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px 0 11px !important;
    border-top:
      1px solid rgba(130,130,130,.2);
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  html body .topbar
  > #crmNav::-webkit-scrollbar {
    display: none;
  }

  /* Dimensões finais dos botões.
     Somente 2 px entre ícone e texto. */

  html body .topbar > #crmNav > button {
    position: relative !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    column-gap: 2px !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    border-radius: 11px !important;
    white-space: nowrap !important;
    text-align: center !important;
    line-height: 1.2 !important;
    letter-spacing: normal;
    transform: none;
    scroll-snap-align: start;
  }

  /* Ícones. */

  html body .topbar
  > #crmNav > button .nav-icon {
    position: static !important;
    display: inline-flex !important;
    flex: 0 0 16px !important;
    flex-shrink: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  html body .topbar
  > #crmNav > button svg {
    position: static !important;
    display: block !important;
    flex: 0 0 16px !important;
    flex-shrink: 0 !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  html body .topbar
  > #crmNav > button > .nav-icon svg {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Texto. */

  html body .topbar
  > #crmNav > button span:not(.nav-icon) {
    position: static !important;
    display: inline-block !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
  }

  html body .topbar + #crmNav {
    display: none !important;
  }

  /* Fonte nativa em dispositivos Apple,
     com alternativas para outros sistemas. */

  html body,
  html body button,
  html body input,
  html body select,
  html body textarea,
  html body table {
    font-family:
      -apple-system,
      BlinkMacSystemFont,
      "SF Pro Text",
      "SF Pro Display",
      "Segoe UI",
      Roboto,
      Arial,
      sans-serif !important;
  }
}

/* Ajustes exclusivos de celulares estreitos. */

@media screen and (max-width: 520px) {

  html body .topbar {
    padding: 11px 12px 0 !important;
    column-gap: 8px !important;
  }

  html body .topbar .brand-logo {
    width: min(100%, 140px) !important;
    max-height: 39px !important;
  }

  html body .topbar
  > .account > .account-copy {
    display: none !important;
  }

  html body .topbar > #crmNav {
    gap: 4px !important;
  }

  html body .topbar > #crmNav > button {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  html body .topbar
  > #crmNav > button .nav-icon,
  html body .topbar
  > #crmNav > button svg {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
  }
}



/* ==================================================
   REDESIGN_ACOES_FILTROS_NEUTROS_7D3_V1

   1. Ações principais na mesma linha no desktop.
   2. Filtros em tons neutros nos três perfis.
   3. Nenhuma alteração nas funcionalidades.
   ================================================== */


/* 1. DESKTOP: TRÊS BOTÕES NA MESMA LINHA */

@media screen and (min-width: 900px) {

  html body #view-carteira
  .main-client-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;

    align-items: center !important;
    justify-content: flex-start !important;

    gap: 10px !important;

    width: max-content !important;
    max-width: 100% !important;

    margin: 0 !important;
  }

  html body #view-carteira
  .main-client-actions > #newCustomerBtn {
    order: 1 !important;
  }

  html body #view-carteira
  .main-client-actions > #importOpen {
    order: 2 !important;
  }

  html body #view-carteira
  .main-client-actions > #exportBase {
    order: 3 !important;
  }

  html body #view-carteira
  .main-client-actions > button {
    flex: 0 0 auto !important;

    width: auto !important;
    min-width: 0 !important;

    margin: 0 !important;

    white-space: nowrap !important;
  }

  /* Se os seletores e botões estiverem
     dentro da barra unificada, impedir que
     o próprio grupo de ações seja dividido. */

  html body #view-carteira
  #portfolioControlBar .main-client-actions {
    flex: 0 0 auto !important;
    align-self: center !important;
  }
}


/* Preservar as permissões de visibilidade. */

html body #view-carteira
.main-client-actions > [hidden] {
  display: none !important;
}


/* 2. FILTROS: MESMA FAMÍLIA DE CORES
   DOS CARTÕES DE INDICADORES */

/* Tema escuro */

html[data-theme="dark"] body
#view-carteira .toolbar,
html[data-theme="dark"] body
#view-carteira .filters,
html[data-theme="dark"] body
#view-carteira .filter-bar {
  background: #1d1d1d !important;
  background-image: none !important;

  border-color: #393939 !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 9px 25px rgba(0,0,0,.10) !important;
}

/* Campos internos no tema escuro */

html[data-theme="dark"] body
#view-carteira .toolbar input,
html[data-theme="dark"] body
#view-carteira .toolbar select,
html[data-theme="dark"] body
#view-carteira .filters input,
html[data-theme="dark"] body
#view-carteira .filters select,
html[data-theme="dark"] body
#view-carteira .filter-bar input,
html[data-theme="dark"] body
#view-carteira .filter-bar select {
  background: #262626 !important;
  background-image: none !important;

  color: #f0f0f0 !important;
  border-color: #414141 !important;
}

/* Tema claro */

html:not([data-theme="dark"]) body
#view-carteira .toolbar,
html:not([data-theme="dark"]) body
#view-carteira .filters,
html:not([data-theme="dark"]) body
#view-carteira .filter-bar {
  background: #ffffff !important;
  background-image: none !important;

  border-color: #e5e5e5 !important;

  box-shadow:
    0 10px 28px rgba(0,0,0,.035) !important;
}

/* Campos internos no tema claro */

html:not([data-theme="dark"]) body
#view-carteira .toolbar input,
html:not([data-theme="dark"]) body
#view-carteira .toolbar select,
html:not([data-theme="dark"]) body
#view-carteira .filters input,
html:not([data-theme="dark"]) body
#view-carteira .filters select,
html:not([data-theme="dark"]) body
#view-carteira .filter-bar input,
html:not([data-theme="dark"]) body
#view-carteira .filter-bar select {
  background: #f8f8f8 !important;
  background-image: none !important;

  color: #171717 !important;
  border-color: #dedede !important;
}



/* ==================================================
   REDESIGN_BOTOES_ACAO_ALTURA_UNIFICADA_V1

   Igualar a altura visual dos botões:
   - Novo Cliente
   - Importar lista de clientes
   - Exportar base
   ================================================== */

html body #view-carteira .main-client-actions > button,
html body #view-carteira .main-client-actions > a,
html body #view-carteira .main-client-actions > #newCustomerBtn,
html body #view-carteira .main-client-actions > #importOpen,
html body #view-carteira .main-client-actions > #exportBase {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  min-height: 46px !important;
  height: 46px !important;

  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 18px !important;
  padding-right: 18px !important;

  box-sizing: border-box !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

html body #view-carteira .main-client-actions > #newCustomerBtn svg {
  flex: 0 0 auto !important;
}

html body #view-carteira .main-client-actions > #newCustomerBtn {
  gap: 10px !important;
}

html body #view-carteira .main-client-actions > #importOpen,
html body #view-carteira .main-client-actions > #exportBase {
  white-space: nowrap !important;
}



/* KANBAN_NOVO_PEDIDO_WHATSAPP_V1 */

#view-carteira .kanban-compact-card
> .kanban-card-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 7px !important;

  width: 100%;
  margin: 9px 0 11px;
}

#view-carteira .kanban-compact-card
> .kanban-card-actions
> .kanban-compact-toggle,

#view-carteira .kanban-compact-card
> .kanban-card-actions
> .kanban-novo-pedido {
  display: inline-flex !important;

  flex: 0 0 auto !important;

  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  min-width: 0 !important;

  min-height: 30px !important;
  height: 30px !important;

  margin: 0 !important;
  padding: 0 10px !important;

  border: 1px solid
    var(--border, #454545) !important;

  border-radius: 10px !important;

  background: transparent !important;
  color: inherit !important;

  font: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1 !important;

  white-space: nowrap !important;
  text-decoration: none !important;

  cursor: pointer;
  box-sizing: border-box;
}

#view-carteira .kanban-card-actions
> button:hover {
  border-color: currentColor !important;
}

#view-carteira .kanban-card-actions
> button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}



/* ==================================================
   KANBAN_RESTAURAR_EXPANDIR_ALINHAR_TOOLBAR_V1

   Restaurar Expandir/Recolher individual.
   Manter Novo Pedido no cartão Em Processo.
   Trazer Expandir todos para a esquerda.
   ================================================== */


/* 1. Manter a linha dos botões visível
   mesmo quando o cartão estiver recolhido. */

html body #view-carteira
#kanbanBoard .cards
> .kanban-compact-card:not(.is-expanded)
> .kanban-card-actions,

html body #view-carteira
#kanbanBoard .cards
> .kanban-compact-card.is-expanded
> .kanban-card-actions {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;

  flex-direction: row !important;
  flex-wrap: wrap !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 7px !important;

  width: 100% !important;
  height: auto !important;
  min-height: 30px !important;

  margin: 9px 0 11px !important;
  padding: 0 !important;

  overflow: visible !important;
}


/* 2. Restaurar o botão individual,
   tanto recolhido quanto expandido. */

html body #view-carteira
#kanbanBoard .kanban-compact-card
> .kanban-card-actions
> .kanban-compact-toggle {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;

  position: relative !important;

  flex: 0 0 auto !important;

  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  min-width: 0 !important;

  height: 30px !important;
  min-height: 30px !important;

  margin: 0 !important;
  padding: 0 10px !important;

  white-space: nowrap !important;
  cursor: pointer !important;
}


/* 3. Novo Pedido continua ao lado,
   com exatamente a mesma altura. */

html body #view-carteira
#kanbanBoard .kanban-compact-card
> .kanban-card-actions
> .kanban-novo-pedido {
  display: inline-flex !important;
  visibility: visible !important;

  align-items: center !important;
  justify-content: center !important;

  flex: 0 0 auto !important;

  height: 30px !important;
  min-height: 30px !important;

  margin: 0 !important;
  padding: 0 10px !important;

  white-space: nowrap !important;
}


/* 4. Expandir todos:
   título e botão alinhados à esquerda. */

html body #view-carteira
#kanbanCompactToolbar {
  display: flex !important;

  flex-direction: row !important;
  flex-wrap: wrap !important;

  align-items: center !important;
  justify-content: flex-start !important;

  gap: 12px !important;

  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}


/* 5. Impedir que regras anteriores
   empurrem o botão para a direita. */

html body #view-carteira
#kanbanCompactToolbar > button {
  position: static !important;

  margin-left: 0 !important;
  margin-right: 0 !important;

  justify-self: start !important;
  align-self: center !important;

  flex: 0 0 auto !important;

  transform: none !important;
}

html body #view-carteira
#kanbanCompactToolbar > span {
  margin-left: 0 !important;
  margin-right: 0 !important;

  flex: 0 0 auto !important;
}



/* CRM_SOLICITACOES_CERTIFICADOS_V1 */

#view-pedidos .crm-requests-section {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--border, #444);
  border-radius: 20px;
  background: var(--panel, #1c1c1c);
}

#view-pedidos .crm-requests-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}

#view-pedidos .crm-requests-heading h2 {
  margin: 0 0 6px;
}

#view-pedidos .crm-requests-heading p {
  margin: 0;
  opacity: .7;
}

.crm-request-primary {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #777;
  border-radius: 12px;
  background: #f4f4f4;
  color: #171717;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.crm-request-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.crm-requests-scroll {
  width: 100%;
  overflow-x: auto;
}

.crm-requests-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.crm-requests-table th,
.crm-requests-table td {
  padding: 15px 12px;
  border-bottom: 1px solid
    rgba(130,130,130,.17);
}

.crm-request-status {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 650;
}

.crm-request-status.processing {
  background: rgba(184,145,62,.13);
  color: #c99f55;
}

.crm-request-status.completed {
  background: rgba(42,155,105,.13);
  color: #329f72;
}

.crm-request-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.68);
}

.crm-request-form {
  width: min(100%, 510px);
  padding: 25px;
  border-radius: 22px;
  background: #202020;
  color: #f6f6f6;
  border: 1px solid #484848;
  box-shadow: 0 20px 60px
    rgba(0,0,0,.35);
}

.crm-request-form h2 {
  margin: 0 0 20px;
}

.crm-request-explanation {
  margin-bottom: 22px;
  padding: 15px;
  border: 1px solid #466654;
  border-radius: 13px;
  background: #27352d;
  line-height: 1.5;
}

.crm-request-explanation p {
  margin: 8px 0 0;
  font-size: 14px;
}

.crm-request-form label {
  display: grid;
  gap: 9px;
  font-weight: 600;
}

.crm-request-select {
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 10px;
  background: #303030;
  color: white;
  font: inherit;
}

.crm-request-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.crm-request-modal-actions
button:not(.crm-request-primary) {
  padding: 0 15px;
  min-height: 42px;
  border: 1px solid #555;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 600px) {
  #view-pedidos .crm-requests-section {
    padding: 16px;
  }

  .crm-request-form {
    padding: 20px;
  }
}



/* CRM_PEDIDOS_OCULTAR_FINANCEIRO_ESCRITORIO_V1 */

html body
#view-pedidos.crm-solicitacoes-only
> .view-head,

html body
#view-pedidos.crm-solicitacoes-only
> .management-card {
  display: none !important;
}

/* A nova tabela ocupa normalmente
   o espaço liberado pela tabela antiga. */

html body
#view-pedidos.crm-solicitacoes-only
> #crmRequestsSection {
  display: block !important;
  margin-bottom: 0 !important;
}



/* ==================================================
   REDESIGN_FUNDO_VIEWPORT_UNIFORME_V1

   Uniformiza o fundo externo em monitores
   grandes, sem alterar largura, cartões,
   menus ou a iluminação do cabeçalho.
   ================================================== */

html[data-theme="dark"] {
  background-color: #000000 !important;
  min-height: 100%;
}

html[data-theme="dark"] body {
  background-color: #000000 !important;
  min-height: 100vh;
  min-height: 100dvh;
}

/* A área principal acompanha o mesmo preto,
   inclusive quando há pouco conteúdo. */

html[data-theme="dark"] body #crmApp {
  background-color: #000000 !important;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Preservar o tema escuro também quando
   o documento ainda não definiu data-theme. */

html:not([data-theme]) {
  background-color: #000000;
}

html:not([data-theme]) body {
  background-color: #000000;
}



/* REDESIGN_FUNDO_PRETO_ABSOLUTO_V2 */

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] body #crmApp,
html[data-theme="dark"] body #view-carteira,
html[data-theme="dark"] body #view-pedidos,
html[data-theme="dark"] body .crm-view {
  background-color: #000000 !important;
}

/* Cobrir toda a largura e altura do monitor. */

html[data-theme="dark"],
html[data-theme="dark"] body {
  min-width: 100%;
  min-height: 100%;
}

html[data-theme="dark"] body #crmApp {
  min-height: 100vh;
  min-height: 100dvh;
}



/* REDESIGN_RELATORIOS_ORDEM_CORRIGIDA_V2 */

@media screen and (min-width: 900px) {

  html body #portfolioReports .reports-grid {
    display: grid !important;

    grid-template-columns:
      minmax(0, 1fr) minmax(0, 1fr) !important;

    grid-template-rows: auto auto !important;
  }

  html body #portfolioReports .reports-grid
  > .reports-panel:has(#reportsValidity) {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    grid-area: 1 / 1 / 2 / 2 !important;
    min-width: 0 !important;
  }

  html body #portfolioReports .reports-grid
  > .reports-panel:has(#reportsStages) {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    grid-area: 1 / 2 / 2 / 3 !important;
    min-width: 0 !important;
  }

  html body #portfolioReports .reports-grid
  > .reports-panel:has(#reportsExpirations) {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    grid-area: 2 / 1 / 3 / -1 !important;
    min-width: 0 !important;
  }
}

@media screen and (max-width: 899px) {

  html body #portfolioReports .reports-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body #portfolioReports .reports-grid
  > .reports-panel {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    grid-area: auto !important;
    min-width: 0 !important;
  }
}



/* REDESIGN_ACOES_MOUSE_LIGHT_V1 */

/* Centralização vertical da área. */

html body #view-carteira
#portfolioControlBar {
  /* REDESIGN_ACOES_CENTRAGEM_VERTICAL_V2 */

  position: relative !important;
  isolation: isolate;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;

  box-sizing: border-box !important;
  height: auto !important;
  min-height: 104px !important;

  padding-top: 22px !important;
  padding-bottom: 22px !important;

  overflow: hidden;
}

/* Os botões permanecem em uma única
   linha no desktop e centralizados
   verticalmente no contêiner. */

html body #view-carteira
#portfolioControlBar .main-client-actions {
  position: relative !important;
  z-index: 1;

  display: flex !important;
  align-items: center !important;

  align-self: center !important;

  margin-top: 0 !important;
  margin-bottom: 0 !important;

  top: auto !important;
  bottom: auto !important;
  transform: none !important;
}

/* Camada luminosa independente,
   sem substituir o fundo existente. */

html body #view-carteira
#portfolioControlBar
> .crm-actions-mouse-light {
  position: absolute;
  z-index: 0;

  top: 0;
  left: 0;

  width: 520px;
  height: 360px;

  pointer-events: none;

  transform:
    translate3d(
      calc(var(--crm-light-x, -1000px) - 50%),
      calc(var(--crm-light-y, -1000px) - 50%),
      0
    );

  background: radial-gradient(
    ellipse at center,
    rgba(177, 202, 193, .15) 0%,
    rgba(153, 178, 169, .085) 30%,
    rgba(125, 143, 137, .035) 57%,
    transparent 73%
  );

  opacity: 0;

  transition: opacity .25s ease;
}

html body #view-carteira
#portfolioControlBar.crm-actions-light-active
> .crm-actions-mouse-light {
  opacity: 1;
}

/* Preservar os botões acima da luz. */

html body #view-carteira
#portfolioControlBar .main-client-actions
> button {
  position: relative;
  z-index: 1;
}

/* Em telas sensíveis ao toque,
   não exibir um foco de luz parado. */

@media (hover: none) {
  html body #view-carteira
  #portfolioControlBar
  > .crm-actions-mouse-light {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body #view-carteira
  #portfolioControlBar
  > .crm-actions-mouse-light {
    transition: none;
  }
}



/* CRM_ORDEM_VISUAL_BOTOES_V2 */
/* Ordem visual da barra de ações do CRM. */

#portfolioControlBar .main-client-actions
#newCustomerBtn {
    order: 1 !important;
}

#portfolioControlBar .main-client-actions
#importCertificatesOpen {
    order: 2 !important;
}

#portfolioControlBar .main-client-actions
#importOpen {
    order: 3 !important;
}

#portfolioControlBar .main-client-actions
#exportBase {
    order: 4 !important;
}


/* MOBILE_FINAL_20261023
   1) Abas do menu: cada aba ocupa a largura do proprio conteudo (icone + texto) e o menu rola na horizontal.
   2) Quadro de solicitacoes: usa a superficie do tema (antes caia num fundo escuro fixo no tema claro). */
@media (max-width: 880px) {
  html body .topbar > #crmNav {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
  }
  html body .topbar > #crmNav > button[data-view] {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    gap: 7px !important;
    white-space: nowrap !important;
  }
  html body .topbar > #crmNav > button[data-view] .crm-nav-icon {
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
  }
}
#view-pedidos .crm-requests-section {
  background: var(--surface, #fff);
  color: var(--text, #111);
  border-color: var(--line, rgba(130,130,130,.25));
}
