:root {
  --app-blue: #0d6efd;
  --app-blue-700: #0b5ed7;
  --app-cyan: #06b6d4;
  --app-slate: #0f172a;
  --app-muted: #64748b;
  --app-bg: #f4f8fc;
  --app-line: #dbeafe;
  --app-header-h: 76px;
  --app-bottom-h: 72px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: linear-gradient(180deg, #f8fbff 0%, #eef7fb 100%);
  color: var(--app-slate);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  min-height: var(--app-header-h);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 12px 26px rgba(13, 110, 253, 0.22);
}

.nav-pills .nav-link {
  border: 1px solid var(--app-line);
  background: #fff;
  color: #1e293b;
  font-weight: 700;
  border-radius: 999px;
  transition: all 0.18s ease-in-out;
}

.nav-pills .nav-link:hover {
  transform: translateY(-1px);
  background: #eff6ff;
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.2);
}

.page-host {
  min-height: calc(100vh - var(--app-header-h));
}

.page-section {
  padding: 1rem;
}

@media (min-width: 992px) {
  .page-section {
    padding: 1.25rem 1.5rem;
  }
}

.app-card {
  border: 1px solid var(--app-line);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.app-card-hover {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.app-card-hover:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.btn {
  font-weight: 700;
  border-radius: 0.85rem;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: scale(0.98) !important;
}

.btn-app-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
  border: 0;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.22);
}
.btn-app-primary:hover {
  color: #fff;
  filter: brightness(0.98);
}

.form-select,
.form-control {
  border-color: #cfe3ff;
  border-radius: 0.9rem;
  min-height: 44px;
  font-weight: 650;
}
.form-select:focus,
.form-control:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.12);
}

