:root {
  --azul: #1B5EA6;
  --verde: #16a34a;
  --cinza: #6b7280;
}

/* ── Cabeçalho global (todos os módulos) ───────────────────────── */

/* Fixa altura no viewport — só o container de dados rola */
html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.pz-header {
  background: linear-gradient(90deg, #1B5EA6 0%, #1a56a0 100%);
  color: #fff;
  padding: 8px 16px 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
  flex-shrink: 0;
  z-index: 150;
}

.pz-header-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.hdr-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.hdr-brand {
  flex-shrink: 1;
  min-width: 0;
  max-width: 42%;
}

.hdr-cliente {
  font-size: .9rem;
  font-weight: 700;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hdr-spacer {
  flex: 1;
  min-width: 4px;
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hdr-right a {
  color: #fff;
  opacity: .85;
  text-decoration: none;
}

.hdr-right a:hover {
  opacity: 1;
}

.hdr-usuario {
  opacity: .75;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
}

/* Módulos — barra horizontal (telas largas) */
.pz-modulos--desktop {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, .12);
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.pz-modulo-link {
  color: #fff;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: .82;
  transition: .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pz-modulo-link:hover {
  background: rgba(255, 255, 255, .15);
  opacity: 1;
}

.pz-modulo-link.ativo {
  background: rgba(255, 255, 255, .95);
  color: var(--azul);
  opacity: 1;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.pz-modulo-link .pz-mod-ico {
  font-size: .95rem;
  line-height: 1;
}

/* Módulos — menu compacto (telas estreitas) */
.hdr-modulo-mobile {
  display: none;
  position: relative;
  flex-shrink: 0;
}

.btn-modulos-menu {
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-modulos-menu:hover {
  background: rgba(255, 255, 255, .25);
}

.pz-modulos-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 300;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  min-width: 200px;
  padding: 6px;
}

.pz-modulos-dropdown.tab-hidden {
  display: none;
}

.pz-modulos-dropdown .pz-modulo-link {
  display: flex;
  width: 100%;
  color: #374151;
  opacity: 1;
  margin-bottom: 2px;
}

.pz-modulos-dropdown .pz-modulo-link:hover {
  background: #f3f4f6;
}

.pz-modulos-dropdown .pz-modulo-link.ativo {
  background: #eff6ff;
  color: var(--azul);
}

/* Empresa — segunda linha, largura total (não sobrepõe módulos) */
.hdr-row-empresa {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.empresa-sel-label {
  font-size: .78rem;
  opacity: .9;
  flex-shrink: 0;
  white-space: nowrap;
}

.hdr-row-empresa select {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  font-size: .85rem;
  color: #1e293b;
}

.btn-hdr {
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-hdr:hover {
  background: rgba(255, 255, 255, .25);
}

.btn-hdr .btn-hdr-text {
  display: inline;
}

.btn-sair {
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .75rem;
}

.btn-sair:hover {
  background: rgba(255, 255, 255, .25);
}

/* Responsivo */
@media (max-width: 1100px) {
  .hdr-brand {
    max-width: 28%;
  }

  .hdr-usuario {
    display: none;
  }
}

@media (max-width: 900px) {
  .pz-modulos--desktop {
    display: none;
  }

  .hdr-modulo-mobile {
    display: block;
  }

  .btn-hdr .btn-hdr-text {
    display: none;
  }

  .btn-hdr {
    padding: 6px 8px;
  }
}

@media (max-width: 520px) {
  .empresa-sel-label {
    display: none;
  }

  .hdr-brand {
    max-width: 36%;
  }
}

@media (min-width: 901px) {
  .hdr-row-empresa {
    border-top: none;
    padding-top: 0;
    width: auto;
    max-width: min(380px, 38vw);
    margin-left: auto;
    order: 0;
  }

  .pz-header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .hdr-top {
    flex: 1;
    min-width: 280px;
  }

  .hdr-row-empresa {
    flex: 0 1 auto;
  }
}

/* Menu lateral recolhível */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.main.sidebar-collapsed .sidebar {
  width: 52px;
}

.main.sidebar-collapsed .nav-label {
  display: none;
}

.main.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 11px 8px;
  gap: 0;
}

.main.sidebar-collapsed .sidebar-toggle {
  margin: 0 auto 8px;
}

.sidebar {
  position: relative;
  transition: width .2s ease;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 16px);
  margin: 0 8px 10px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  color: #374151;
  cursor: pointer;
  font-size: .75rem;
}

.sidebar-toggle:hover {
  background: #eff6ff;
  border-color: var(--azul);
  color: var(--azul);
}

.nav-ico {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Conciliação */
body.con-tab-ativa .content {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

body.con-tab-ativa #tab-conciliacao {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.con-tab-ativa #con-conteudo {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.pend-full-ativa #con-conteudo .pend-full {
  display: flex !important;
}

.con-hub {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

#con-hub.con-triagem-ativa {
  max-height: min(34vh, 300px);
  overflow: hidden;
}

.con-hub-extra {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

.con-hub-extra:has(.con-opcoes:not(.tab-hidden)) {
  overflow-y: auto;
  max-height: min(28vh, 240px);
}

.con-hub-datas {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: .75rem;
  color: #374151;
}

.con-hub-datas label {
  font-weight: 600;
  color: var(--cinza);
  white-space: nowrap;
}

.con-hub-datas input[type="date"] {
  width: 132px;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: .78rem;
  font-family: inherit;
  background: #fff;
}

.con-hub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.con-hub-row .con-conta-sel {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  font-size: .88rem;
  padding: 8px 11px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.con-hub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.con-import-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  color: #374151;
}

.con-import-label:hover {
  border-color: var(--azul);
  color: var(--azul);
  background: #f8fafc;
}

.con-import-label input {
  display: none;
}

.con-import-label.disabled {
  opacity: .5;
  pointer-events: none;
}

.con-extratos-zone {
  padding: 0 12px 8px;
  min-height: 0;
  max-height: 92px;
}

.con-extratos-zone.tab-hidden {
  display: none;
}

.con-extratos-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.con-extratos-empty {
  font-size: .82rem;
  color: var(--cinza);
  padding: 10px 4px;
  line-height: 1.5;
}

.con-ext-card {
  flex: 0 0 auto;
  min-width: 140px;
  max-width: 200px;
  padding: 8px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.con-ext-card:hover {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 2px 8px rgba(27, 94, 166, .08);
}

.con-ext-card.active {
  border-color: var(--azul);
  background: #eff6ff;
  box-shadow: 0 0 0 1px var(--azul);
}

.con-ext-card.done {
  border-color: #86efac;
  background: #f0fdf4;
}

.con-ext-titulo {
  font-size: .8rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 6px;
  padding-right: 22px;
}

.con-ext-pct {
  font-size: .95rem;
  font-weight: 700;
  color: var(--azul);
}

.con-ext-card.done .con-ext-pct {
  color: var(--verde);
}

.con-ext-meta {
  font-size: .7rem;
  color: var(--cinza);
  margin-top: 2px;
}

.con-ext-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin: 6px 0 4px;
  overflow: hidden;
}

.con-ext-bar-fill {
  height: 100%;
  background: var(--azul);
  border-radius: 2px;
  transition: width .25s;
}

.con-ext-card.done .con-ext-bar-fill {
  background: var(--verde);
}

.con-ext-del {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: .75rem;
  opacity: .35;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.con-ext-del:hover {
  opacity: 1;
  background: #fee2e2;
}

.con-pendencias-wrap {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 0 12px 4px;
  flex-shrink: 0;
}

.con-pendencias-wrap.tab-hidden {
  display: none;
}

.con-pendencias-wrap details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 4px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: #92400e;
  list-style: none;
  position: sticky;
  top: 0;
  background: #fffbeb;
  z-index: 2;
}

.con-pendencias-wrap details summary::-webkit-details-marker {
  display: none;
}

.con-pendencias-wrap .con-pend-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.con-pendencias-scroll {
  max-height: min(240px, 28vh);
  overflow: auto;
  margin-bottom: 8px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fff;
}

.con-pendencias-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  table-layout: fixed;
}

.con-pendencias-tbl th,
.con-pendencias-tbl td {
  padding: 7px 8px;
  border-bottom: 1px solid #fde68a;
  text-align: left;
  vertical-align: middle;
}

.con-pendencias-tbl th {
  background: #fef3c7;
  font-size: .65rem;
  text-transform: uppercase;
  color: #78350f;
  position: sticky;
  top: 0;
  z-index: 1;
}

.con-pendencias-tbl .col-desc {
  width: 38%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.con-pendencias-tbl .col-desc strong {
  font-weight: 600;
}

.con-pendencias-tbl .num {
  text-align: right;
  white-space: nowrap;
}

.con-pendencias-tbl .col-acoes {
  width: 72px;
  text-align: right;
  white-space: nowrap;
}

.con-pendencias-empty {
  font-size: .78rem;
  color: var(--cinza);
  padding: 8px 4px 10px;
}

.con-opcoes {
  border-top: 1px solid #f1f5f9;
  padding: 10px 14px 12px;
  background: #fafbfc;
  flex-shrink: 0;
}

.con-opcoes .form-row {
  margin-bottom: 10px;
}

.con-opcoes-toggle {
  font-size: .78rem;
  color: var(--azul);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.con-opcoes-toggle:hover {
  background: #eff6ff;
}

.con-triagem {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.con-triagem-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.con-triagem-panel .panel-header {
  flex-shrink: 0;
}

.con-triagem-panel .triagem-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none !important;
}

/* Tela cheia — pendências do período */
body.pend-full-ativa #con-hub,
body.pend-full-ativa #triagem-wrap {
  display: none !important;
}

.pend-full {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: #f0f4f8;
}

body.pend-full-ativa .pend-full {
  display: flex;
}

.pend-full-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.pend-full-toolbar h2 {
  font-size: 1rem;
  color: var(--azul);
  margin: 0;
  flex: 1;
  min-width: 120px;
}

.pend-full-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pend-full-metric {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .78rem;
}

.pend-full-metric strong {
  display: block;
  font-size: 1.1rem;
  color: #1e293b;
}

.pend-full-metric.verde strong {
  color: var(--verde);
}

.pend-full-metric.amarelo strong {
  color: #b45309;
}

.pend-full-hint {
  padding: 8px 16px;
  font-size: .8rem;
  color: #374151;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  flex-shrink: 0;
}

.pend-full-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pend-nome-grupo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pend-nome-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 2px 0;
}

.pend-nome-header .pend-nome-titulo {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.pend-nome-resumo {
  font-size: .75rem;
  color: var(--cinza);
}

.pend-nome-filhos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 4px;
  border-left: 3px solid #cbd5e1;
  margin-left: 6px;
}

.pend-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  border-radius: 4px;
  padding: 2px 6px;
  margin-right: 6px;
  vertical-align: middle;
}

.pend-tag-debito {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.pend-tag-credito {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.pend-tag-op {
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  text-transform: none;
  font-weight: 600;
}

.pend-tag-inst {
  color: #5b21b6;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  text-transform: none;
  font-weight: 600;
}

.pend-card-titulo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-bottom: 6px;
}

.pend-card-titulo-row .pend-card-titulo {
  font-size: .88rem;
  font-weight: 600;
  color: #334155;
}

.pend-card-titulo-principal {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.pend-card-amostra {
  font-size: .78rem;
  color: #64748b;
  line-height: 1.35;
  margin-bottom: 8px;
  word-break: break-word;
}

.pend-card-comp {
  color: #475569;
  font-size: .76rem;
}

.pend-ver-lanc {
  color: var(--azul);
  font-weight: 600;
  text-decoration: none;
  font-size: .78rem;
}

.pend-ver-lanc:hover {
  text-decoration: underline;
}

.mpl-body {
  max-height: min(60vh, 520px);
  overflow: auto;
  margin-bottom: 12px;
}

.mpl-table td {
  font-size: .8rem;
  vertical-align: top;
}

.mpl-table .btn-sm {
  white-space: nowrap;
}

.pend-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.pend-card:hover {
  border-color: var(--azul);
  box-shadow: 0 4px 14px rgba(27, 94, 166, .12);
  transform: translateY(-1px);
}

.pend-card:active {
  transform: translateY(0);
}

.pend-card.removendo {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .35s, transform .35s;
}

.pend-card-titulo {
  font-size: .9rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 8px;
  word-break: break-word;
}

.pend-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: .78rem;
  color: var(--cinza);
}

.pend-card-meta strong {
  color: #1e293b;
}

.pend-card-cta {
  margin-top: 10px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--azul);
}

.pend-full-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--cinza);
  font-size: .95rem;
}

.pend-full-empty .ico {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.con-hub-btn-pend {
  font-weight: 600;
}

/* Balancete — layout só quando a aba está ativa */
.content > #tab-balancete.tab-pane-balancete:not(.tab-hidden) {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.bal-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  padding: 12px 16px 20px;
}

.bal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px !important;
  flex-shrink: 0;
}

.bal-titulo {
  margin: 0;
  font-size: 1.15rem;
  color: var(--azul);
}

.bal-sub {
  margin: 4px 0 0;
  font-size: .8rem;
  color: var(--cinza);
}

.bal-toolbar-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.bal-filtro-grupo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bal-filtro-lbl {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: .04em;
}

.bal-date {
  width: auto !important;
  padding: 5px 8px !important;
  font-size: .82rem !important;
}

.bal-radio,
.bal-check {
  font-size: .82rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.bal-toolbar-acoes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bal-resumo {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: .82rem;
  color: #475569;
}

.bal-resumo-hint {
  color: #94a3b8;
  font-size: .78rem;
}

.bal-table-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}

.bal-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.bal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.bal-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  padding: 10px 10px;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
  white-space: nowrap;
}

.bal-table thead th.num {
  text-align: right;
}

.bal-table tbody td,
.bal-table tfoot td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.bal-table tbody tr:hover {
  background: #f8fafc;
}

.bal-row-sint {
  background: #fafbfc;
  font-weight: 600;
}

.bal-row-sint .bal-col-desc {
  color: #1e293b;
}

.bal-row-anal .bal-cod {
  font-weight: 500;
}

.bal-row-total {
  background: #eff6ff;
  border-top: 2px solid #bfdbfe;
}

.bal-col-conta {
  min-width: 180px;
}

.bal-col-desc {
  min-width: 220px;
  max-width: 360px;
}

.bal-cod {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .78rem;
  color: #475569;
  display: inline-block;
}

.bal-red {
  color: #64748b;
  font-size: .76rem;
  white-space: nowrap;
}

.bal-nat {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.bal-nat-D {
  background: #fee2e2;
  color: #991b1b;
}

.bal-nat-C {
  background: #dcfce7;
  color: #166534;
}

.bal-saldo-c {
  color: #b91c1c;
}

.bal-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Tela cheia — lançamentos da conta (balancete) */
#tab-balancete.bal-lanc-full-ativa .bal-wrap {
  display: none !important;
}

.bal-lanc-full {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: #f0f4f8;
}

#tab-balancete.bal-lanc-full-ativa .bal-lanc-full {
  display: flex;
}

