/* tz-custom.css  —  classes de utilidade para o tema Trezo */

/* main-content: transição apenas de padding (não transition:all, que cria
   compositing layer no Chrome e quebra position:fixed nos filhos) */
#main-content {
  transition: padding-left .25s ease, margin-left .25s ease;
  padding-bottom: 30px;
}

/* Utilitários ausentes no CSS compilado */
.gap-\[16px\] { gap: 16px; }
.gap-\[11px\] { gap: 11px; }
.mt-auto  { margin-top: auto; }
.flex-1   { flex: 1 1 0%; }
.py-\[40px\]  { padding-top: 40px; padding-bottom: 40px; }
.py-\[50px\]  { padding-top: 50px; padding-bottom: 50px; }
.py-\[60px\]  { padding-top: 60px; padding-bottom: 60px; }
.py-\[80px\]  { padding-top: 80px; padding-bottom: 80px; }

/* Classes de largura para campos de formulário */
/* Mínimos */
.tz-min-70  { min-width: 70px; }
.tz-min-80  { min-width: 80px; }
.tz-min-90  { min-width: 90px; }
.tz-min-100 { min-width: 100px; }
.tz-min-110 { min-width: 110px; }
.tz-min-120 { min-width: 120px; }
.tz-min-130 { min-width: 130px; }
.tz-min-140 { min-width: 140px; }
.tz-min-150 { min-width: 150px; }
.tz-min-160 { min-width: 160px; }
.tz-min-180 { min-width: 180px; }
.tz-min-200 { min-width: 200px; }
.tz-min-210 { min-width: 210px; }
.tz-min-220 { min-width: 220px; }
.tz-min-240 { min-width: 240px; }
.tz-min-280 { min-width: 280px; }
.tz-min-400 { min-width: 400px; }
.tz-min-480 { min-width: 480px; }
.tz-min-520 { min-width: 520px; }
.tz-min-560 { min-width: 560px; }
.tz-min-460 { min-width: 460px; }
.tz-min-500 { min-width: 500px; }
.tz-min-580 { min-width: 580px; }
.tz-min-600 { min-width: 600px; }
.tz-min-640 { min-width: 640px; }
.tz-min-700 { min-width: 700px; }
.tz-min-800 { min-width: 800px; }
/* Máximos */
.tz-max-90  { max-width: 90px; }
.tz-max-100 { max-width: 100px; }
.tz-max-110 { max-width: 110px; }
.tz-max-120 { max-width: 120px; }
.tz-max-130 { max-width: 130px; }
.tz-max-140 { max-width: 140px; }
.tz-max-160 { max-width: 160px; }
.tz-max-170 { max-width: 170px; }
.tz-max-180 { max-width: 180px; }
.tz-max-200 { max-width: 200px; }
.tz-max-220 { max-width: 220px; }
.tz-max-240 { max-width: 240px; }
.tz-max-280 { max-width: 280px; }
.tz-max-300 { max-width: 300px; }
.tz-max-320 { max-width: 320px; }
.tz-max-360 { max-width: 360px; }
.tz-max-420 { max-width: 420px; }
.tz-max-480 { max-width: 480px; }
.tz-max-150 { max-width: 150px; }
/* Min-height utilitários */
.tz-min-h-360 { min-height: 360px; }
/* Flex grow proporcional */
.tz-flex-2 { flex: 2 1 0%; }
.tz-flex-3 { flex: 3 1 0%; }
/* Botão ícone 14px (add inline em campos) */
.tz-btn-xxs { width: 14px !important; height: 14px !important; padding: 0 !important; }
/* Pointer events none (campos de exibição somente leitura) */
.tz-pointer-none { pointer-events: none; }
/* Flex coluna scrollável — usado em forms dentro de modais (flex:1 min-height:0 para overflow funcionar) */
.tz-flex-col-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Botão ícone estreito (busca CNPJ/CEP) */
.tz-btn-icon { padding: 6px 10px !important; flex-shrink: 0; }
/* Card sem padding-bottom (usado no card com abas) */
.tz-pb-0 { padding-bottom: 0 !important; }
/* Switch menor (inline com label, ex: IE Isento) */
.tz-switch-sm { width: 32px !important; height: 18px !important; }
.tz-switch-sm::after { top: 2px; left: 2px; width: 14px; height: 14px; }
.tz-switch-sm:checked::after { transform: translateX(14px); }

