﻿/* ============================================================
   opex.css  --  Módulo OPEX / Despesas Operacionais
   Budget System EQI  |  Orçamentos
   Herda variáveis de styles.css (--green-primary, --green-dark, etc.)
   ============================================================ */

/* ---- Layout de dois painéis para módulos orçamentários ---- */
.opex-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar de módulos — visual idêntico ao sidebar global */
.opex-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #001a13;
  border-right: 1px solid rgba(99,198,165,0.10);
  padding: 8px 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,198,165,0.2) transparent;
}
.opex-sidebar::-webkit-scrollbar { width: 4px; }
.opex-sidebar::-webkit-scrollbar-track { background: transparent; }
.opex-sidebar::-webkit-scrollbar-thumb { background: rgba(99,198,165,0.2); border-radius: 2px; }

.sidebar-section-label {
  padding: 6px 16px 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(99,198,165,0.45);
  margin: 0;
  white-space: nowrap;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 14px;
  margin: 1px 6px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 450;
  color: rgba(232,245,240,0.70);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-link:hover {
  background: rgba(99,198,165,0.10);
  color: #e8f5f0;
}
.sidebar-link.is-active {
  background: rgba(0,158,118,0.22);
  color: #63C6A5;
  font-weight: 600;
}
.sidebar-icon { width: 1.125rem; height: 1.125rem; flex-shrink: 0; opacity: 0.7; }
.sidebar-link.is-active .sidebar-icon { opacity: 1; }

/* Área de conteúdo principal */
.opex-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text-muted, #6b7280); text-decoration: none; }
.breadcrumb a:hover { color: var(--green-primary, #009E76); }

/* ---- Título + botões ---- */
.page-title-bar {
  display: -webkit-flex;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.page-title  { font-size: 1.5rem; font-weight: 700; color: var(--green-dark, #00291E); margin: 0; }
.page-subtitle { font-size: 0.875rem; color: var(--text-muted, #6b7280); margin: 0.25rem 0 0; }

.title-bar-actions {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.25rem;
}

/* ---- KPI cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.75rem;
  padding: 1.125rem 1.25rem;
  display: -webkit-flex;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-label  { font-size: 0.75rem; color: var(--text-muted, #6b7280); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value  { font-size: 1.75rem; font-weight: 700; color: var(--green-dark, #00291E); line-height: 1.1; }
.kpi-green   { color: var(--green-primary, #009E76); }
.kpi-muted   { color: var(--text-muted, #6b7280); }
.kpi-accent  { color: #0066cc; }

/* ---- Toolbar ---- */
.toolbar {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.search-wrapper { position: relative; flex: 1; min-width: 180px; }
.search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: var(--text-muted, #6b7280); pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--green-primary, #009E76);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-primary, #009E76) 20%, transparent);
}
.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--green-primary, #009E76); }
.result-count { font-size: 0.8125rem; color: var(--text-muted, #6b7280); white-space: nowrap; margin-left: auto; }

.btn-sm {
  padding: 0.4375rem 0.875rem !important;
  font-size: 0.8125rem !important;
}

/* ---- Tabela OPEX ---- */
.table-card  { padding: 0; overflow: hidden; }

/* Scroll horizontal obrigatório: 12 colunas de meses + metadados.
   Altura limitada com scroll vertical próprio, para a tabela não empurrar o
   restante da tela quando há muitos lançamentos. */
.opex-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 560px;
  -webkit-overflow-scrolling: touch;
}

.opex-table thead th { position: sticky; top: 0; z-index: 1; background: rgba(0, 41, 30, 0.92); }

.opex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  min-width: 1400px; /* garante espaço para 12 meses sem quebrar */
}

.opex-table thead { background: rgba(0, 41, 30, 0.92); }
.opex-table th {
  padding: 0.6875rem 0.625rem;
  text-align: left;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: none;
  white-space: nowrap;
}
.opex-table th.col-month { text-align: right; min-width: 72px; }
.opex-table th.col-total { text-align: right; min-width: 90px; }

.opex-table td {
  padding: 0.6875rem 0.625rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: middle;
}
.opex-table tbody tr:last-child td { border-bottom: none; }
.opex-table tbody tr { transition: background 0.1s; }
.opex-table tbody tr:hover { background: color-mix(in srgb, var(--green-primary, #009E76) 5%, transparent); }

/* Colunas fixas de metadados */
.col-conta      { min-width: 200px; }
.col-natureza   { min-width: 110px; }
.col-fornecedor { min-width: 150px; }
.col-cc         { min-width: 130px; }
.col-actions    { width: 72px; text-align: center; white-space: nowrap; }
.col-select     { width: 2.25rem; text-align: center; }
.col-select input[type="checkbox"] { cursor: pointer; width: 0.9375rem; height: 0.9375rem; vertical-align: middle; accent-color: var(--green-primary, #009E76); }

.conta-code {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-dark, #00291E);
  display: block;
}
.conta-name {
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  display: block;
  margin-top: 0.1rem;
}

/* ---- Células de mês editáveis inline ---- */
.month-cell {
  min-width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-radius: 0.25rem;
  padding: 0.25rem 0.375rem;
  transition: background 0.12s, outline 0.12s;
  white-space: nowrap;
}
.month-cell[contenteditable="true"] {
  cursor: text;
}
.month-cell:focus {
  outline: 2px solid var(--green-primary, #009E76);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--green-primary, #009E76) 8%, transparent);
}
/* Remove o outline nativo do navegador para não duplicar */
.month-cell:focus-visible { outline: 2px solid var(--green-primary, #009E76); }

.month-cell[contenteditable="true"]:empty::before {
  content: '0';
  color: var(--text-muted, #6b7280);
  pointer-events: none;
}

/* ---- Célula de total da linha ---- */
.total-cell {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--green-primary, #009E76) 6%, transparent);
  white-space: nowrap;
}
.total-cell--grand {
  background: color-mix(in srgb, var(--green-primary, #009E76) 14%, transparent);
  color: var(--green-dark, #00291E);
}

/* ---- Rodapé de total geral ---- */
.grand-total-row {
  background: #f0faf5;
}
.grand-total-row td {
  border-top: 2px double var(--green-primary, #009E76);
  font-weight: 700;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.total-label {
  color: var(--green-dark, #00291E);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* ---- Badges de natureza ---- */
.natureza-badge {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.natureza-receita  { background: #dcfce7; color: #166534; }
.natureza-impostos { background: #fee2e2; color: #991b1b; }
.natureza-pessoal  { background: #dbeafe; color: #1e40af; }
.natureza-admin    { background: #f3f4f6; color: #374151; }
.natureza-ti       { background: #ede9fe; color: #5b21b6; }

/* ---- Entity badge (reutilizado de cost-centers) ---- */
.entity-badge {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.entity-ctvm     { background: color-mix(in srgb, var(--green-primary, #009E76) 15%, transparent); color: var(--green-dark, #00291E); }
.entity-cs       { background: #dbeafe; color: #1e40af; }
.entity-asset    { background: #fef3c7; color: #92400e; }
.entity-partners { background: #ede9fe; color: #5b21b6; }

/* ---- Botões de ação na tabela ---- */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 0.375rem;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.action-btn:hover {
  background: var(--surface-hover, #f3f4f6);
  color: var(--green-primary, #009E76);
  border-color: var(--border, #e5e7eb);
}
.action-btn svg { width: 0.9375rem; height: 0.9375rem; }

/* ---- Empty state ---- */
.empty-state {
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--text-muted, #6b7280);
}
.empty-state svg {
  width: 3rem; height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.4;
  display: block;
}
.empty-state p { margin: 0 0 1rem; font-size: 0.9375rem; }

/* ---- Screen reader only ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ---- Card genérico ---- */
.card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.75rem;
  overflow: hidden;
}

/* ---- Buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5625rem 1.125rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.button.primary {
  background: var(--green-primary, #009E76);
  color: #fff;
  border-color: var(--green-primary, #009E76);
}
.button.primary:hover {
  background: color-mix(in srgb, var(--green-primary, #009E76) 85%, black);
  border-color: color-mix(in srgb, var(--green-primary, #009E76) 85%, black);
}
.button.secondary {
  background: transparent;
  color: var(--green-dark, #00291E);
  border-color: var(--border, #e5e7eb);
}
.button.secondary:hover {
  background: var(--surface-hover, #f3f4f6);
  border-color: #c0c7cc;
}
.button.danger-outline {
  background: transparent;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.button.danger-outline:hover { background: #fef2f2; border-color: #dc2626; }

/* ---- Overlay ---- */
.panel-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.panel-overlay.is-visible,
.panel-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ---- Painel lateral de lançamento (drawer) ---- */
.entry-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 210;
  width: 440px; max-width: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: -webkit-flex; display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s ease;
}
.entry-panel.is-open { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .entry-panel   { transition: none; }
  .panel-overlay { transition: none; }
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  display: -webkit-flex; display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}
.panel-user-meta { display: -webkit-flex; display: flex; align-items: center; gap: 0.875rem; }
.panel-avatar {
  width: 2.75rem; height: 2.75rem;
  border-radius: 0.5rem;
  background: rgba(0, 41, 30, 0.92);
  color: #fff;
  display: -webkit-flex; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.panel-title    { font-size: 1.0625rem; font-weight: 700; color: var(--green-dark, #00291E); margin: 0; }
.panel-subtitle { font-size: 0.8125rem; color: var(--text-muted, #6b7280); margin: 0.125rem 0 0; }
.panel-close {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.5rem;
  background: transparent;
  border: 1px solid var(--border, #e5e7eb);
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  display: -webkit-flex; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.panel-close:hover { background: #f3f4f6; color: var(--green-dark, #00291E); }
.panel-close svg { width: 1.125rem; height: 1.125rem; }

.panel-body   { flex: 1; overflow-y: auto; padding: 1.5rem; }
.panel-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border, #e5e7eb);
  display: -webkit-flex; display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}
.panel-footer-actions { display: -webkit-flex; display: flex; gap: 0.625rem; margin-left: auto; }

/* ---- Formulário ---- */
.form-section { margin-bottom: 1.75rem; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted, #6b7280);
  padding-bottom: 0.75rem;
  margin: 0 0 0.875rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.form-row { margin-bottom: 1rem; }
.form-row:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-dark, #00291E);
  margin-bottom: 0.375rem;
}
.required { color: #ef4444; }

.form-input {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: #fff;
  color: var(--text, #1a1a1a);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--green-primary, #009E76);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-primary, #009E76) 20%, transparent);
}
.form-input.is-error { border-color: #ef4444; }
.field-error { font-size: 0.75rem; color: #ef4444; margin-top: 0.25rem; display: block; min-height: 1em; }

/* ---- Grade mensal no painel ---- */
.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.month-input-group { display: flex; flex-direction: column; gap: 0.25rem; }
.month-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.month-input { text-align: right; font-variant-numeric: tabular-nums; }

/* Atalho replicar */
.panel-replicate-row {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.panel-replicate-label { margin-bottom: 0; white-space: nowrap; }
.panel-replicate-controls { display: flex; gap: 0.5rem; flex: 1; min-width: 180px; }
.replicate-input { flex: 1; }

/* Total no painel */
.panel-total-row {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #f0faf5;
  border-radius: 0.5rem;
  margin-top: 0.25rem;
}
.panel-total-label { font-size: 0.875rem; font-weight: 600; color: var(--green-dark, #00291E); }
.panel-total-value { font-size: 1.125rem; font-weight: 700; color: var(--green-primary, #009E76); font-variant-numeric: tabular-nums; }

/* ---- Sidebar back link ---- */
.sidebar-back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 12px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(232,245,240,0.45);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  border-bottom: 1px solid rgba(99,198,165,0.08);
}
.sidebar-back-link:hover { color: #63C6A5; }
.sidebar-back-link svg { flex-shrink: 0; }

/* ---- Título de seção com espaçamento inferior ---- */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark, #00291E);
  margin: 0 0 1rem;
  padding: 1.25rem 1.5rem 0;
}
.section-title--spaced { margin-bottom: 1rem; }

/* ---- Cards de módulo (tela de resumo) ---- */
.opex-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.opex-module-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.opex-module-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.module-card-header {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
}
.module-card-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.module-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--green-dark, #00291E);
  margin: 0;
  line-height: 1.2;
}
.module-card-pct {
  font-size: 0.75rem;
  font-weight: 600;
  display: block;
  margin-top: 0.125rem;
}

.module-card-body {
  padding: 0.875rem 1.125rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  border-top: 1px solid var(--border, #e5e7eb);
  flex: 1;
}
.module-card-kpi { display: flex; flex-direction: column; gap: 0.2rem; }
.module-card-kpi-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
}
.module-card-kpi-value {
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.module-card-kpi-sub {
  font-size: 0.8125rem;
  color: var(--text, #1a1a1a);
  font-variant-numeric: tabular-nums;
}

.module-card-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border-top: 1px solid var(--border, #e5e7eb);
  transition: opacity 0.15s;
}
.module-card-link:hover { opacity: 0.75; }
.module-card-link svg { flex-shrink: 0; }

/* ---- Seção de gráfico ---- */
.chart-section { margin-bottom: 1.5rem; }
.chart-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0;
  flex-wrap: wrap;
}
.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark, #00291E);
  margin: 0;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.chart-body {
  padding: 1rem 1.5rem 1.25rem;
  min-height: 220px;
}
.chart-body svg { width: 100%; display: block; }

/* ---- Dot colorido na tabela de resumo ---- */
.module-name-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.5rem;
  flex-shrink: 0;
  vertical-align: middle;
}
.col-modulo { min-width: 180px; }
.col-pct    { min-width: 60px; text-align: right; }
.total-cell--mod { font-weight: 700; }

/* ---- Coluna de código de conta ---- */
.conta-codigo {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  display: block;
  letter-spacing: 0.03em;
}
.conta-nome {
  font-size: 0.8125rem;
  color: var(--text, #1a1a1a);
  display: block;
  margin-top: 0.1rem;
}

/* ---- Badge de categoria dinâmica ---- */
.natureza-material,
.natureza-correspondencia,
.natureza-cartorio,
.natureza-outros        { background: #f3f4f6; color: #374151; }
.natureza-aluguel       { background: #dbeafe; color: #1e40af; }
.natureza-energia       { background: #fef3c7; color: #92400e; }
.natureza-manutencao    { background: #fee2e2; color: #991b1b; }
.natureza-servicos      { background: #dcfce7; color: #166534; }
.natureza-midia         { background: #ede9fe; color: #5b21b6; }
.natureza-eventos       { background: #fce7f3; color: #9d174d; }
.natureza-criacao       { background: #ffedd5; color: #9a3412; }
.natureza-consultoria   { background: #f0fdf4; color: #14532d; }
.natureza-juridico      { background: #fef9c3; color: #713f12; }
.natureza-auditoria     { background: #e0f2fe; color: #075985; }
.natureza-rh            { background: #f5f3ff; color: #4c1d95; }
.natureza-software      { background: #ede9fe; color: #5b21b6; }
.natureza-cloud         { background: #cffafe; color: #164e63; }
.natureza-telecom       { background: #e0f2fe; color: #075985; }
.natureza-hardware      { background: #f3f4f6; color: #374151; }
.natureza-tarifas       { background: #fee2e2; color: #991b1b; }
.natureza-impostos      { background: #fef3c7; color: #92400e; }
.natureza-seguros       { background: #dcfce7; color: #166534; }
.natureza-transporte    { background: #dbeafe; color: #1e40af; }
.natureza-hospedagem    { background: #ede9fe; color: #5b21b6; }
.natureza-diarias       { background: #fce7f3; color: #9d174d; }

/* ---- Botão editar linha ---- */
.btn-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: background 0.15s;
  line-height: 1;
}
.btn-edit:hover { background: var(--surface-hover, #f3f4f6); }

/* ---- Botão excluir linha (sem abrir o drawer) ---- */
.btn-row-action {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.375rem;
  border-radius: 0.375rem;
  line-height: 1;
  color: var(--text-muted, #6b7280);
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
}
.btn-row-action.btn-delete-row:hover { background: #fef2f2; color: #b91c1c; }
.btn-row-action:focus-visible { outline: 2px solid var(--green-light, #5fd3b3); outline-offset: 2px; }

/* ---- Linha selecionada + barra de exclusão em lote ---- */
.opex-table tbody tr.row-selected { background: color-mix(in srgb, var(--green-primary, #009E76) 9%, transparent); }
.opex-bulk-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-dark, #00291E);
  background: color-mix(in srgb, var(--green-primary, #009E76) 7%, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.opex-bulk-bar[hidden] { display: none; }
.btn-clear-selection {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  text-decoration: underline;
  cursor: pointer;
}
.btn-clear-selection:hover { color: var(--green-dark, #00291E); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(2rem);
  background: rgba(0, 41, 30, 0.92);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  white-space: nowrap;
}
.toast.is-visible,
.toast.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast.toast--error {
  background: rgba(153, 27, 27, 0.94);
  white-space: normal;
  max-width: 420px;
  text-align: center;
}

/* ---- Responsivo ---- */
@media (max-width: 1200px) {
  .opex-main { padding: 1.5rem; }
}

@media (max-width: 1024px) {
  .opex-sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .col-fornecedor { display: none; }
}

@media (max-width: 768px) {
  .opex-main { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title-bar { flex-direction: column; align-items: flex-start; }
  .title-bar-actions { width: 100%; justify-content: flex-end; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-wrapper { width: 100%; }
  .filter-select { width: 100%; }
  .entry-panel { width: 100%; }
  .month-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .title-bar-actions { flex-direction: column; width: 100%; }
  .title-bar-actions .button { width: 100%; justify-content: center; }
  .month-grid { grid-template-columns: 1fr 1fr; }
}


/* C-104 fase 2 — gráficos de barras horizontais (Por Tipo / Por Card do OBZ) */
.hbar-section { margin-top: 1.5rem; }                 /* respiro entre a tabela e os gráficos */
.hbar-body { width: 100%; padding: 0.75rem 1.5rem 1.5rem; }  /* padding interno do gráfico */
.hbar-body svg { display: block; width: 100%; height: auto; }
.hbar-empty { color: var(--text-muted, #6b7d76); padding: 0.75rem 1.5rem; font-size: 0.9rem; }

/* ---- Sparkline de tendência mensal (cards de módulo) ---- */
.module-card-sparkline {
  padding: 0 1.125rem 0.875rem;
}
.module-card-sparkline svg { display: block; width: 100%; height: auto; }

/* ---- Evolução mensal / sazonalidade / novo-vs-recorrente ---- */
.trend-section { margin-top: 1.5rem; }
.trend-body { width: 100%; padding: 0.75rem 1.5rem 0.5rem; }
.trend-body svg { display: block; width: 100%; height: auto; }
.trend-empty { color: var(--text-muted, #6b7d76); padding: 0.75rem 1.5rem; font-size: 0.9rem; }

.seasonality-summary {
  padding: 0 1.5rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.seasonality-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.seasonality-tag--pico { background: #fef2f2; color: #991b1b; }
.seasonality-tag--baixa { background: #eff6ff; color: #1e40af; }
.seasonality-empty { color: var(--text-muted, #6b7280); font-size: 0.8125rem; }


/* ============================================================
   Combobox com autocomplete (Centro de Custo, Card do OBZ)
   ============================================================ */
.combobox { position: relative; }
.combobox-input { width: 100%; }
.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 41, 30, 0.12);
}
.combobox-option {
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text, #1a1a1a);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combobox-option:hover,
.combobox-option.is-active {
  background: #f0faf5;
  color: var(--green-dark, #00291E);
}
.combobox-empty {
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
}

/* ============================================================
   Autocomplete genérico (Fornecedor, C-144) — helper js/autocomplete.js,
   mesmo padrão visual usado no Headcount (C-135).
   ============================================================ */
.autocomplete-dropdown {
  position: absolute;
  z-index: 50;
  width: 100%;
  max-height: 300px;
  margin-top: 4px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 41, 30, 0.12);
  overflow-y: auto;
}
.autocomplete-item {
  padding: 0.5rem 0.625rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text, #1a1a1a);
}
.autocomplete-item:hover,
.autocomplete-item.is-highlight {
  background: #f0faf5;
  color: var(--green-dark, #00291E);
}
.autocomplete-no-match {
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
}

/* ============================================================
   Memória de cálculo do driver (OPEX Facilities) — demonstra a
   fórmula: custo unitário (R$) × índice (m²/HC/posições) = total
   ============================================================ */
.fac-driver-memoria {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: #f0faf5;
  border: 1px solid color-mix(in srgb, var(--green-primary, #009E76) 22%, transparent);
  border-radius: 0.5rem;
}
.fac-memoria-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.625rem;
}
.fac-memoria-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--green-dark, #00291E);
}
.fac-memoria-formula {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--green-primary, #009E76);
  font-variant-numeric: tabular-nums;
}
.fac-memoria-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.fac-memoria-table thead th {
  text-align: right;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #6b7280);
  border-bottom: 1px solid color-mix(in srgb, var(--green-primary, #009E76) 22%, transparent);
}
.fac-memoria-table thead th:first-child { text-align: left; }
.fac-memoria-table tbody td {
  text-align: right;
  padding: 0.25rem 0.5rem;
  color: var(--text, #1a1a1a);
  border-bottom: 1px solid rgba(0, 41, 30, 0.06);
}
.fac-memoria-table .fac-m-mes {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
}
.fac-memoria-table .fac-m-total { font-weight: 700; color: var(--green-dark, #00291E); }
/* Inputs editáveis (custo unitário e índice) — recálculo do total em tempo real */
.fac-m-input {
  width: 100%;
  min-width: 4.5rem;
  padding: 0.1875rem 0.375rem;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.3125rem;
  background: #fff;
  color: var(--text, #1a1a1a);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fac-m-input:focus {
  outline: none;
  border-color: var(--green-primary, #009E76);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green-primary, #009E76) 20%, transparent);
}
/* Linha de total do ano (tfoot) */
.fac-memoria-table tfoot .fac-m-foot td {
  padding: 0.375rem 0.5rem;
  border-top: 2px solid color-mix(in srgb, var(--green-primary, #009E76) 30%, transparent);
  font-weight: 700;
}
.fac-memoria-table tfoot .fac-m-mes { color: var(--green-dark, #00291E); text-transform: none; }
.fac-memoria-table tfoot .fac-m-total { font-size: 0.8125rem; }
.fac-memoria-hint {
  margin: 0.625rem 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted, #6b7280);
  line-height: 1.4;
}
.fac-memoria-empty {
  margin: 0;
  padding: 0.75rem 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
}

/* ============================================================
   BoaaS (/opex/boaas/) — visual clean (2026-09-28)
   Paleta neutra: cabeçalho claro, divisórias leves, verde só no
   que é total/ação. Sem zebra, sem faixas escuras, sem itálico.
   Unidade (R$) aparece uma vez por card; células só com número.
   ============================================================ */
:root {
  --bx-line:      #EEF2F1;  /* divisória entre linhas */
  --bx-head-bg:   #F7F9F9;  /* cabeçalho de tabela (opaco — sticky) */
  --bx-soft:      #FAFBFB;  /* painéis de parâmetros / coluna Total Ano */
  --bx-sub-bg:    #F4FAF8;  /* subtotal de seção */
  --bx-total-bg:  #EAF5F1;  /* total geral */
  --bx-input-bd:  #DDE5E3;  /* borda das células editáveis */
  --bx-muted:     var(--text-muted, #5A6A66);
  --bx-dark:      var(--green-dark, #00291E);
  --bx-green:     var(--green-primary, #009E76);
}

/* ---- KPIs do topo ---- */
.boaas-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.boaas-kpis .stat-card { background: #fff; border-color: var(--bx-line); }
.boaas-kpis .stat-value { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.boaas-kpis .stat-hint  { font-size: 0.75rem; color: var(--bx-muted); }
@media (max-width: 900px) { .boaas-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Cards ---- */
#boaas-auc-card, #boaas-linhas-card, #boaas-resumo-card {
  padding: 1.5rem 1.75rem;
  background: #fff;
  border-color: var(--bx-line);
}
#boaas-auc-card, #boaas-linhas-card { margin-bottom: 1.25rem; }

.boaas-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.boaas-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bx-dark);
}
.boaas-card-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--bx-muted);
  max-width: 60rem;
}
.boaas-unit {
  font-size: 0.75rem;
  color: var(--bx-muted);
  white-space: nowrap;
}

/* Legenda das células (editável × vinculado) */
.boaas-legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--bx-muted);
}
.boaas-legend-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.boaas-legend-swatch {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 0.1875rem;
  border: 1px solid var(--bx-input-bd);
  background: #fff;
}
.boaas-legend-swatch--linked { border-color: transparent; background: var(--bx-line); }

/* ---- Seções dentro do card ---- */
.boaas-section { margin-top: 1.5rem; }
.boaas-section:first-child { margin-top: 0; }
.boaas-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}
.boaas-section-subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--bx-muted);
}

/* ---- Painel de parâmetros (% Floating/Fundos, Centro de Custo, rateio RLP) ---- */
.boaas-pct-panel:empty { display: none; }
.boaas-pct-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--bx-soft);
  border: 1px solid var(--bx-line);
  border-radius: 0.5rem;
}
.boaas-pct-panel .boaas-section-subtitle { flex-basis: 100%; margin: 0; }
.boaas-pct-fields,
.boaas-rlp-cc-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.boaas-rlp-cc-fields {
  padding-left: 2rem;
  border-left: 1px solid var(--bx-input-bd);
}
.boaas-rlp-cc-title {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}
.boaas-pct-field {
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--bx-muted);
}
.boaas-pct-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.125rem;
  padding: 0 0.625rem;
  border: 1px solid var(--bx-input-bd);
  border-radius: 0.375rem;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.boaas-pct-input-wrap:focus-within {
  border-color: var(--bx-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bx-green) 15%, transparent);
}
.boaas-pct-input-wrap--calc { background: var(--bx-soft); }
.boaas-pct-input {
  width: 4rem;
  border: none;
  outline: none;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text, #1a1a1a);
  background: transparent;
}
.boaas-pct-input-wrap--calc .boaas-pct-input { color: var(--bx-muted); }
.boaas-pct-unit { font-size: 0.75rem; color: var(--bx-muted); }
.boaas-cc-select {
  min-width: 15rem;
  height: 2.125rem;
  padding: 0 0.625rem;
  border: 1px solid var(--bx-input-bd);
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text, #1a1a1a);
  background-color: #fff;
  box-sizing: border-box;
}
.boaas-cc-select:focus {
  outline: none;
  border-color: var(--bx-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bx-green) 15%, transparent);
}

/* ---- Tabelas (grade de AuC, Lançamentos Diretos, Memória de Cálculo) ----
   Scroll horizontal próprio com a coluna de rótulo congelada (freeze pane).
   Sem overflow:hidden na <table> — quebraria o position:sticky. */
#boaas-auc-card .table-wrapper,
#boaas-linhas-card .table-wrapper,
#boaas-resumo-card .table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--bx-line);
  border-radius: 0.5rem;
}
.boaas-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
/* Rótulo com largura travada: meses uniformes, mesmo com nomes longos */
.boaas-table { table-layout: fixed; }
.boaas-table th:first-child,
.boaas-table td:first-child { width: 14rem; }
/* Grade de AuC: valores na casa do bilhão (13 caracteres) — precisa de mais largura */
.boaas-auc-table { min-width: 1360px; }
.boaas-table .boaas-col-total,
.boaas-table td.boaas-row-total { width: 7.5rem; }

html .boaas-table thead th {
  padding: 0.5rem 0.75rem;
  background: var(--bx-head-bg);
  color: var(--bx-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--bx-line);
}
html .boaas-table thead th:first-child { text-align: left; }

html .boaas-table tbody td {
  padding: 0.4375rem 0.75rem;
  text-align: right;
  white-space: nowrap;
  color: var(--text, #1a1a1a);
  background: #fff;
  border-bottom: 1px solid var(--bx-line);
}
html .boaas-table tbody tr:last-child td { border-bottom: none; }
html .boaas-table tbody tr:nth-child(even) { background: transparent; }
html .boaas-table tbody tr:hover td { background: #F7FAF9; }

/* Freeze pane da 1ª coluna (fundo sólido — senão o conteúdo rolado aparece por baixo) */
.boaas-table thead th:first-child,
.boaas-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--bx-line);
}
.boaas-table thead th:first-child { z-index: 3; }

.boaas-row-label {
  text-align: left !important;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Coluna Total Ano: só peso + fundo neutro, sem verde */
html .boaas-table thead th.boaas-col-total,
html .boaas-table tbody td.boaas-row-total {
  background: var(--bx-soft);
  color: var(--bx-dark);
  font-weight: 600;
  border-left: 1px solid var(--bx-line);
}

/* Somente leitura (vinculado ao AuC Inicial de /auc-aum/) — cinza, sem itálico */
html .boaas-table tbody td.boaas-auc-cell-readonly { color: var(--bx-muted); }

/* Zero vira traço claro (padrão clean) */
.boaas-table .cell-zero { color: #C5D0CD; }

/* Subtotal de seção ("AuC | Produtos com Desconto") */
html .boaas-table tr.boaas-auc-total-row td {
  background: var(--bx-sub-bg) !important;
  color: var(--bx-dark);
  font-weight: 600;
  border-bottom: 1px solid var(--bx-line) !important;
}

/* Totais gerais (AuC Total e Total Orçado): verde suave + linha verde em cima */
html .boaas-table tr.boaas-auc-total-geral-row td,
html .boaas-table tr.boaas-row-grand-total td {
  background: var(--bx-total-bg) !important;
  color: var(--bx-dark);
  font-weight: 700;
  border-top: 2px solid var(--bx-green) !important;
  border-bottom: none !important;
}
.boaas-auc-total-geral-table .boaas-auc-total-geral-row td:first-child { text-align: left; }

/* "BoaaS % a.a." — indicador discreto abaixo do total */
html .boaas-table tr.boaas-row-pct td {
  color: var(--bx-muted);
  font-weight: 500;
  background: #fff;
}
html .boaas-table tr.boaas-row-pct td.boaas-row-total { color: var(--bx-dark); font-weight: 600; }

/* ---- Células editáveis: borda sempre visível (affordance de input) ---- */
html .boaas-table td.boaas-cell-edit { padding: 0.25rem 0.375rem; }
.boaas-auc-cell, .boaas-linha2-cell {
  width: 100%;
  height: 1.75rem;
  padding: 0 0.4375rem;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--text, #1a1a1a);
  background: #fff;
  border: 1px solid var(--bx-input-bd);
  border-radius: 0.3125rem;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.boaas-auc-cell:hover, .boaas-linha2-cell:hover { border-color: #BFCBC8; }
.boaas-auc-cell:focus, .boaas-linha2-cell:focus {
  outline: none;
  border-color: var(--bx-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bx-green) 15%, transparent);
}
.boaas-auc-cell::placeholder, .boaas-linha2-cell::placeholder { color: #C5D0CD; }

@media (max-width: 720px) {
  #boaas-auc-card, #boaas-linhas-card, #boaas-resumo-card { padding: 1rem; }
  .boaas-rlp-cc-fields { padding-left: 0; border-left: none; }
  .boaas-table th:first-child, .boaas-table td:first-child { width: 11rem; }
}

/* ---- C-79: Memória de cálculo por driver (Viagens) — layout vertical ----
   Meses nas linhas, drivers nas colunas. */
.via-driver-memoria { margin-top: 1rem; }
.via-memo-add { margin: 0.25rem 0 0.75rem; }
.via-memo-add .form-label { margin-bottom: 0.25rem; }

.via-memo-table { width: 100%; }
.via-memo-table th,
.via-memo-table td { padding: 0.3rem 0.4rem; }

/* Coluna dos meses (esquerda) */
.via-memo-table .via-c-mes {
  text-align: left;
  white-space: nowrap;
  font-weight: 700;
  color: var(--green-dark, #00291E);
}

/* Cabeçalho de cada driver (nome + custo unit. + remover) */
.via-memo-table thead .via-c-drv {
  text-align: center;
  vertical-align: bottom;
  min-width: 84px;
  position: relative;
}
.via-memo-table thead .via-c-drvname {
  display: block;
  white-space: normal;
  line-height: 1.15;
  max-width: 140px;
  margin: 0 auto;
}
.via-memo-table thead .via-c-cst {
  display: block;
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.125rem;
}

/* Célula de quantidade */
.via-memo-table .via-c-q { text-align: center; }
.via-memo-table .via-c-tot,
.via-memo-table .via-drvtot { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.via-memo-table .via-qty {
  width: 3.5rem;
  padding: 0.25rem 0.3rem;
  text-align: right;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.25rem;
}
.via-memo-table .via-qty:focus {
  outline: none;
  border-color: var(--green-primary, #009E76);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green-primary, #009E76) 20%, transparent);
}
.via-memo-table tfoot .via-memo-foot td {
  font-weight: 700;
  color: var(--green-dark, #00291E);
  background: color-mix(in srgb, var(--green-primary, #009E76) 6%, transparent);
  border-top: 2px solid var(--border, #e5e7eb);
}
.via-rm-btn {
  border: none;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
}
.via-rm-btn:hover { background: #fef2f2; }

.via-memo-actions {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.625rem;
}
.via-memo-actions .fac-memoria-hint { margin: 0; flex: 1 1 220px; }

/* ============================================================
   IMPORTAÇÃO EM LOTE (CSV) — C-145
   Mesmo vocabulário visual do modal de import de /accounts/ e /headcount/.
   ============================================================ */
.import-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 25, 19, 0.45);
  z-index: 220;
}
.import-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 221;
  overflow: hidden;
}
.import-modal[hidden], .import-overlay[hidden] { display: none !important; }
.import-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border, #D0DCDA);
}
.import-modal-title { margin: 0; font-size: 1.05rem; color: var(--green-dark, #00291E); }
.import-modal-body { padding: 1.25rem; overflow-y: auto; }
.import-modal-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border, #D0DCDA);
}
.import-hint {
  font-size: 0.8125rem; color: var(--text-muted, #5A6A66);
  margin: 0 0 1rem; line-height: 1.5;
}
.import-hint code {
  background: var(--surface, #F2EDED); padding: 0.05rem 0.3rem;
  border-radius: 0.2rem; font-size: 0.75rem;
}
.import-link-btn {
  background: none; border: none; padding: 0;
  color: var(--green-primary, #009E76); font-weight: 600;
  cursor: pointer; text-decoration: underline; font-size: inherit;
}
.import-file-drop-area {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.75rem 1rem;
  border: 2px dashed var(--border, #D0DCDA);
  border-radius: 0.5rem;
  color: var(--text-muted, #5A6A66);
  text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.import-file-drop-area:hover, .import-file-drop-area:focus-visible,
.import-file-drop-area.is-dragover {
  border-color: var(--green-primary, #009E76);
  background: color-mix(in srgb, var(--green-primary, #009E76) 5%, transparent);
  outline: none;
}
.import-file-drop-area p { margin: 0; font-size: 0.85rem; }
.import-file-drop-sub { font-size: 0.75rem !important; color: var(--text-muted, #5A6A66); }
.import-preview { margin-top: 1.25rem; }
.import-preview-summary { font-size: 0.85rem; font-weight: 600; color: var(--green-dark, #00291E); margin: 0 0 0.5rem; }
.import-preview-table { font-size: 0.75rem; width: 100%; border-collapse: collapse; }
.import-preview-table th, .import-preview-table td { padding: 0.35rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border, #D0DCDA); white-space: nowrap; }
.import-error { color: #dc2626; font-size: 0.8rem; margin-top: 0.75rem; line-height: 1.5; }
.import-table-scroll { max-height: 260px; overflow: auto; }

/* Feedback de progresso durante a importação (C-145/C-obz-optional) — sem
   isso o usuário só via o botão desabilitado e achava que a tela travou,
   principalmente em lotes maiores que levam alguns segundos. */
.import-progress {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--text-muted, #5A6A66);
  margin: 0.75rem 0 0;
}
.import-progress::before {
  content: ''; width: 0.9rem; height: 0.9rem; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--border, #D0DCDA); border-top-color: var(--green-primary, #009E76);
  animation: import-progress-spin 0.7s linear infinite;
}
@keyframes import-progress-spin { to { transform: rotate(360deg); } }
.import-modal-footer .button.is-loading { opacity: 0.85; cursor: wait; }

/* ============================================================
   RESUMO MATRICIAL — Centro de Custo × Pacote do plano de contas
   Outline em 4 níveis (Diretoria ▸ Gerência ▸ Coordenação ▸ CC), mesmo
   padrão de revenue-rateio-arvore/arvore.css: sem accordion, toggle ▸/▾
   por linha, indentação crescente por nível.
   ============================================================ */
.opx-mtx-empty { color: var(--text-muted, #6b7280); padding: 1.5rem; font-size: 0.875rem; text-align: center; }

.opx-mtx-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; min-width: 900px; }
.opx-mtx-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: rgba(0, 41, 30, 0.92); color: rgba(255, 255, 255, 0.85);
  padding: 0.625rem 0.75rem; text-align: right; font-weight: 700;
  font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.opx-mtx-table thead th:first-child { text-align: left; }
.opx-mtx-table tbody td, .opx-mtx-table tfoot td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: middle;
}
.opx-mtx-table tbody tr:hover td { background: color-mix(in srgb, var(--green-primary, #009E76) 4%, transparent); }

.opx-mtx-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opx-mtx-cell--total { font-weight: 700; color: var(--green-dark, #00291E); background: color-mix(in srgb, var(--green-primary, #009E76) 6%, transparent); }
/* Toda célula é clicável (abre o razão lateral) — sem sublinhado permanente
   (poluiria a grade inteira), só affordance no hover/foco do teclado. */
.opx-mtx-cell--clickable { cursor: pointer; transition: background 0.1s; }
.opx-mtx-cell--clickable:hover, .opx-mtx-cell--clickable:focus-visible {
  background: color-mix(in srgb, var(--green-primary, #009E76) 14%, transparent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--green-primary, #009E76) 50%, transparent);
  text-underline-offset: 2px;
  outline: none;
}

.opx-mtx-name { font-weight: 600; white-space: nowrap; color: var(--text-base, var(--text, #1a1a1a)); }
.opx-mtx-name--dir  { font-weight: 700; color: var(--green-dark, #00291E); }
/* Especificidade igual/maior que ".opx-mtx-table tbody td" (base) — sem isso o
   padding-left abaixo nunca vencia o padding do seletor base e todos os níveis
   ficavam colados na mesma indentação (bug reportado pelo usuário). */
.opx-mtx-table tbody td.opx-mtx-name--dep  { padding-left: 2rem; }
.opx-mtx-table tbody td.opx-mtx-name--area { padding-left: 4rem; }
.opx-mtx-table tbody td.opx-mtx-name--cc   { padding-left: 6rem; font-weight: 400; color: var(--text-muted, #6b7280); white-space: normal; }

.opx-mtx-row--dir td { background: var(--surface, #F2EDED); }
.opx-mtx-row--dep td { background: color-mix(in srgb, var(--green-primary, #009E76) 5%, transparent); }
.opx-mtx-row--area td { background: color-mix(in srgb, var(--green-primary, #009E76) 2%, transparent); }

.opx-mtx-toggle-btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: none; border: none; padding: 0; font: inherit; font-weight: inherit;
  color: inherit; cursor: pointer; text-align: left;
}
.opx-mtx-toggle-btn:hover { color: var(--green-primary, #009E76); }
.opx-mtx-toggle-icon { color: var(--green-primary, #009E76); display: inline-block; width: 0.75rem; }

.opx-mtx-foot-row td {
  font-weight: 700;
  color: var(--green-dark, #00291E);
  background: #f0faf5;
  border-top: 2px double var(--green-primary, #009E76);
  border-bottom: none;
}

/* Drawer de detalhe reaproveita .panel-overlay/.entry-panel já existentes nesta
   folha (mesmo componente do painel de lançamento) — mas é um mini "Razão de
   Despesas" (conta + conta gerencial + fornecedor + justificativa + 12 meses),
   então precisa de bem mais largura que o painel de 440px padrão. */
#opx-mtx-drawer { width: min(1400px, 96vw); }
/* .panel-body zerado e o próprio wrapper de scroll assume o padding — a versão
   anterior usava margin negativa pra "sangrar" o scroll até a borda do painel,
   mas isso quebra o cálculo de position:sticky do cabeçalho (herdado de
   .opex-table thead th), fazendo o cabeçalho flutuar por cima da 1ª linha. */
#opx-mtx-drawer .panel-body { padding: 0; }
.opx-mtx-drawer-scroll { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 130px); padding: 1.5rem; }
/* Cabeçalho estático (não sticky) — o drawer já rola como bloco único; sticky
   aninhado dentro do wrapper de scroll horizontal é a origem da sobreposição. */
.opex-table.opx-mtx-drawer-table thead th { position: static; }
.opx-mtx-drawer-table { min-width: 1600px; }
.opx-mtx-drawer-table th { text-align: left; }
.opx-mtx-drawer-table th.col-month, .opx-mtx-drawer-table td.col-month,
.opx-mtx-drawer-table th:last-child, .opx-mtx-drawer-table td:last-child { text-align: right; }
.opx-mtx-drawer-contacodigo { min-width: 110px; white-space: nowrap; }
.opx-mtx-drawer-conta { min-width: 180px; }
.opx-mtx-drawer-justif { min-width: 220px; max-width: 280px; white-space: normal; color: var(--text-muted, #6b7280); font-size: 0.75rem; }

@media (max-width: 768px) {
  #opx-mtx-drawer { width: 100%; }
}

@media (max-width: 1024px) {
  .opx-mtx-table tbody td.opx-mtx-name--dep  { padding-left: 1.5rem; }
  .opx-mtx-table tbody td.opx-mtx-name--area { padding-left: 3rem; }
  .opx-mtx-table tbody td.opx-mtx-name--cc   { padding-left: 4.5rem; }
}

/* ============================================================
   OPEX — visual clean em todas as telas de módulo (2026-09-28)
   Mesmo padrão do BoaaS: cards brancos, KPIs em cor neutra,
   cabeçalho claro, sem fundo bege nas linhas, verde só em total
   e ação, "Valores em R$" uma vez por tabela. Por último no
   arquivo para prevalecer sobre as regras antigas acima.
   ============================================================ */
:root {
  --ox-line:     #EEF2F1;
  --ox-head-bg:  #F7F9F9;
  --ox-soft:     #FAFBFB;
  --ox-total-bg: #EAF5F1;
  --ox-input-bd: #DDE5E3;
  --ox-hover:    #F7FAF9;
}

/* ---- Cards e KPIs ---- */
.opex-main .card,
.opex-main .stat-card {
  background: #fff;
  border-color: var(--ox-line);
}
.opex-main .stat-card { padding: 1rem 1.25rem; }
.opex-main .stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted, #5A6A66);
}
.opex-main .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-dark, #00291E);
  font-variant-numeric: tabular-nums;
}
/* KPIs coloridos (verde/azul/cinza) viram todos neutros */
.opex-main .stat-value.kpi-green,
.opex-main .stat-value.kpi-accent,
.opex-main .stat-value.kpi-muted { color: var(--green-dark, #00291E); }

/* Título de card: frase normal, escuro, sem caixa-alta */
.opex-main .card > .form-section-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--green-dark, #00291E);
  border-bottom-color: var(--ox-line);
}

/* ---- Filtros ---- */
.opex-main .filter-select,
.opex-main .search-input {
  background-color: #fff;
  border-color: var(--ox-input-bd);
  font-size: 0.8125rem;
}
.opex-main .filter-select:focus,
.opex-main .search-input:focus {
  border-color: var(--green-primary, #009E76);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-primary, #009E76) 15%, transparent);
}

/* ---- Tabela de lançamentos ---- */
.opex-main .table-card .cu-unit-note { text-align: right; }
html .opex-main .opex-table th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted, #5A6A66);
  background: var(--ox-head-bg);
  border-bottom: 1px solid var(--ox-line);
}
html .opex-main .opex-table tbody td {
  padding: 0.5rem 0.625rem;
  background: #fff;
  border-bottom: 1px solid var(--ox-line);
  font-variant-numeric: tabular-nums;
}
html .opex-main .opex-table tbody tr:hover td { background: var(--ox-hover); }
html .opex-main .opex-table tbody tr.row-selected td {
  background: color-mix(in srgb, var(--green-primary, #009E76) 6%, #fff);
}

/* Conta: nome em cima, código discreto embaixo, sem linha em branco */
.opex-main .col-conta .conta-nome {
  display: block;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text, #1a1a1a);
}
.opex-main .col-conta .conta-codigo {
  display: block;
  margin-top: 0.125rem;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-muted, #5A6A66);
}
.opex-main .col-conta .conta-just {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: var(--text-muted, #5A6A66);
}

/* Conta gerencial: etiqueta neutra (antes: caixa-alta em negrito colorida) */
.opex-main .natureza-badge {
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  background: #F2F5F4 !important;
  color: var(--text, #1a1a1a) !important;
}

/* Meses: zero como traço claro; editável ganha borda no hover/foco */
.opex-main .month-cell { border-radius: 0.3125rem; }
.opex-main .month-cell.is-zero { color: #C5D0CD; }
.opex-main .month-cell[contenteditable="true"]:hover { box-shadow: inset 0 0 0 1px var(--ox-input-bd); }
.opex-main .month-cell[contenteditable="true"]:focus {
  outline: none;
  color: var(--text, #1a1a1a);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--green-primary, #009E76), 0 0 0 3px color-mix(in srgb, var(--green-primary, #009E76) 15%, transparent);
}

/* Total Ano: fundo neutro e negrito, sem verde */
html .opex-main .opex-table th.col-total,
html .opex-main .opex-table td.total-cell {
  background: var(--ox-soft);
  color: var(--green-dark, #00291E);
  font-weight: 600;
  border-left: 1px solid var(--ox-line);
}
.opex-main .total-cell.is-zero { color: #C5D0CD; }

/* Total Geral: verde suave + linha verde em cima (sticky no rodapé fica igual) */
html .opex-main .opex-table .grand-total-row td,
html .opex-main .opex-table .grand-total-row td.total-cell,
html .opex-main .opex-table .grand-total-row td.total-cell--grand {
  background: var(--ox-total-bg);
  color: var(--green-dark, #00291E);
  font-weight: 700;
  border-top: 2px solid var(--green-primary, #009E76);
  border-left: none;
}

/* ---- Viagens: resumo mensal e árvore de viagens ---- */
html .opex-main .via-memo-table th {
  background: var(--ox-head-bg);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: none;
}
html .opex-main .via-memo-table .via-mes { color: var(--text, #1a1a1a); font-weight: 500; }
html .opex-main .via-memo-table .conta-row td { background: #fff; }
html .opex-main .via-memo-table .via-c-tot { background: var(--ox-soft); font-weight: 600; }
html .opex-main .via-memo-table tfoot .via-foot td {
  background: var(--ox-total-bg);
  color: var(--green-dark, #00291E);
  border-top: 2px solid var(--green-primary, #009E76);
}
html .opex-main .tree-head.trip-tree-head {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  border-bottom: 1px solid var(--ox-line);
}
.opex-main .tree-node > summary { border-bottom-color: var(--ox-line); }
.opex-main .tree-node > summary:hover { background: var(--ox-hover); }
.opex-main .tree-dir[open] > summary { background: var(--ox-soft); }
.opex-main .tree-leaf { background: #fff; border-bottom: 1px solid var(--ox-line); }
.opex-main .tw { color: var(--text-muted, #5A6A66); }
.opex-main .tree-tot { font-weight: 600; }
.opex-main .via-unit-note { margin: 0 0 0.5rem; text-align: right; font-size: 0.75rem; color: var(--text-muted, #5A6A66); }

/* ---- Agrupamento Diretoria → Gerência → Centro de Custo (outline) ----
   Padrão outline do Excel: coluna estreita de [+]/[-] à esquerda, subtotais
   na mesma tabela. Ativado por módulo (agruparPorCentroCusto no OPEX_MODULE). */
.opex-main .opex-outline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-left: 0.75rem;
  border-bottom: 1px solid var(--ox-line);
}
.opex-main .opex-outline-bar .cu-unit-note { border-bottom: 0; }
.opex-main .opex-outline-actions {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--ox-line);
  border-radius: 8px;
  background: var(--ox-head-bg);
}
.opex-main .btn-outline-toggle-all {
  padding: 0.25rem 0.75rem;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #5A6A66);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.opex-main .btn-outline-toggle-all:hover { background: #fff; color: var(--green-dark, #00291E); }
.opex-main .btn-outline-toggle-all:focus-visible { outline: 2px solid var(--green-primary, #009E76); outline-offset: 1px; }

html .opex-main .opex-table .col-outline {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  padding: 0 0 0 0.5rem;
  text-align: center;
}
.opex-main .outline-toggle-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted, #5A6A66);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s;
}
.opex-main .outline-toggle-btn svg { transition: transform 180ms ease; }
.opex-main .outline-toggle-btn:hover { background: color-mix(in srgb, var(--green-primary, #009E76) 10%, transparent); color: var(--green-primary, #009E76); }
.opex-main .outline-toggle-btn:focus-visible { outline: 2px solid var(--green-primary, #009E76); outline-offset: 1px; }
.opex-main .outline-toggle-btn[aria-expanded="true"] { color: var(--green-primary, #009E76); }
.opex-main .outline-toggle-btn[aria-expanded="true"] svg { transform: rotate(90deg); }

/* Linhas de grupo: subtotal somente leitura, peso decrescente por nível */
html .opex-main .opex-table tbody tr.opex-group-row td { background: #fff; color: var(--green-dark, #00291E); }
html .opex-main .opex-table tbody tr.opex-group-row td.group-cell { text-align: right; white-space: nowrap; }
html .opex-main .opex-table tbody tr.opex-group-row td.is-zero { color: #C5D0CD; }
html .opex-main .opex-table tbody tr.opex-group-row td.total-cell { background: var(--ox-soft); }
.opex-main .opex-group-nome { font-size: 0.8125rem; }
.opex-main .opex-group-count {
  margin-left: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-muted, #5A6A66);
}

/* Nível 0 — Diretoria */
html .opex-main .opex-table tbody tr.opex-group-level-0 td { background: #F4FAF8; font-weight: 700; }
html .opex-main .opex-table tbody tr.opex-group-level-0 td.total-cell { background: var(--ox-total-bg); }
/* Nível 1 — Gerência */
html .opex-main .opex-table tbody tr.opex-group-level-1 td { font-weight: 600; }
html .opex-main .opex-table tbody tr.opex-group-level-1 td.opex-group-label { padding-left: 1.75rem; }
/* Nível 2 — Centro de Custo */
html .opex-main .opex-table tbody tr.opex-group-level-2 td { font-weight: 500; color: var(--text, #1a1a1a); }
html .opex-main .opex-table tbody tr.opex-group-level-2 td.opex-group-label { padding-left: 2.875rem; }

/* Novo item de despesa dentro do lançamento em lote (Etapa 2, 2026-10-21) */
.lote-novo { margin: 0 0 0.75rem; padding: 0.75rem 0.875rem; border: 1px solid #CBE7DC; background: #F2FAF7; border-radius: 10px; }
.lote-novo[hidden] { display: none !important; }
.lote-novo-titulo { margin: 0 0 0.5rem; font-weight: 600; color: var(--green-dark, #00291E); font-size: 0.875rem; }
.lote-novo-campos { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 0.625rem; }
.lote-novo-campos label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted, #5A6A66); }
.lote-novo-campos input, .lote-novo-campos select { font: inherit; font-size: 0.8125rem; font-weight: 400; padding: 0.35rem 0.5rem; border: 1px solid #D0DCDA; border-radius: 7px; background: #fff; min-width: 0; }
.lote-novo-erro { margin: 0.5rem 0 0; color: #B42318; font-size: 0.8125rem; }
.lote-novo-acoes { display: flex; gap: 0.5rem; margin-top: 0.625rem; flex-wrap: wrap; }
.lote-novo-rodape { margin: 0.5rem 0 0; }
.lote-novo-btn[hidden] { display: none !important; }
@media (max-width: 767px) { .lote-novo-campos { grid-template-columns: 1fr; } }