.kpi-card {
  border: 1px solid var(--app-line);
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  height: 100%;
}
.kpi-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 0.9rem;
  background: #eff6ff;
  color: var(--app-blue);
}
.kpi-card small {
  color: var(--app-muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.kpi-card strong {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

/* Upload */
.upload-hero {
  max-width: 980px;
  margin-inline: auto;
}
.dropzone {
  border: 2px dashed #93c5fd;
  border-radius: 1.5rem;
  background: linear-gradient(180deg, #fff, #f8fbff);
  min-height: 260px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--app-blue);
  background: #eff6ff;
  transform: translateY(-2px);
}
.dropzone-icon {
  width: 70px;
  height: 70px;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
  color: #fff;
  font-size: 2rem;
}

/* Tabela full page */
.table-page {
  height: calc(100vh - var(--app-header-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.75rem;
}
.table-appbar {
  flex: 0 0 auto;
  border: 1px solid var(--app-line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  padding: 0.6rem;
}
.table-shell {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0.75rem;
  border: 1px solid var(--app-line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.table-responsive-full {
  height: 100%;
  overflow: auto;
}
.audit-table {
  min-width: 1380px;
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.audit-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, #1e40af, #1d4ed8);
  color: #fff;
  white-space: nowrap;
  font-size: 0.78rem;
  height: 44px;
  padding: 0.65rem 0.75rem;
  border-right: 1px solid rgba(255, 255, 255, 0.24);
}
.audit-table tbody td {
  vertical-align: middle;
  height: 48px;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #edf2f7;
  font-size: 0.86rem;
}
.audit-table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.audit-table tbody tr {
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}
.audit-table tbody tr:hover {
  background: #eaf3ff;
  box-shadow: inset 4px 0 0 var(--app-blue);
}
.audit-table tr.row-non-worked {
  background: #fbfdff !important;
  opacity: 0.58;
}
.audit-table tr.row-non-worked:hover {
  opacity: 0.92;
  background: #eef6ff !important;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-weight: 800;
  font-size: 0.78rem;
  white-space: nowrap;
}
.pill-scale {
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #1d4ed8;
}
.pill-regime {
  border: 1px solid #bae6fd;
  background: #e0f2fe;
  color: #075985;
}
.pill-adjusted {
  border: 1px solid #fb923c;
  background: #fff7ed;
  color: #ea580c;
}
.pill-success {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
}
.pill-muted {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  border: 1px solid #cfe3ff;
  border-radius: 0.95rem;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #dbe3ee;
  position: relative;
  transition: background 0.18s ease;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}
.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
}
.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.floating-search {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1030;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--app-line);
  background: #fff;
  color: #0f172a;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}
.search-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  z-index: 1030;
  width: min(420px, calc(100vw - 2rem));
  display: none;
}
.search-panel.show {
  display: block;
}

/* Bottom nav mobile */
.bottom-nav {
  height: var(--app-bottom-h);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
}
.bottom-link {
  text-decoration: none;
  color: #475569;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
}
.bottom-link i {
  font-size: 1.2rem;
}
.bottom-link.active {
  color: var(--app-blue);
}

@media (max-width: 991.98px) {
  body {
    padding-bottom: var(--app-bottom-h);
  }
  .table-page {
    height: calc(100vh - var(--app-header-h) - var(--app-bottom-h));
  }
  .brand small {
    display: none;
  }
}

.help-section h2,
.params-section h2 {
  letter-spacing: -0.03em;
}
.rule-block {
  border-left: 4px solid var(--app-blue);
  padding-left: 1rem;
}
.old-value {
  color: #dc3545;
  text-decoration: line-through;
  font-weight: 700;
}
.new-value {
  color: #198754;
  font-weight: 900;
}

/* V2 — Upload wide, processamento legado e parâmetros robustos */
.upload-page-v2 {
  min-height: calc(100vh - var(--app-header-h));
  display: flex;
  align-items: stretch;
}
.upload-main-card {
  min-height: calc(100vh - var(--app-header-h) - 2.5rem);
}
.v2-step {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.v2-step:last-of-type {
  border-bottom: 0;
}
.v2-step > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #0d6efd;
  font-weight: 900;
}
.v2-step p {
  margin: 0.25rem 0 0;
  color: #64748b;
}

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.processing-overlay:not(.d-none) {
  display: flex !important;
}
.processing-card {
  width: min(520px, 96vw);
  border-radius: 1.4rem;
  background: #fff;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}
.param-group-icon {
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #0d6efd;
  font-size: 1.45rem;
  flex: 0 0 48px;
}
.param-field-card {
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  transition: all 0.18s ease-in-out;
}
.param-field-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.params-section .tooltip-inner {
  max-width: 340px;
  text-align: left;
}
@media (min-width: 992px) {
  .upload-page-v2 .container-fluid {
    display: flex;
    flex-direction: column;
  }
}

/* V2.1 — camada legada oculta e estados vazios */
#legacyCompatLayer {
  display: none !important;
}
.audit-table tbody td[colspan] {
  height: 240px;
  font-size: 1rem;
}

/* V3 — processamento Bootstrap próprio */
body[data-route="upload"] .page-host {
  min-height: calc(100vh - var(--app-header-h));
}
.processing-card .progress {
  height: 0.65rem;
  border-radius: 999px;
}

/* V4 — cache opcional e filtros mais leves */
.cache-consent-card {
  border: 1px solid #bfdbfe;
  border-radius: 1.25rem;
  padding: 1rem;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}
.cache-consent-icon {
  width: 44px;
  height: 44px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0d6efd;
  color: #fff;
  box-shadow: 0 12px 24px rgba(13, 110, 253, 0.2);
  flex: 0 0 44px;
}
.table-appbar-clean {
  padding: 0.55rem 0.75rem;
}
.table-appbar-clean .input-group-text {
  background: #fff;
  color: #0d6efd;
  border-color: #dbeafe;
  font-weight: 800;
}
.table-appbar-clean .form-select {
  border-color: #dbeafe;
  font-weight: 700;
}
.appbar-filter-type {
  width: 260px;
}
.appbar-filter-value {
  min-width: 320px;
}
.appbar-toggle {
  min-height: 42px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #fff;
}
.appbar-mode {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 800;
}
.audit-table tbody tr {
  transition:
    background-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}
.audit-table tbody tr:hover {
  background: #eef6ff !important;
  box-shadow: inset 3px 0 0 #0d6efd;
}
.audit-table tbody tr.row-non-worked {
  opacity: 0.72;
  background: #f8fafc !important;
}
@media (max-width: 992px) {
  .appbar-filter-type,
  .appbar-filter-value {
    width: 100%;
    min-width: 0;
  }
}

/* V5 — tabela em linha única, exportação e parâmetros em colunas */
.table-filter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  width: 100%;
}
.table-filter-row .appbar-filter-type {
  flex: 0 0 230px;
  width: 230px;
}
.table-filter-row .appbar-filter-value {
  flex: 1 1 auto;
  min-width: 280px;
}
.table-filter-row .appbar-toggle {
  flex: 0 0 auto;
  white-space: nowrap;
}
.table-filter-row .appbar-mode {
  flex: 0 0 auto;
  white-space: nowrap;
}
.table-filter-row .appbar-clear {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 999px;
  font-weight: 800;
}
.audit-table.table tbody tr:hover > td,
.audit-table tbody tr:hover > td {
  background: #eaf4ff !important;
}
.audit-table.table tbody tr:hover {
  cursor: default;
}
.pill-regime {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}
.params-columns .param-category-card {
  display: flex;
  flex-direction: column;
}
.param-category-card .param-field-card {
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
}
.export-page .kpi-card {
  min-height: 130px;
}
@media (max-width: 1100px) {
  .table-filter-row {
    flex-wrap: wrap;
  }
  .table-filter-row .appbar-filter-type,
  .table-filter-row .appbar-filter-value {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* V6 — Regime com siglas BH/HE e Ajuda de Custo correta */
.pill-regime-bh {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}
.pill-regime-he {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.pill-regime-escala {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}
.pill-regime-muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* V7 — Exportações funcionais */
.export-filter-card .form-select,
.export-filter-card .toggle-switch {
  min-height: 46px;
}
.export-page .btn {
  transition:
    transform 0.18s ease-in-out,
    box-shadow 0.18s ease-in-out,
    opacity 0.18s ease-in-out;
}
.export-page .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(13, 110, 253, 0.12);
}
.export-page .btn:active {
  transform: scale(0.98);
}

/* V8 — XLSX formatado com abas originais */
.export-page .alert-info strong {
  color: #075985;
}

/* V9 — Tabela e XLSX refinados */
.audit-table thead th {
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  vertical-align: middle;
}
.audit-table thead th[draggable="true"] {
  cursor: grab;
}
.audit-table thead th.dragging {
  opacity: 0.55;
}
.audit-table thead th.drag-over {
  outline: 2px dashed #93c5fd;
  outline-offset: -4px;
  background: #1d4ed8 !important;
}
.column-drag-handle {
  opacity: 0.45;
  margin-left: 0.45rem;
  font-size: 0.85rem;
}
.audit-table tbody tr.row-adjusted > td {
  background: #fff7ed !important;
  border-top: 1px solid #fdba74;
  border-bottom: 1px solid #fdba74;
}
.audit-table tbody tr.row-adjusted:hover > td {
  background: #ffedd5 !important;
}
.pill-adjusted {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fb923c;
  font-weight: 900;
}
.pill-scale-1236 {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.pill-scale-2472 {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.pill-scale-flex {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.pill-scale-padrao {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}
.dept-hover {
  cursor: help;
  text-decoration: underline dotted rgba(71, 85, 105, 0.45);
  text-underline-offset: 3px;
}
.search-panel.show {
  display: block;
}

/* V10 — refinamentos de tabela e filtros */
.audit-table th,
.audit-table td {
  border-right: 1px dashed rgba(148, 163, 184, 0.36);
}
.audit-table th:last-child,
.audit-table td:last-child {
  border-right: 0;
}
.audit-table tbody tr:hover td {
  background: #eff6ff !important;
  box-shadow:
    inset 0 1px 0 rgba(37, 99, 235, 0.08),
    inset 0 -1px 0 rgba(37, 99, 235, 0.08);
}
.export-filter-card select[multiple],
.table-appbar select[multiple] {
  min-height: 42px;
  padding-block: 0.35rem;
}
.param-category-card .param-field-card:has(label)::before {
  content: "";
}

/* V11 — ajustes finais de parâmetros, tabela e filtros */
.appbar-filter-menu {
  width: min(520px, 92vw);
  max-height: 380px;
  overflow: auto;
  border: 1px solid #dbeafe;
  border-radius: 16px;
}
.filter-check-list {
  display: grid;
  gap: 2px;
  max-height: 285px;
  overflow: auto;
}
.filter-check-item {
  border-radius: 10px;
  font-weight: 700;
}
.filter-check-item:hover {
  background: #eff6ff;
}
.column-filter-row th {
  background: #f8fbff !important;
  padding: 0.35rem 0.45rem !important;
  border-bottom: 1px solid #bfdbfe !important;
}
.column-filter {
  min-width: 92px;
  font-size: 0.76rem;
  border-radius: 10px;
}
.audit-table thead tr:first-child th {
  border-right: 1px dashed rgba(255, 255, 255, 0.42) !important;
}
.audit-table tbody td {
  border-right: 1px dashed #dbeafe !important;
}
.audit-table tbody tr:hover td {
  background: #eaf4ff !important;
}
.pill-adjusted-clean {
  font-size: 0.68rem !important;
  padding: 0.16rem 0.42rem !important;
  border-radius: 999px !important;
  line-height: 1.1;
  vertical-align: middle;
}
.params-section .param-field-card {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 1rem;
  transition: 0.18s ease-in-out;
}
.params-section .param-field-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}
.params-section .info-param {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.params-section .hhmm-badge {
  font-weight: 800;
}

/* V12 — ajustes HR e parâmetros recalculáveis */
#hrOwnFilterValue,
#exportFilterValue {
  min-height: 96px;
}
#hrOwnFilterBox {
  border-color: #dbeafe !important;
}

/* V13 — tabela sem filtros por coluna e hover reforçado */
.audit-table thead tr.column-filter-row {
  display: none !important;
}
.audit-table tbody tr:hover > td {
  background: #eaf4ff !important;
  box-shadow:
    inset 0 1px 0 #bfdbfe,
    inset 0 -1px 0 #bfdbfe;
}

/* V14 — navegação bloqueada até o processamento */
.nav-locked {
  opacity: 1;
}
#desktopNav .d-none,
#bottomNav .d-none {
  display: none !important;
}

/* V16 - correcoes runtime de Tabela e Exportar */
.audit-table thead tr.column-filter-row {
  display: none !important;
}
.audit-table tbody tr:hover > td {
  background: #eaf4ff !important;
}

/* V17 — filtro de exportação */
.export-filter-card #btnClearExportFilter {
  border-radius: 999px;
  font-weight: 700;
}

/* V19 — cards compactos de totais na exportação */
.export-totals-card .mini-total {
  border: 1px solid var(--bs-border-color);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  background: #fff;
  min-height: 72px;
}
.export-totals-card .mini-total span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.02em;
}
.export-totals-card .mini-total strong {
  display: block;
  font-size: 1.05rem;
  color: #0f172a;
  margin-top: 0.2rem;
  white-space: nowrap;
}
.export-totals-card .mini-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  font-size: 0.82rem;
}
.export-totals-card .mini-groups div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px dashed #dbeafe;
  padding: 0.15rem 0;
}
.export-totals-card .mini-groups span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
}
.export-totals-card .mini-groups strong {
  white-space: nowrap;
  color: #0f172a;
}
@media (max-width: 768px) {
  .export-totals-card .mini-groups {
    grid-template-columns: 1fr;
  }
}

/* V20 — Exportar: cards compactos e resumo em expander */
.export-page .export-totals-card {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.mini-total {
  min-height: 72px;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
}
.mini-total span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: #64748b;
}
.mini-total strong {
  font-size: 1.15rem;
  color: #0f172a;
}
.mini-total-primary {
  background: #eff6ff;
}
.mini-total-success {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.mini-total-warning {
  background: #fff7ed;
  border-color: #fed7aa;
}

.export-mini-groups-centered {
  max-width: 920px;
  margin-inline: auto;
}
.export-summary-accordion .accordion-button {
  border-radius: 1.25rem !important;
  box-shadow: none;
}
.export-summary-accordion .accordion-button:not(.collapsed) {
  color: #0f172a;
  background: #f8fbff;
}
.export-mini-kpi {
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #fff;
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.export-mini-kpi i {
  font-size: 1.35rem;
}
.export-mini-kpi span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: #64748b;
}
.export-mini-kpi strong {
  font-size: 1.35rem;
  line-height: 1;
  color: #0f172a;
}

/* V20 — assinatura centralizada na página de ajuda */
.help-signature-footer {
  padding-bottom: calc(var(--app-bottom-h, 72px) + 1rem);
}

/* V21 — correções Exportar/Help */
.export-summary-accordion .accordion-item {
  border-radius: 1.25rem;
}
.export-summary-accordion .accordion-button {
  border-radius: 1.25rem !important;
  box-shadow: none;
}
.export-summary-accordion .accordion-button:not(.collapsed) {
  background: #f8fbff;
  color: #0f172a;
}
.export-mini-kpi {
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #fff;
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.export-mini-kpi i {
  font-size: 1.35rem;
}
.export-mini-kpi span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: #64748b;
}
.export-mini-kpi strong {
  font-size: 1.35rem;
  line-height: 1;
  color: #0f172a;
}
.help-signature-footer {
  padding-bottom: calc(var(--app-bottom-h, 72px) + 1rem);
}

/* V22 — Exportar: resumo único em expander, cards isonômicos e sem duplicidade */
.export-summary-accordion .accordion-body {
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.export-totals-panel {
  max-width: 1180px;
  margin-inline: auto;
}
.export-summary-card {
  min-height: 96px;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
}
.export-summary-card i {
  font-size: 1.45rem;
}
.export-summary-card span {
  min-height: 2.15em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  font-weight: 800;
  color: #64748b;
}
.export-summary-card strong {
  font-size: 1.45rem;
  line-height: 1;
  color: #0f172a;
}
.export-summary-card-success {
  border-color: #bbf7d0;
  background: #f7fff9;
}
.export-summary-card-warning {
  border-color: #fde68a;
  background: #fffdf3;
}
.export-summary-card-primary {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.export-mini-groups-centered div {
  grid-template-columns: minmax(220px, 1fr) auto;
}
@media (max-width: 768px) {
  .export-mini-groups-centered div {
    grid-template-columns: 1fr;
  }
}

/* V23 — Exportar wide com estatísticas unificadas no expander */
.export-page > .container-fluid {
  max-width: none;
  padding-left: clamp(1rem, 2vw, 2rem);
  padding-right: clamp(1rem, 2vw, 2rem);
}
.export-summary-accordion {
  width: 100%;
}
.export-summary-accordion .accordion-item {
  border-radius: 1.25rem;
}
.export-summary-accordion .accordion-body {
  padding: clamp(1rem, 2vw, 2rem);
}
.export-totals-panel {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
}
.export-summary-card {
  min-height: 112px;
  height: 100%;
}
.export-summary-card span {
  min-height: 2.45em;
}
.export-group-results {
  max-width: 980px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
}
.export-group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.75rem;
  border: 1px dashed #cfe2ff;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.82);
}
.export-group-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
}
.export-group-row strong {
  white-space: nowrap;
  color: #0f172a;
}
@media (max-width: 992px) {
  .export-group-results {
    grid-template-columns: 1fr;
  }
}

/* V24 — Exportar: estatísticas agrupadas sem select bugado */
.export-grouped-stats {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.export-group-section {
  padding: 1rem;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
}
.export-group-card {
  height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}
.export-group-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.1);
}
.export-group-card-title {
  font-weight: 800;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.7rem;
}
.export-group-card-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  font-size: 0.9rem;
}
.export-group-card-grid span {
  color: #64748b;
}
.export-group-card-grid strong {
  color: #0f172a;
  text-align: right;
}
.help-signature {
  font-size: 0.9rem;
  color: #64748b;
}
.help-signature a {
  font-weight: 800;
  color: #0d6efd;
  text-decoration: none;
}
.help-signature a:hover {
  text-decoration: underline;
}

/* V25 — Exportar: expander wide com abas e cards Bootstrap */
.export-summary-wide {
  max-width: none;
  width: 100%;
}
.export-summary-wide .accordion-body {
  padding: clamp(1rem, 2.2vw, 2.2rem);
}
.export-totals-wide {
  max-width: none;
  width: 100%;
}
.export-stats-tabs {
  gap: 0.5rem;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 0.35rem;
  background: #f8fbff;
  width: fit-content;
  max-width: 100%;
}
.export-stats-tabs .nav-link {
  border-radius: 999px;
  font-weight: 800;
  color: #334155;
}
.export-stats-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #0d6efd, #06b6d4);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.22);
}
.export-stat-card {
  border: 1px solid #dbeafe !important;
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}
.export-stat-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd !important;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.13) !important;
}
.export-stat-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.export-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.export-stat-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 0.7rem 0.75rem;
  background: #fff;
}
.export-stat-grid span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}
.export-stat-grid strong {
  display: block;
  color: #0f172a;
  font-size: 1rem;
  margin-top: 0.15rem;
}
@media (max-width: 768px) {
  .export-stats-tabs {
    border-radius: 1rem;
  }
  .export-stats-tabs .nav-link {
    width: 100%;
  }
  .export-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* V26 — Exportar: cards mais discretos, filtro explicativo e assinatura única */
.export-mini-cards .export-summary-card {
  min-height: 96px;
  padding: 1rem;
  box-shadow: none;
  background: #ffffff;
}
.export-mini-cards .export-summary-card i {
  font-size: 1.3rem;
}
.export-mini-cards .export-summary-card span {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.export-mini-cards .export-summary-card strong {
  font-size: 1.25rem;
}
.export-filter-card {
  border-radius: 1.25rem;
}
.export-filter-placeholder {
  min-height: 86px;
  border: 1px dashed #bfdbfe;
  border-radius: 0.9rem;
  background: #f8fbff;
  color: #64748b;
  display: flex;
  align-items: center;
  padding: 0.9rem 1rem;
}
.export-filter-value {
  min-height: 86px;
}
.export-worked-toggle {
  min-height: 38px;
  justify-content: center;
  border: 1px solid #dbeafe;
  border-radius: 0.75rem;
  padding: 0.42rem 0.65rem;
  background: #fff;
}
.export-filter-result {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  color: #334155;
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.help-signature {
  position: sticky;
  bottom: 1rem;
  z-index: 5;
}
.help-signature .rounded-pill,
.help-signature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* V27 — Correções finais Exportar/Help */
.export-mini-cards .export-summary-card {
  min-height: 96px;
  padding: 1rem;
  box-shadow: none;
  background: #ffffff;
}
.export-mini-cards .export-summary-card i {
  font-size: 1.3rem;
}
.export-mini-cards .export-summary-card span {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.export-mini-cards .export-summary-card strong {
  font-size: 1.25rem;
}

.export-filter-card {
  border-radius: 1.25rem;
}
.export-filter-card .form-text {
  font-size: 0.78rem;
  color: #64748b;
}
.export-filter-placeholder {
  min-height: 86px;
  border: 1px dashed #bfdbfe;
  border-radius: 0.9rem;
  background: #f8fbff;
  color: #64748b;
  display: flex;
  align-items: center;
  padding: 0.9rem 1rem;
}
.export-filter-value {
  min-height: 86px;
}
.export-worked-toggle {
  min-height: 38px;
  justify-content: center;
  border: 1px solid #dbeafe;
  border-radius: 0.75rem;
  padding: 0.42rem 0.65rem;
  background: #fff;
}
.export-filter-result {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  color: #334155;
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

/* V28 — Assinatura no fluxo da página e multiselect amigável */
.help-page,
.help-section {
  min-height: calc(100vh - 110px);
  padding-bottom: 2rem;
}
.help-signature-footer {
  position: static;
  transform: none;
  margin: 3rem auto 0;
  text-align: center;
}
.help-signature-pill {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.export-check-dropdown .dropdown-menu {
  width: 100%;
  max-height: 320px;
  overflow: hidden;
}
.export-check-button {
  min-height: 44px;
  background: #fff;
}
.export-check-menu {
  border: 1px solid #bfdbfe;
  border-radius: 0.9rem;
}
.export-check-list {
  max-height: 250px;
  overflow: auto;
  padding: 0.35rem;
}
.export-check-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.65rem;
  padding: 0.55rem 0.65rem;
}
.export-check-item:hover {
  background: #eff6ff;
}
.export-check-item .form-check-input {
  flex: 0 0 auto;
}
.export-filter-row {
  justify-content: flex-end;
}

/* V29 — dropdown multiseleção sem fechar após marcação */
.export-check-dropdown .dropdown-menu.show {
  display: block;
}
.export-check-menu {
  z-index: 1060;
}
.export-filter-result {
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