.tz-notif-badge {
  position: absolute; top: -6px; right: -8px; z-index: 1;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px;
  background: var(--color-danger-500, #FF4023); color: #fff; font-size: 10px; font-weight: 600;
  line-height: 16px; text-align: center; box-sizing: border-box;
}

/* Botões */
.tz-btn-primary {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 500;
  transition: all .2s; border-radius: 6px; font-size: .875rem;
  padding: 8px 16px; background: #605dff; color: #fff;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.tz-btn-primary:hover { background: #4e4bdb; color: #fff; }
.tz-btn-primary:disabled { opacity: .65; cursor: not-allowed; }

.tz-btn-secondary {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 500;
  transition: all .2s; border-radius: 6px; font-size: .875rem;
  padding: 8px 16px; border: 1px solid #e5e7eb; background: #fff;
  color: #111827; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.tz-btn-secondary:hover { background: #f9fafb; }
.tz-btn-secondary:disabled { opacity: .65; cursor: not-allowed; }
.dark .tz-btn-secondary { background: #0c1427; border-color: #172036; color: #fff; }
.dark .tz-btn-secondary:hover { background: #15203c; }

/* Outlined primary — padrão "Add New" do Trezo */
.tz-btn-outline {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 500;
  transition: all .2s; border-radius: 6px; font-size: .875rem;
  padding: 6px 13px; background: transparent; color: #605dff;
  border: 1px solid #605dff; cursor: pointer; white-space: nowrap;
  text-decoration: none;
}
.tz-btn-outline:hover { background: #605dff; color: #fff; }

/* Botão de opções (dropdown) */
.tz-btn-options {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 500;
  transition: all .2s; border-radius: 6px; font-size: .875rem;
  padding: 6px 13px; border: 1px solid #e5e7eb; background: #fff;
  color: #111827; cursor: pointer; white-space: nowrap;
}
.tz-btn-options:hover { background: #f9fafb; }
.dark .tz-btn-options { background: #0c1427; border-color: #172036; color: #fff; }
.dark .tz-btn-options:hover { background: #15203c; }
.tz-btn-options--active,
.tz-btn-options--active:hover { background: #605dff !important; border-color: #605dff !important; color: #fff !important; }
.dark .tz-btn-options--active,
.dark .tz-btn-options--active:hover { background: #605dff !important; border-color: #605dff !important; }

/* Botão de perigo */
.tz-btn-danger {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 500;
  transition: all .2s; border-radius: 6px; font-size: .875rem;
  padding: 8px 16px; border: 1px solid #fecaca; background: #fff5f5;
  color: #ef4444; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.tz-btn-danger:hover { background: #fef2f2; }
.dark .tz-btn-danger { background: #0c1427; border-color: #3f1515; color: #f87171; }

/* Botão de exclusão (sólido vermelho — confirmação de delete) */
.tz-btn-delete {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 500;
  transition: all .2s; border-radius: 6px; font-size: .875rem;
  padding: 8px 16px; border: 1px solid transparent; background: #ef4444;
  color: #fff; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.tz-btn-delete:hover { background: #dc2626; }

/* Botões sobre card primary (resumo de dashboards) */
.tz-hero-btn {
  display: flex; align-items: center; gap: 8px; font-weight: 500;
  transition: all .2s; border-radius: 6px; font-size: .875rem;
  padding: 8px 16px; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.tz-hero-btn--ghost { background: rgba(255,255,255,.12); color: #fff; }
.tz-hero-btn--ghost:hover { background: rgba(255,255,255,.22); color: #fff; }
.tz-hero-btn--solid { background: #fff; color: #605dff; }
.tz-hero-btn--solid:hover { background: #eef1f5; color: #4e4bdb; }

/* Modificador pequeno */
.tz-btn-sm { padding: 0 12px; font-size: .8125rem; height: 34px; box-sizing: border-box; }
.tz-btn-outline.tz-btn-sm,
.tz-btn-options.tz-btn-sm { padding: 4px 10px; }

/* Grupo de botões-alternador (Extrato/Fluxo, Dia/Sem/Mês) — MESMA altura do
   `tz-btn-sm` que costuma ficar ao lado (34px, com a borda dentro da conta).
   Sem isto o grupo nasce da altura do conteúdo (padding + texto) e fica alguns
   pixels mais baixo que o botão "Filtros", desalinhando a barra inteira. */
.tz-btn-group {
  display: inline-flex; align-items: stretch;
  height: 34px; box-sizing: border-box;
  border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden;
}
.dark .tz-btn-group { border-color: #172036; }
.tz-btn-group > button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 12px; font-size: .8125rem; font-weight: 500;
  transition: all .2s; cursor: pointer; white-space: nowrap;
}
.tz-btn-group > button + button { border-left: 1px solid #e5e7eb; }
.dark .tz-btn-group > button + button { border-left-color: #172036; }

/* Inputs e selects — 40px no sistema todo (era o h-[55px] do Trezo até 2026-10-22) */
textarea.tz-input, textarea.tz-textarea { height: auto; padding-top: 14px; }
.tz-input, .kt-input {
  height: 40px; border-radius: 6px; color: #111827;
  border: 1px solid #e5e7eb; background: #fff;
  padding: 0 17px; display: block; width: 100%; outline: none;
  transition: border-color .2s; cursor: text;
}
.tz-input::placeholder, .kt-input::placeholder { color: #9ca3af; }

/* Input na altura do tz-btn-sm (34px), para alinhar com um botão ao lado.
   Precisa ser CLASSE e não `style` inline: o Flatpickr com `altInput` cria um
   input novo e visível copiando só as CLASSES do original — o style inline fica
   no input escondido e o campo aparece com a altura padrão. Dois seletores de
   classe vencem o `.tz-input` sem precisar de !important. */
.tz-input.tz-input-sm  { height: 34px; padding: 0 12px; }
.tz-input.tz-input-date { width: 130px; }

/* Botão de ícone ao lado de um campo ("+" do Cliente): quadrado, na altura dele. */
.tz-btn-campo { height: 40px; width: 40px; padding: 0 !important; justify-content: center; flex-shrink: 0; }
.tz-input:focus, .kt-input:focus { border-color: #605dff; }
.tz-input:disabled, .kt-input:disabled { opacity: .65; background: #f3f4f6; cursor: not-allowed; }
.dark .tz-input, .dark .kt-input { color: #fff; border-color: #172036; background: #0c1427; }
.dark .tz-input::placeholder, .dark .kt-input::placeholder { color: #6b7280; }
.dark .tz-input:disabled, .dark .kt-input:disabled { background: #0f1a30; }

/* tz-input usado como display somente-leitura (ex: total calculado) — texto centralizado na vertical, mesma fonte do input */
.tz-input-display { display: flex; align-items: center; opacity: .65; overflow: hidden; white-space: nowrap; }

.tz-select, .kt-select {
  height: 40px; border-radius: 6px; color: #111827;
  border: 1px solid #e5e7eb; background: #fff;
  padding: 0 13px; display: block; width: 100%; outline: none;
  transition: all .2s; cursor: pointer;
}
.tz-select:focus, .kt-select:focus { border-color: #605dff; }

/* Select de barra de ações (mês/ano no cabeçalho do card) — MESMA altura do
   `tz-btn-sm` que fica ao lado, 34px. O `tz-select` normal nasce para
   formulário: altura cheia e `width:100%`, então numa barra flex ele estica e fica
   mais alto que o botão. Mesmo argumento do `tz-btn-group` acima. */
.tz-select-sm {
  height: 34px; width: auto; padding: 0 10px; font-size: .8125rem;
}
.dark .tz-select, .dark .kt-select { color: #fff; border-color: #172036; background: #0c1427; }

/* Seleção múltipla (regras de comissão: vários canais/categorias na mesma regra).
   `height` fixo do tz-select mostraria uma linha só e esconderia as demais. */
.tz-multi {
  height: auto !important; min-height: 110px; max-height: 190px;
  overflow-y: auto; padding: 6px !important; cursor: default;
}
.tz-multi option { padding: 5px 8px; border-radius: 4px; cursor: pointer; }
.tz-multi option:checked {
  background: #605dff linear-gradient(0deg, #605dff 0%, #605dff 100%);
  color: #fff;
}
.dark .tz-multi option:checked { color: #fff; }

/* Input com botão de busca interno (absoluto) */
.tz-input-with-btn { position: relative; }
.tz-input-with-btn .tz-input,
.tz-input-with-btn .kt-input { padding-right: 50px !important; }
.tz-input-btn {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 48px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-left: 1px solid #e5e7eb;
  border-top-right-radius: 6px; border-bottom-right-radius: 6px;
  cursor: pointer; color: #6b7280; transition: background .2s, color .2s;
}
.tz-input-btn:hover { background: rgba(0,0,0,.04); color: #605dff; }
.tz-input-btn:disabled { opacity: .5; cursor: not-allowed; }
.dark .tz-input-btn { border-color: #172036; color: #6b7280; }
.dark .tz-input-btn:hover { background: rgba(255,255,255,.05); color: #605dff; }

/* Toggle switch */
.tz-switch {
  appearance: none; -webkit-appearance: none;
  width: 40px; height: 22px; border-radius: 11px;
  background: #e5e7eb; cursor: pointer; transition: background .2s;
  flex-shrink: 0; position: relative; display: inline-block;
}
.tz-switch:checked { background: #605dff; }
.tz-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tz-switch:checked::after { transform: translateX(18px); }

/* Abas (tabs) — underline destacado */
.tz-tabs {
  display: flex; flex-wrap: wrap; gap: 0;
  overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
}
.tz-tabs::-webkit-scrollbar { display: none; }

.tz-tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 20px; font-size: .875rem; font-weight: 500;
  color: #6b7280; background: transparent; border: none;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}
.tz-tab-btn:hover { color: #111827; background: rgba(96,93,255,.04); }
.tz-tab-btn.active { color: #605dff; border-bottom-color: #605dff; font-weight: 600; }
.dark .tz-tab-btn { color: #9ca3af; }
.dark .tz-tab-btn:hover { color: #fff; background: rgba(255,255,255,.04); }
.dark .tz-tab-btn.active { color: #605dff; }

/* Avatar upload */
.tz-avatar-upload {
  width: 80px; height: 80px; border-radius: 12px;
  border: 2px dashed #e5e7eb; background: #f9fafb;
  cursor: pointer; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: border-color .2s;
}
.tz-avatar-upload:hover { border-color: #605dff; }
.dark .tz-avatar-upload { border-color: #172036; background: #15203c; }
.tz-avatar-upload img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.tz-avatar-upload .tz-cam-overlay {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,.3);
  opacity: 0; transition: opacity .2s; border-radius: 10px;
}
.tz-avatar-upload:hover .tz-cam-overlay { opacity: 1; }

/* Cards de upload de logo (componente independente do tz-avatar-upload) */
.tz-logo-card {
  border: 2px dashed #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f9fafb;
  transition: border-color .2s;
  min-height: 80px;
}
.tz-logo-card:hover { border-color: #605dff; }
.dark .tz-logo-card { border-color: #172036; background: #0c1427; }
.dark .tz-logo-card:hover { border-color: #605dff; }
.tz-logo-card__img {
  max-height: 48px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.tz-logo-card__icon-img {
  max-height: 44px;
  max-width: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.tz-logo-card__hint {
  font-size: .7rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1.3;
}
.tz-logo-card__placeholder-icon { font-size: 32px; display: block; line-height: 1; }
.tz-logo-card__overlay-icon     { font-size: 22px; display: block; line-height: 1; }
.tz-logo-card__overlay-icon--sm { font-size: 18px; display: block; line-height: 1; }
.tz-logo-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .2s;
}
.tz-logo-card:hover .tz-logo-card__overlay { opacity: 1; }

/* Variantes de upload para favicon (mantém tz-avatar-upload) */
.tz-favicon-upload     { width: 48px; height: 48px; border-radius: 8px; }
.tz-favicon-upload img { object-fit: contain; }
.tz-favicon-upload .tz-cam-overlay { border-radius: 8px; }
/* Input file oculto — ativado via click no container de upload */
.tz-file-input { display: none; }

/* Tabela (th) */
.tz-th {
  font-weight: 500; text-align: left; padding: 11px 20px;
  background: #f9fafb; white-space: nowrap;
}
.dark .tz-th { background: #15203c; color: #fff; }
.tz-th:first-child { border-radius: 6px 0 0 0; }
.tz-th:last-child  { border-radius: 0 6px 0 0; }
.tz-th.text-center { text-align: center; }
.tz-th.text-right  { text-align: right; }
.tz-th.tz-sortable { cursor: pointer; user-select: none; }
.tz-th.tz-sortable:hover { background: #f0f0fe; }
.dark .tz-th.tz-sortable:hover { background: #1a2a4a; }
.tz-sort-label { display: inline-flex; align-items: center; gap: 2px; }

/* Campo de busca */
.tz-search-wrap { position: relative; width: 265px; max-width: 100%; }

.tz-search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  line-height: 0; pointer-events: none; display: flex; align-items: center;
}
.tz-search-icon i { font-size: 20px; line-height: 1; display: block; }

.tz-search-input { padding-left: 38px !important; padding-right: 13px; }
.tz-search-input.has-clear { padding-right: 34px; }

.tz-search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; line-height: 0; text-decoration: none;
}
.tz-search-clear i { font-size: 16px; line-height: 1; display: block; }

/* Ícones de material symbols */
.tz-icon-sm { font-size: 18px !important; display: block; line-height: 1; }
.tz-icon-md { font-size: 22px !important; display: block; line-height: 1; }

/* Breadcrumb */
.tz-bc-item { display: inline-block; position: relative; font-size: .875rem; margin: 0 11px; }
.tz-bc-item:first-child { margin-left: 0; }
.tz-bc-item:last-child  { margin-right: 0; }
.tz-bc-link { display: inline-block; position: relative; transition: color .2s; }
.tz-bc-link:hover { color: #605dff; }
.tz-bc-link-home { padding-left: 26px; }
.tz-bc-icon {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  font-size: 18px; display: block; line-height: 1;
}

/* Dropdown de opções */
.tz-dropdown-wrap { position: relative; }
.tz-dropdown-menu {
  position: absolute; right: 0; top: 100%; margin-top: 5px;
  min-width: 160px; z-index: 50; background: #fff;
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  border: 1px solid #f3f4f6; overflow: hidden;
}
.dark .tz-dropdown-menu { background: #0c1427; border-color: #172036; }
.tz-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px; font-size: .875rem;
  background: none; border: none; cursor: pointer; text-align: left;
  text-decoration: none; transition: background .15s;
  color: #374151;
}
.tz-dropdown-item:hover { background: #f9fafb; }
.dark .tz-dropdown-item { color: #d1d5db; }
.dark .tz-dropdown-item:hover { background: #15203c; }
.tz-dropdown-item i { font-size: 18px; display: block; line-height: 1; flex-shrink: 0; }

/* Select2 (overrides sobre select2.min.css) */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
  height: 40px !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  transition: border-color .2s;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #605dff !important;
  outline: none !important;
  box-shadow: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  flex: 1; padding: 0 36px 0 13px !important;
  font-size: .875rem !important; color: #111827 !important;
  line-height: normal !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #9ca3af !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px !important; right: 10px !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
  float: none; position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  font-size: 1rem; color: #9ca3af;
}
.select2-dropdown {
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.10) !important;
  z-index: 99999 !important;
}
.select2-container--default .select2-results__option { padding: 9px 14px; font-size: .875rem; color: #374151; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: rgba(96,93,255,.08) !important; color: #605dff !important; }
.select2-container--default .select2-results__option[aria-selected=true] { background: rgba(96,93,255,.06); font-weight: 500; color: #605dff; }
.select2-search--dropdown .select2-search__field { border: 1px solid #e5e7eb !important; border-radius: 4px; padding: 6px 10px; font-size: .875rem; outline: none; }
.select2-search--dropdown .select2-search__field:focus { border-color: #605dff !important; }
/* Dark */
.dark .select2-container--default .select2-selection--single { background: #0c1427 !important; border-color: #172036 !important; }
.dark .select2-container--default.select2-container--focus .select2-selection--single,
.dark .select2-container--default.select2-container--open .select2-selection--single { border-color: #605dff !important; }
.dark .select2-container--default .select2-selection--single .select2-selection__rendered { color: #fff !important; }
.dark .select2-dropdown { background: #0c1427 !important; border-color: #172036 !important; }
.dark .select2-container--default .select2-results__option { color: #d1d5db; }
.dark .select2-container--default .select2-results__option--highlighted[aria-selected] { background: rgba(96,93,255,.15) !important; color: #605dff !important; }
.dark .select2-search--dropdown .select2-search__field { background: #111c35 !important; border-color: #172036 !important; color: #fff !important; }

/* Sidebar escura independente do tema do sistema */
/* Replica exatamente as cores do dark mode do Trezo só no sidebar */

/* Fundo geral */
#sidebar-area.tz-sidebar-dark {
  background-color: #0c1427 !important;
}
#sidebar-area.tz-sidebar-dark .logo {
  background-color: #0c1427 !important;
  border-color: #172036 !important;
}

/* Texto do logo e seções */
#sidebar-area.tz-sidebar-dark span.font-bold,
#sidebar-area.tz-sidebar-dark .accordion-item {
  color: #fff !important;
}

/* Accordion button (título de seção) */
#sidebar-area.tz-sidebar-dark .accordion-button {
  color: #fff !important;
}
#sidebar-area.tz-sidebar-dark .accordion-button:hover {
  background-color: #15203c !important;
  color: #fff !important;
}
#sidebar-area.tz-sidebar-dark .accordion-button:hover .material-symbols-outlined {
  color: #fff !important;
}
/* Estado open/active do accordion */
#sidebar-area.tz-sidebar-dark .accordion-button.open,
#sidebar-area.tz-sidebar-dark .accordion-button.active {
  background-color: #15203c !important;
  color: #fff !important;
}
#sidebar-area.tz-sidebar-dark .accordion-button.open .material-symbols-outlined,
#sidebar-area.tz-sidebar-dark .accordion-button.active .material-symbols-outlined {
  color: #fff !important;
}
/* Seta/arrow do accordion (pseudo-elemento remixicon) */
#sidebar-area.tz-sidebar-dark .accordion-button.toggle::before {
  color: #9ca3af !important;
}
#sidebar-area.tz-sidebar-dark .accordion-button.toggle.open::before {
  color: #fff !important;
}

/* Ícones de seção */
#sidebar-area.tz-sidebar-dark .accordion-button .material-symbols-outlined {
  color: #9ca3af !important;
}

/* Links do submenu */
#sidebar-area.tz-sidebar-dark .sidemenu-link {
  color: #9ca3af !important;
}
#sidebar-area.tz-sidebar-dark .sidemenu-link:hover {
  background-color: #15203c !important;
  color: #605dff !important;
}
/* Estado active/open do submenu */
#sidebar-area.tz-sidebar-dark .sidemenu-link.active,
#sidebar-area.tz-sidebar-dark .sidemenu-link.open {
  background-color: #15203c !important;
  color: #605dff !important;
}
/* Bolinha do submenu */
#sidebar-area.tz-sidebar-dark .sidemenu-link::after {
  border-color: #9ca3af !important;
}
#sidebar-area.tz-sidebar-dark .sidemenu-link.active::after,
#sidebar-area.tz-sidebar-dark .sidemenu-link.open::after {
  border-color: #605dff !important;
}
/* Seta do submenu toggle */
#sidebar-area.tz-sidebar-dark .sidemenu-link.toggle::before {
  color: #9ca3af !important;
}
#sidebar-area.tz-sidebar-dark .sidemenu-link.toggle.open::before {
  color: #fff !important;
}

/* Utilitários de max-width */
.tz-max-400 { max-width: 400px; }

/* Ponto de status na aba */
.tz-tab-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-left: 4px; flex-shrink: 0;
}
.tz-tab-dot--danger  { background: #ef4444; }
.tz-tab-dot--success { background: #22c55e; }

/* Botão remover upload */
.tz-upload-remove-btn {
  font-size: .75rem; color: #ef4444; background: none; border: none;
  padding: 0; cursor: pointer; text-align: left; line-height: 1.4;
}
.tz-upload-remove-btn:hover { color: #b91c1c; }

/* Seções de configuração (Aparência) */
.tz-settings-section { margin-bottom: 28px; }
.tz-settings-section--last { margin-bottom: 0; }
.tz-settings-title {
  font-size: .875rem; font-weight: 600;
  color: #111827; margin-bottom: 4px;
}
.dark .tz-settings-title { color: #fff; }
.tz-settings-desc {
  font-size: .75rem; color: #6b7280; margin-bottom: 16px;
}
.tz-settings-divider {
  height: 1px; background: #f3f4f6; margin-bottom: 24px;
}
.dark .tz-settings-divider { background: #172036; }

/* Código inline */
.tz-inline-code {
  background: #f3f4f6; padding: 1px 4px; border-radius: 3px;
  font-size: .75rem; font-family: monospace;
}
.dark .tz-inline-code { background: #15203c; }

/* Certificado A3 — card "em breve" */
.tz-cert-coming-soon {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px; border-radius: 12px;
  border: 2px dashed #e5e7eb;
}
.dark .tz-cert-coming-soon { border-color: #172036; }
.tz-cert-icon-wrap {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  background: #fffbeb; display: flex; align-items: center; justify-content: center;
}
.dark .tz-cert-icon-wrap { background: #1e1a0d; }

/* Alert warning */
.tz-alert-warning {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px; border-radius: 8px;
  background: #fffbeb; border: 1px solid #fde68a;
}
.dark .tz-alert-warning { background: #1e1a0d; border-color: #2e2510; }

/* Label de opção de layout */
.tz-layout-opt-label {
  font-size: .75rem; font-weight: 500;
  color: #374151;
}
.dark .tz-layout-opt-label { color: #d1d5db; }

/* Botões de seleção de layout (company settings) */
.tz-layout-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px; border-radius: 12px; border: 2px solid #e5e7eb;
  cursor: pointer; transition: border-color .2s, background .2s;
  width: 120px; background: none;
}
.tz-layout-opt:hover { border-color: #605dff; }
.tz-layout-opt-active { border-color: #605dff !important; background: rgba(96,93,255,.06); }
.dark .tz-layout-opt { border-color: #172036; }
.dark .tz-layout-opt:hover { border-color: #605dff; }
.tz-layout-preview {
  width: 80px; height: 56px; border-radius: 8px;
  overflow: hidden; border: 1px solid #e5e7eb;
  background: #f9fafb; display: flex;
}
.dark .tz-layout-preview { border-color: #172036; background: #0c1427; }

.tz-layout-sidebar {
  background: #d1d5db; flex-shrink: 0;
  border-radius: 4px 0 0 4px;
}
.tz-layout-sidebar--expanded { width: 20px; }
.tz-layout-sidebar--icons    { width: 10px; }
.tz-layout-sidebar--light    { background: #e5e7eb; }
.tz-layout-sidebar--dark     { background: #1e2a3b; }
.dark .tz-layout-sidebar     { background: #172036; }

.tz-layout-body {
  flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 6px;
}
.tz-layout-line {
  border-radius: 3px; background: #e5e7eb;
}
.tz-layout-line--h8  { height: 8px; }
.tz-layout-line--h6  { height: 6px; background: #f3f4f6; }
.tz-layout-line--w75 { width: 75%; }
.tz-layout-line--w50 { width: 50%; }
.dark .tz-layout-line      { background: #172036; }
.dark .tz-layout-line--h6  { background: #0f1a2e; }

/* Logo no sidebar */
/* !important necessário: Trezo tem .logo img { } com especificidade maior */
.tz-sidebar-logo {
  max-height: 46px !important;
  max-width: 200px !important;
  height: auto !important;
  width: auto !important;
}
.tz-sidebar-logo-icon {
  height: 36px !important;
  width: 36px !important;
  object-fit: contain !important;
}
/* Área de menu da sidebar — pt-[89px] é valor arbitrário do Tailwind
   não presente no CSS pré-compilado do Trezo */
.tz-sidebar-menu-wrap {
  padding-top: 89px;
  padding-left: 25px;
  padding-right: 25px;
  padding-bottom: 20px;
  height: 100vh;
}

/* File input — padrão do tema */
.tz-file-input-field {
  display: block; width: 100%; font-size: .8125rem;
  color: #6b7280; border: 1px solid #e5e7eb;
  border-radius: 6px; cursor: pointer;
  background: #fff; overflow: hidden;
}
.tz-file-input-field::file-selector-button {
  padding: 0 16px; height: 40px;
  border: none; border-right: 1px solid #e5e7eb;
  background: #f9fafb; color: #374151;
  font-size: .8125rem; font-weight: 500;
  cursor: pointer; margin-right: 12px;
  transition: background .2s;
}
.tz-file-input-field::file-selector-button:hover { background: #f3f4f6; }
.dark .tz-file-input-field { color: #9ca3af; border-color: #172036; background: #0c1427; }
.dark .tz-file-input-field::file-selector-button {
  background: #15203c; color: #d1d5db; border-color: #172036;
}

/* Logo da empresa: alternância full ↔ ícone */
/* Dark mode: troca logo claro pelo escuro */
.dark .logo-full      { display: none; }
.dark .logo-full-dark { display: block !important; }
/* Modo ícones (desktop ≥1280px): sidebar recolhida exibe só o ícone */
@media (min-width: 1280px) {
  body.tz-layout-icons #sidebar-area:not(:hover) .logo-full      { display: none !important; }
  body.tz-layout-icons #sidebar-area:not(:hover) .logo-full-dark { display: none !important; }
  body.tz-layout-icons #sidebar-area:not(:hover) .logo-icon      { display: block !important; }
  body.tz-layout-icons #sidebar-area:hover .logo-icon            { display: none !important; }
}

/* ── Modo ícones com expand no hover — SOMENTE DESKTOP ≥1280px ──
   Mobile não é afetado: o burger toggle (active) continua intacto */
@media (min-width: 1280px) {

  /* Sidebar estreita (estado recolhido) */
  body.tz-layout-icons #sidebar-area {
    width: 70px !important;
    overflow: hidden !important;
    z-index: 20 !important;
    transition: width .25s ease !important;
  }

  /* Hover: expande sobre o conteúdo sem empurrar o layout */
  body.tz-layout-icons #sidebar-area:hover {
    width: 260px !important;
    box-shadow: 5px 0 30px rgba(0, 0, 0, .12) !important;
  }

  /* Estado RECOLHIDO (:not(:hover)) */

  /* Logo centralizado */
  body.tz-layout-icons #sidebar-area:not(:hover) .logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body.tz-layout-icons #sidebar-area:not(:hover) .logo a {
    justify-content: center !important;
  }
  body.tz-layout-icons #sidebar-area:not(:hover) .logo span.font-bold,
  body.tz-layout-icons #sidebar-area:not(:hover) .burger-menu {
    display: none !important;
  }

  /* Padding mínimo da área de menu */
  body.tz-layout-icons #sidebar-area:not(:hover) [data-simplebar] {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Botões centralizados sem texto */
  body.tz-layout-icons #sidebar-area:not(:hover) .accordion-button {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-radius: 8px !important;
  }
  body.tz-layout-icons #sidebar-area:not(:hover) .accordion-button .material-symbols-outlined {
    margin: 0 !important;
  }

  /* Esconder: texto, seta, submenus */
  body.tz-layout-icons #sidebar-area:not(:hover) .accordion-button span.title,
  body.tz-layout-icons #sidebar-area:not(:hover) .accordion-button.toggle::before,
  body.tz-layout-icons #sidebar-area:not(:hover) .accordion-collapse {
    display: none !important;
  }

  /* Header e main-content compensam os 70px do sidebar */
  body.tz-layout-icons #header-area {
    left: 85px !important;
    transition: left .25s ease !important;
  }
  body.tz-layout-icons #main-content {
    padding-left: 95px !important;
    transition: padding-left .25s ease !important;
  }
}

/* Drawer lateral de filtros */
.tz-filter-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.35);
  cursor: pointer;
}
.tz-filter-overlay.active { display: block; }
.tz-filter-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 9999;
  width: 300px; max-width: 90vw;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.tz-filter-drawer.tz-open,
.tz-filter-drawer.active { transform: translateX(0); }
.dark .tz-filter-drawer { background: #0c1427; }

/* O corpo do drawer rola; o cabeçalho fica parado.
   Sem isto, drawer com muitos campos (contas a pagar/receber) empurra o botão
   "Aplicar filtros" para fora da tela e NÃO há como alcançá-lo: o drawer é
   `position:fixed` de altura cheia, então quem rola é a página atrás dele.
   `min-height:0` é o que faz o item flex poder encolher abaixo do conteúdo —
   sem ele o `overflow-y:auto` nunca entra em ação.
   Sem `flex-grow` de propósito: com poucos campos o form mantém a altura
   natural e os botões continuam logo abaixo do último campo, que é o padrão
   do checklist ("Drawer de filtros — botões perto dos campos"). */
.tz-filter-drawer > * { flex-shrink: 0; }
.tz-filter-drawer > form,
.tz-filter-drawer > .tz-filter-body {
  flex-shrink: 1;
  min-height: 0;
  overflow-y: auto;
  /* Chegando ao fim da lista, o scroll não passa para a página de trás —
     era isso que dava a impressão de que o drawer não rolava. */
  overscroll-behavior: contain;
}

/* Spinner de carregamento */
.tz-spinner {
  width: 44px; height: 44px;
  border: 4px solid #e5e7eb;
  border-top-color: #5b72ee;
  border-radius: 50%;
  animation: tz-spin .7s linear infinite;
}
@keyframes tz-spin { to { transform: rotate(360deg); } }

/* Dashboard — Hero banner */
.tz-dash-hero {
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,.07) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.05) 0%, transparent 40%),
    linear-gradient(135deg, #1e40af 0%, #4f46e5 50%, #7c3aed 100%);
}

/* Colunas sticky em tabelas */
.cf-sticky       { position: sticky !important; left: 0 !important; z-index: 3 !important; box-shadow: 2px 0 6px -2px rgba(0,0,0,.08); }
.cf-sticky-corner { position: sticky !important; left: 0 !important; top: 0 !important; z-index: 6 !important; box-shadow: 2px 0 6px -2px rgba(0,0,0,.08); }
.cf-sticky-white { background: #fff !important; }
.cf-sticky-gray  { background: #f9fafb !important; }
.dark .cf-sticky-white { background: #0c1427 !important; }
.dark .cf-sticky-gray  { background: #15203c !important; }
.cf-th-sticky    { position: sticky !important; top: 0 !important; z-index: 3 !important; }

/* Tabela longa dentro de card: rola no PRÓPRIO card em vez de esticar a página.
   Sem isto, um plano de contas com 40 contas empurra tudo o que vem depois para
   fora da tela e o usuário perde os cards de baixo. O cabeçalho fica preso
   porque uma coluna de valores sem título não se lê. O `.tz-th` já tem fundo
   opaco próprio (claro e escuro), então nada precisa ser repintado aqui. */
.tz-scroll-table { max-height: 420px; overflow-y: auto; overflow-x: auto; }
.tz-scroll-table thead th { position: sticky; top: 0; z-index: 2; }
.tz-scroll-table thead th:first-child { border-radius: 6px 0 0 0; }
.tz-scroll-table thead th:last-child  { border-radius: 0 6px 0 0; }

/* Fluxo de caixa */
.cf-fluxo-wrap  { overflow-x: auto; max-height: 72vh; }
.cf-fluxo-table { font-size: 0.8rem; white-space: nowrap; }

/* Cabeçalho de dois andares: período em cima, Real./Prev. embaixo.
   As alturas são FIXAS de propósito - o `top` do segundo andar tem que ser
   exatamente a altura do primeiro, e derivar isso de padding + line-height
   deixaria a régua desalinhando a cada mudança de fonte. */
.cf-fluxo-table .cf-th-group {
  position: sticky; top: 0; z-index: 4;
  height: 32px; padding: 6px 20px;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.cf-fluxo-table .cf-th-sub {
  position: sticky; top: 32px; z-index: 3;
  height: 26px; padding: 3px 20px;
  font-size: 0.68rem; font-weight: 600;
}
/* Faixa da coluna Previsto: sem ela, oito colunas de número viram uma parede e
   não se enxerga qual valor pertence a qual par.
   Cinza NEUTRO, não o roxo do primário: a faixa é separador, e cor de marca
   nela sugere destaque que a coluna não tem. Overlay em vez de cor sólida para
   funcionar tanto sobre a linha branca quanto sobre a linha cinza dos totais. */
/* Linha de grupo do DRE: clicável, abre os planos de contas dela. */
/* Linha de grupo clicavel (Fluxo de Caixa e DRE). Sem seta: o cursor e o hover
   sao a unica indicacao de que expande. */
.cf-group-row { cursor: pointer; }
.cf-group-row:hover td { background: rgba(17, 24, 39, 0.03); }
.dark .cf-group-row:hover td { background: rgba(255, 255, 255, 0.03); }

.cf-fluxo-table .cf-col-prev { background: rgba(17, 24, 39, 0.04) !important; }
.dark .cf-fluxo-table .cf-col-prev { background: rgba(255, 255, 255, 0.035) !important; }

/* Dropdown de seleção de empresa no header */
.tz-company-dropdown { min-width: 420px; }


/* Banner de modo suporte (equipe do SaaS acessando tenant de cliente) */
.tz-support-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: #b91c1c;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, .25);
}
.tz-support-banner__text { display: flex; align-items: center; gap: 8px; }
.tz-support-banner__text code {
  background: rgba(255, 255, 255, .18);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 400;
}
.tz-support-banner__actions { display: flex; align-items: center; gap: 8px; }
.tz-support-banner__btn {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.tz-support-banner__btn:hover { background: rgba(255, 255, 255, .3); }
.tz-support-banner__btn--exit { background: #fff; color: #b91c1c; }

/* ── Termômetros do painel Análise Financeira (IA) ───────────────────────
   Barra horizontal com faixa colorida por leitura. A cor vem inline do
   servidor (é dado, não estilo); aqui fica só a geometria. */
.tz-gauge__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
}
.dark .tz-gauge__track { background: #1e2740; }

.tz-gauge__fill {
  height: 100%;
  border-radius: 999px;
  transition: width .5s ease;
}

.tz-gauge__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

/* Semáforo grande do parecer */
.tz-semaforo {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.tz-semaforo i { font-size: 40px !important; color: #fff; }

/* ===========================================================================
   Precificação — cascata de custo e matriz de preços
   =========================================================================== */

/* Cascata: cada linha mostra rótulo, barra proporcional e valor. A barra dá a
   leitura instantânea de "onde o dinheiro vai" que uma coluna de números não dá. */
.tz-pricing-wf { display: flex; flex-direction: column; gap: 2px; }

.tz-pricing-wf__row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(60px, 3fr) minmax(90px, auto);
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  transition: background .15s ease;
}
.tz-pricing-wf__row:hover { background: #f9fafb; }
.dark .tz-pricing-wf__row:hover { background: #15203c; }

.tz-pricing-wf__label {
  font-size: 13px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dark .tz-pricing-wf__label { color: #9ca3af; }

.tz-pricing-wf__track {
  height: 8px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}
.dark .tz-pricing-wf__track { background: #172036; }

.tz-pricing-wf__fill { height: 100%; border-radius: 999px; background: #94a3b8; }

.tz-pricing-wf__value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #0f172a;
}
.dark .tz-pricing-wf__value { color: #fff; }

/* Imposto: cor de alerta suave, para separar do custo do produto */
.tz-pricing-wf__row--tax .tz-pricing-wf__fill { background: #f0a742; }

/* Crédito recuperável: redutor, entra em verde e com o valor negativo */
.tz-pricing-wf__row--credit .tz-pricing-wf__fill { background: #37d80a; }
.tz-pricing-wf__row--credit .tz-pricing-wf__value { color: #1f9d0a; }
.dark .tz-pricing-wf__row--credit .tz-pricing-wf__value { color: #37d80a; }

/* Subtotal e total: linha de fechamento, com peso */
.tz-pricing-wf__row--subtotal,
.tz-pricing-wf__row--total {
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
  padding-top: 10px;
}
.dark .tz-pricing-wf__row--subtotal,
.dark .tz-pricing-wf__row--total { border-color: #172036; }

.tz-pricing-wf__row--subtotal .tz-pricing-wf__label,
.tz-pricing-wf__row--total .tz-pricing-wf__label {
  font-weight: 600;
  color: #0f172a;
}
.dark .tz-pricing-wf__row--subtotal .tz-pricing-wf__label,
.dark .tz-pricing-wf__row--total .tz-pricing-wf__label { color: #fff; }

.tz-pricing-wf__row--total { background: #f9fafb; }
.dark .tz-pricing-wf__row--total { background: #15203c; }
.tz-pricing-wf__row--total .tz-pricing-wf__value { font-size: 15px; font-weight: 600; }

.tz-pricing-wf__row--info .tz-pricing-wf__value { color: #64748b; }
.dark .tz-pricing-wf__row--info .tz-pricing-wf__value { color: #9ca3af; }

/* Matriz de preços: perfil de cliente nas linhas, UF nas colunas */
.tz-pricing-matrix { width: 100%; border-collapse: separate; border-spacing: 0; }

.tz-pricing-matrix th,
.tz-pricing-matrix td {
  border-bottom: 1px solid #f3f4f6;
  padding: 0;
}
.dark .tz-pricing-matrix th,
.dark .tz-pricing-matrix td { border-color: #172036; }

.tz-pricing-matrix__uf {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #64748b;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: center;
  white-space: nowrap;
}
.dark .tz-pricing-matrix__uf { color: #9ca3af; }

.tz-pricing-matrix__profile {
  padding: 10px 14px 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  min-width: 168px;
}
.dark .tz-pricing-matrix__profile { color: #fff; }
.tz-pricing-matrix__profile small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
}

/* Célula clicável: preço alvo em cima, piso embaixo */
.tz-pricing-cell {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition: box-shadow .15s ease, transform .15s ease;
}
.tz-pricing-cell:hover {
  box-shadow: inset 0 0 0 2px #605dff;
  border-radius: 6px;
}
.tz-pricing-cell__target {
  display: block;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.dark .tz-pricing-cell__target { color: #fff; }

.tz-pricing-cell__floor {
  display: block;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  margin-top: 1px;
}

.tz-pricing-cell--infeasible { cursor: not-allowed; }
.tz-pricing-cell--infeasible .tz-pricing-cell__target { color: #e74c3c; font-size: 12px; }

/* Tinta por carga tributária: quanto mais escuro, mais imposto naquele destino.
   Só 5 níveis, e todos claros o bastante para o texto continuar legível. */
.tz-pricing-heat-1 { background: rgba(55, 216, 10, .07); }
.tz-pricing-heat-2 { background: rgba(240, 167, 66, .07); }
.tz-pricing-heat-3 { background: rgba(240, 167, 66, .15); }
.tz-pricing-heat-4 { background: rgba(231, 76, 60, .11); }
.tz-pricing-heat-5 { background: rgba(231, 76, 60, .19); }

.dark .tz-pricing-heat-1 { background: rgba(55, 216, 10, .11); }
.dark .tz-pricing-heat-2 { background: rgba(240, 167, 66, .11); }
.dark .tz-pricing-heat-3 { background: rgba(240, 167, 66, .18); }
.dark .tz-pricing-heat-4 { background: rgba(231, 76, 60, .16); }
.dark .tz-pricing-heat-5 { background: rgba(231, 76, 60, .26); }

.tz-pricing-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #64748b;
}
.dark .tz-pricing-legend { color: #9ca3af; }
.tz-pricing-legend__swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 4px;
  border: 1px solid #e5e7eb;
}
.dark .tz-pricing-legend__swatch { border-color: #172036; }

/* Aviso de cadastro incompleto — o preço calculado sobre imposto zero é o tipo
   de erro que passa batido porque o número continua plausível. */
.tz-pricing-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(240, 167, 66, .1);
  border: 1px solid rgba(240, 167, 66, .3);
  font-size: 13px;
  color: #92400e;
}
.dark .tz-pricing-warning { color: #fbbf24; }
.tz-pricing-warning i { font-size: 18px !important; flex: none; }

/* Detalhamento do cenário no modal */
.tz-pricing-detail { display: flex; flex-direction: column; gap: 1px; }
.tz-pricing-detail__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.tz-pricing-detail__row:nth-child(odd) { background: #f9fafb; }
.dark .tz-pricing-detail__row:nth-child(odd) { background: #15203c; }
.tz-pricing-detail__label { color: #64748b; }
.dark .tz-pricing-detail__label { color: #9ca3af; }
.tz-pricing-detail__rate {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.tz-pricing-detail__value {
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  white-space: nowrap;
}
.dark .tz-pricing-detail__value { color: #fff; }
.tz-pricing-detail__row--total {
  background: #eef2ff !important;
  font-weight: 600;
  margin-top: 4px;
}
.dark .tz-pricing-detail__row--total { background: #1e2a4a !important; }

/* Modal de custos fixos (Saude Financeira): cabecalho e linha da CONTA presos
   no topo enquanto a lista rola.

   Em ago/26 sao 54 lancamentos em 13 contas dentro de um scroller de 52vh.
   Rolando ate o meio, a linha de grupo ("5.3 Software e Sistemas") ja saiu da
   tela e o lancamento sozinho nao diz a que conta pertence - foi exatamente a
   duvida que motivou isto: achar "Bytbio IA / VETRE / R$ 110,00" e nao saber a
   conta.

   A altura do cabecalho e FIXA de proposito, pelo mesmo motivo do Fluxo de
   Caixa acima: o `top` da linha de conta tem que ser exatamente a altura do
   `thead`, e derivar isso de padding + line-height desalinha a regua a cada
   mudanca de fonte.

   O fundo vai no `td`, nao no `tr`: celula com `position: sticky` e pintada na
   posicao presa enquanto o fundo do `<tr>` fica para tras, e a linha apareceria
   transparente por cima dos lancamentos. */
.tz-fixed-costs-table thead th {
  position: sticky; top: 0; z-index: 3;
  height: 40px; padding-top: 0; padding-bottom: 0;
}
.tz-fixed-costs-table tbody tr.tz-fc-account > td {
  position: sticky; top: 40px; z-index: 2;
  background: #f9fafb;
}
.dark .tz-fixed-costs-table tbody tr.tz-fc-account > td { background: #15203c; }

/* ── Modal alto nao pode ficar sem saida ────────────────────────────────────
   Reportado em Contas a Pagar/Receber (02/09/2026): o modal de lancamento
   "sai da tela e nao da para ver o que tem", dependendo do tamanho do monitor.

   Os overlays sao `display:flex` com `align-items:center` e SEM overflow. Item
   flex centrado num container que nao rola estoura para os DOIS lados, e a
   parte de cima fica inalcancavel - nao existe scroll para chegar nela. Em
   monitor grande o formulario cabe e ninguem ve o problema; em notebook, corta.

   A regra fica aqui, e nao nos templates, porque o defeito e identico em
   dezenas de overlays - o mesmo argumento da rolagem do drawer de filtros. Os
   estilos deles sao INLINE, entao o `align-items` precisa de `!important` para
   ser sobreposto.

   `margin: auto` no filho e a peca que evita trocar um problema por outro:
   com espaco sobrando ele centraliza (o visual de hoje, preservado); sem
   espaco a margem colapsa para zero, o conteudo comeca no topo e o overlay
   rola. `align-items: flex-start` sozinho alinharia todo modal no topo.

   Os tres sufixos sao os cartoes de conteudo: `*modal-overlay`,
   `*-detail-overlay` e `*-inline-overlay` (60+, 3 e 2 templates). Ficam FORA de
   proposito `*filter-overlay` (fundo do drawer lateral, que tem rolagem
   propria), `*loading-overlay`, `save-overlay` e `empty-overlay` - nao sao
   cartoes e nao devem rolar. O padrao de modal GRANDE (`nfe-item-modal` e
   afins) ja resolve isso sozinho, com `overflow-y:auto` no proprio overlay, e
   nao casa com nenhum dos sufixos.

   Ficaram sem cobertura alguns modais com id fora de convencao
   (`customer-quick-overlay`, `import-overlay`, `email-log-overlay`,
   `metodologia-overlay`, `smtp-copy-overlay`, `cancel-confirm-overlay`,
   `disconnect-confirm-overlay`). Ao mexer neles, renomeie o id para um dos tres
   sufixos em vez de acrescentar caso a caso aqui. */
[id$="modal-overlay"],
[id$="-detail-overlay"],
[id$="-inline-overlay"] {
  align-items: flex-start !important;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 24px;
  padding-bottom: 24px;
}
[id$="modal-overlay"] > *,
[id$="-detail-overlay"] > *,
[id$="-inline-overlay"] > * {
  margin-top: auto !important;
  margin-bottom: auto !important;
}

/* Grade de 4 colunas para linha de formulario.

   O build do Tailwind e FECHADO: `grid-cols-4` NAO existe no `style.css`
   (conferido - zero ocorrencias), entao escreve-la no template nao geraria
   regra nenhuma e os campos ficariam empilhados, sem erro nem aviso.

   Usada na linha Valor / Juros / Desconto / Repetir do modal de lancamento.
   Em tela estreita vira 2 colunas: quatro campos de dinheiro lado a lado no
   celular deixam cada um com ~70px, estreito demais para ler o valor. */
.tz-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 640px) {
  .tz-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Dica em icone (i) — o texto so aparece no hover/foco.

   Existe para tirar paragrafo explicativo de dentro de formulario: a explicacao
   que so importa na primeira vez vira ruido permanente em toda edicao seguinte.

   CSS puro, sem JS, por dois motivos: funciona dentro de conteudo trocado por
   HTMX (o modal e recarregado a cada abertura, e biblioteca de tooltip
   precisaria ser reinicializada) e nao depende de Alpine no <body>.

   `:focus-within` junto do `:hover` mantem a dica alcancavel por teclado — quem
   navega com Tab chega ao botao e le o mesmo texto. */
.tz-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
}
.tz-tip__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid #9ca3af;
  color: #6b7280;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
  cursor: help;
  background: transparent;
  padding: 0;
}
.tz-tip__btn:hover { border-color: #605dff; color: #605dff; }
.dark .tz-tip__btn { border-color: #6b7280; color: #9ca3af; }

.tz-tip__text {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;          /* acima do modal (9998/9999) */
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
  pointer-events: none;    /* a dica nunca rouba o clique do campo */
}
.tz-tip:hover .tz-tip__text,
.tz-tip:focus-within .tz-tip__text { opacity: 1; visibility: visible; }

/* Setinha apontando para o icone. */
.tz-tip__text::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #1f2937;
}

/* Perto da borda direita do modal a dica centralizada vazaria para fora da
   tela; `--right` a ancora pela direita. */
.tz-tip--right .tz-tip__text { left: auto; right: -6px; transform: none; }
.tz-tip--right .tz-tip__text::after { left: auto; right: 10px; margin-left: 0; }

/* Listagem de pedidos: nome do cliente quebra em até 2 linhas numa coluna
   estreita, para sobrar largura e o badge da etapa ("Separar estoque") não
   partir em duas linhas. */
.tz-sales-customer { max-width: 200px; }
.tz-sales-customer__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}

/* Erro de campo em aba escondida (ver o bloco no fim do trezo_layout.html).
   O resumo é montado por JS, então o estilo mora aqui e não em classe
   arbitraria do Tailwind - o build do tema é fechado e classe nova nao gera
   regra nenhuma. */
.tz-erro-resumo {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 15px;
}
.dark .tz-erro-resumo { background: #2a1215; border-color: #3a1a1f; }

.tz-erro-resumo__titulo {
  font-size: 14px; font-weight: 500; color: #b91c1c; margin-bottom: 8px;
}
.dark .tz-erro-resumo__titulo { color: #f87171; }

.tz-erro-resumo__link {
  display: block; width: 100%; text-align: left;
  font-size: 12px; color: #b91c1c; padding: 2px 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.dark .tz-erro-resumo__link { color: #f87171; }
.tz-erro-resumo__link:hover { color: #7f1d1d; }

/* Linha do resumo montado no SERVIDOR (customers/_form_body.html): lista o
   erro de qualquer campo, inclusive dos que não têm mensagem no template, e por
   isso não tem para onde rolar. */
.tz-erro-resumo__item { font-size: 12px; color: #b91c1c; padding: 2px 0; }
.dark .tz-erro-resumo__item { color: #f87171; }
.dark .tz-erro-resumo__link:hover { color: #fca5a5; }

/* Marca na aba que esconde o campo com erro. */
.tz-tab-erro {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px;
  border-radius: 9999px; background: #dc2626; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}