.bal-lanc-full-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.bal-lanc-full-toolbar h2 {
  font-size: 1rem;
  color: var(--azul);
  margin: 0;
  flex: 1;
  min-width: 160px;
}

.bal-lanc-full-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bal-lanc-full-metric {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .78rem;
}

.bal-lanc-full-metric strong {
  display: block;
  font-size: 1.05rem;
  color: #1e293b;
}

.bal-lanc-full-metric.verde strong {
  color: var(--verde);
}

.bal-lanc-full-metric.amarelo strong {
  color: #b45309;
}

.bal-lanc-full-hint {
  padding: 8px 16px;
  font-size: .8rem;
  color: #374151;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  flex-shrink: 0;
  margin: 0;
}

.bal-lanc-full-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bal-lanc-full-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 24px;
  position: relative;
}

.bal-lanc-busca {
  min-width: 200px;
  max-width: 280px;
  padding: 5px 10px !important;
  font-size: .82rem;
}

.bal-lanc-table {
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.bal-lanc-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.bal-lanc-table thead tr:first-child th {
  background: #f1f5f9;
  box-shadow: 0 1px 0 #e5e7eb;
}

.bal-lanc-filters th {
  padding: 4px 6px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.bal-lanc-filters input,
.bal-lanc-filters select {
  width: 100%;
  padding: 4px 7px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: .75rem;
  font-family: inherit;
}

.bal-lanc-filters input:focus,
.bal-lanc-filters select:focus {
  outline: none;
  border-color: var(--azul);
}

.bal-lanc-table td {
  font-size: .82rem;
  vertical-align: top;
}

.bal-lanc-comp,
.lanc-comp {
  font-size: .75rem;
  color: var(--cinza);
}

/* Aba Lançamentos — layout e filtros (igual tela cheia do balancete) */
.content > #tab-lancamentos.tab-pane-lancamentos:not(.tab-hidden) {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.lanc-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
  height: 100%;
}

.lanc-panel-header {
  flex-wrap: wrap;
}

.lanc-toolbar-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lanc-busca {
  min-width: 180px;
  max-width: 260px;
  padding: 5px 10px !important;
  font-size: .82rem;
}

.lanc-resumo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.lanc-resumo-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lanc-resumo-metric {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .78rem;
}

.lanc-resumo-metric strong {
  display: block;
  font-size: 1.05rem;
  color: #1e293b;
}

.lanc-resumo-metric.verde strong {
  color: var(--verde);
}

.lanc-resumo-metric.amarelo strong {
  color: #b45309;
}

.lanc-resumo-hint {
  font-size: .78rem;
  color: var(--cinza);
}

.lanc-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
}

.lanc-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 20px;
}

.lanc-tbl thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.lanc-tbl thead tr:first-child th {
  background: #f1f5f9;
  box-shadow: 0 1px 0 #e5e7eb;
}

.lanc-filters th {
  padding: 4px 6px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.lanc-filters input,
.lanc-filters select {
  width: 100%;
  padding: 4px 7px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: .75rem;
  font-family: inherit;
}

.lanc-filters input:focus,
.lanc-filters select:focus {
  outline: none;
  border-color: var(--azul);
}

.bal-row-click {
  cursor: pointer;
}

.bal-row-click:hover {
  background: #eff6ff !important;
}

.bal-saldo-ini-cell {
  min-width: 130px;
  vertical-align: middle;
}

.bal-saldo-ini-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.bal-saldo-ini-input {
  width: 88px;
  padding: 3px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: .78rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bal-saldo-ini-input:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 2px rgba(27, 94, 166, .15);
}

.bal-saldo-lado-sel {
  width: 36px;
  padding: 2px 2px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
}

.bal-saldo-ajustado .bal-saldo-ini-input {
  border-color: #f59e0b;
  background: #fffbeb;
}
