html {
  font-size: 14px;
}

:root {
  --app-primary: #082f63;
  --app-primary-rgb: 8, 47, 99;
  --app-primary-contrast: #ffffff;
  --app-accent: #18a058;
  --app-accent-rgb: 24, 160, 88;
  --app-sidebar-bg: #071b33;
  --app-sidebar-active: rgba(var(--app-accent-rgb), 0.24);
  --app-surface: #ffffff;
  --app-page-bg: #f3f6f9;
  --app-border: #d8e0e8;
  --app-heading: #122033;
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: var(--app-primary-rgb);
  --bs-link-color: var(--app-primary);
  --bs-link-hover-color: var(--app-accent);
}

[data-palette="azul"] {
  --app-primary: #075985;
  --app-primary-rgb: 7, 89, 133;
  --app-accent: #0284c7;
  --app-accent-rgb: 2, 132, 199;
  --app-sidebar-bg: #082f49;
  --app-sidebar-active: rgba(var(--app-accent-rgb), 0.25);
}

[data-palette="verde"] {
  --app-primary: #166534;
  --app-primary-rgb: 22, 101, 52;
  --app-accent: #16a34a;
  --app-accent-rgb: 22, 163, 74;
  --app-sidebar-bg: #102a1d;
  --app-sidebar-active: rgba(var(--app-accent-rgb), 0.25);
}

[data-palette="grafite"] {
  --app-primary: #334155;
  --app-primary-rgb: 51, 65, 85;
  --app-accent: #64748b;
  --app-accent-rgb: 100, 116, 139;
  --app-sidebar-bg: #171f2a;
  --app-sidebar-active: rgba(var(--app-accent-rgb), 0.28);
}

[data-theme-mode="dark"] {
  --app-surface: #17202b;
  --app-page-bg: #0d1218;
  --app-border: #2a3644;
  --app-heading: #e6edf3;
  --bs-body-bg: var(--app-page-bg);
  --bs-body-color: #d8e0e8;
  --bs-secondary-color: #9ba8b6;
  --bs-tertiary-bg: #101820;
  --bs-border-color: var(--app-border);
  --bs-link-color: #7dd3fc;
  --bs-link-hover-color: #86efac;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

body {
  background: var(--app-page-bg);
  min-height: 100vh;
}

.auth-box {
  max-width: 27rem;
  width: min(92vw, 27rem);
}

.auth-logo {
  background: #ffffff;
  border-radius: 0.65rem;
  height: 5.5rem;
  object-fit: contain;
  padding: 0.4rem;
  width: 5.5rem;
}

.app-wrapper {
  background: var(--app-page-bg);
}

.app-header {
  background: var(--app-surface) !important;
  border-bottom: 1px solid var(--app-border);
}

.app-sidebar {
  background: var(--app-sidebar-bg) !important;
}

.sidebar-brand {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-link {
  align-items: center;
  gap: 0.55rem;
}

.conciliador-logo {
  background: #ffffff;
  border-radius: 0.45rem;
  box-shadow: none !important;
  height: 2.15rem !important;
  object-fit: contain;
  padding: 0.1rem;
  width: 2.15rem !important;
}

.sidebar-menu .nav-link.active {
  background: var(--app-sidebar-active) !important;
  color: #fff !important;
}

.sidebar-menu .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.module-sidebar-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.module-hero {
  align-items: center;
  background: linear-gradient(90deg, rgba(var(--app-primary-rgb), 0.08), rgba(var(--app-accent-rgb), 0.08));
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  display: flex;
  justify-content: space-between;
  padding: 1.25rem;
}

.module-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  color: var(--bs-body-color);
  display: flex;
  gap: 0.7rem;
  padding: 1.1rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.module-card:hover {
  border-color: var(--app-primary);
  transform: translateY(-1px);
}

.module-card-icon {
  align-items: center;
  background: rgba(var(--app-primary-rgb), 0.1);
  border-radius: 0.45rem;
  color: var(--app-primary);
  display: inline-flex;
  font-size: 1.4rem;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.module-card-title {
  color: var(--app-heading);
  display: block;
  font-size: 1.05rem;
  font-weight: 750;
}

.module-card-description {
  color: var(--bs-secondary-color);
  display: block;
  flex: 1;
  font-size: 0.9rem;
}

.module-card-action {
  color: var(--app-primary);
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}

.card {
  background: var(--app-surface);
  border-color: var(--app-border);
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-accent);
  --bs-btn-hover-border-color: var(--app-accent);
  --bs-btn-active-bg: var(--app-accent);
  --bs-btn-active-border-color: var(--app-accent);
}

.btn-outline-primary {
  --bs-btn-color: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary);
  --bs-btn-hover-border-color: var(--app-primary);
}

.form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.palette-select {
  min-width: 7.5rem;
}

.theme-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.help-button {
  border-radius: 50%;
  font-weight: 800;
  height: 2rem;
  line-height: 1;
  padding: 0;
  width: 2rem;
}

#sidebarVisibilityToggle {
  align-items: center;
  color: var(--app-primary);
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

#sidebarVisibilityToggle:hover {
  background: rgba(var(--app-primary-rgb), 0.08);
}

#sidebarVisibilityToggle i {
  font-size: 1.1rem;
}

.help-section {
  border: 1px solid var(--app-border);
  border-radius: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.9rem;
}

.help-section h3 {
  color: var(--app-heading);
  font-size: 0.92rem;
  font-weight: 750;
  margin: 0 0 0.45rem;
}

.help-section p {
  margin: 0;
}

.help-section.technical {
  background: rgba(var(--app-primary-rgb), 0.05);
}

.help-summary {
  background: rgba(var(--app-primary-rgb), 0.05);
  border: 1px solid rgba(var(--app-primary-rgb), 0.18);
  border-radius: 0.5rem;
  padding: 0.85rem 0.95rem;
}

.comparison-kpi {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0.45rem;
  min-height: 5rem;
  padding: 0.85rem 0.95rem;
}

.comparison-kpi-label {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.comparison-kpi-value {
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1.1;
  margin-top: 0.3rem;
}

.decision-banner {
  background: linear-gradient(180deg, rgba(var(--app-primary-rgb), 0.06), rgba(var(--app-primary-rgb), 0.02));
  border: 1px solid rgba(var(--app-primary-rgb), 0.18);
  border-radius: 0.65rem;
  padding: 1rem 1.1rem;
}

.decision-banner-body {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.decision-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.decision-card {
  border: 1px solid var(--app-border);
  border-radius: 0.55rem;
}

.decision-card-label {
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.decision-card-value {
  color: var(--app-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.chart-row {
  border-radius: 0.45rem;
  padding: 0.45rem 0.55rem;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.chart-row:hover {
  background: rgba(var(--app-primary-rgb), 0.05);
  box-shadow: 0 0.25rem 0.75rem rgba(16, 24, 40, 0.05);
  transform: translateY(-1px);
}

.xml-original-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.xml-original-summary::-webkit-details-marker {
  display: none;
}

/* Ajuda renderizada de Markdown (docs/spec/26 - ajuda ao usuario) */
.help-content h1 {
  color: var(--app-heading);
  font-size: 1.2rem;
  font-weight: 750;
  margin: 0 0 0.85rem;
}

.help-content h2 {
  color: var(--app-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 0.5rem;
}

.help-content h3 {
  color: var(--app-heading);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0.9rem 0 0.4rem;
}

.help-content p,
.help-content ul,
.help-content ol,
.help-content table {
  margin: 0 0 0.7rem;
}

.help-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

.help-content th,
.help-content td {
  border: 1px solid var(--app-border);
  padding: 0.35rem 0.55rem;
  text-align: left;
}

.help-content th {
  background: rgba(var(--app-primary-rgb), 0.06);
}

.help-content blockquote {
  border-left: 0.25rem solid var(--app-primary);
  background: rgba(var(--app-primary-rgb), 0.05);
  margin: 0 0 0.7rem;
  padding: 0.5rem 0.85rem;
  color: var(--app-heading);
}

.help-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--app-border);
  border-radius: 0.4rem;
  margin: 0.4rem 0;
}

.help-technical > summary {
  cursor: pointer;
}

/* Empty state (docs/spec/28, fase 3) */
.empty-state-icon {
  font-size: 2.6rem;
  color: var(--app-primary);
  line-height: 1;
}

/* Diagramas Mermaid na ajuda */
.help-content .mermaid {
  text-align: center;
  margin: 0.5rem 0 1rem;
}

.fiscal-source-panel {
  border: 1px solid var(--app-border);
  border-left: 0.28rem solid var(--app-primary);
  border-radius: 0.45rem;
  padding: 1rem;
}

.fiscal-source-panel h3 {
  color: var(--app-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0.1rem 0 0.85rem;
}

.fiscal-source-panel dd {
  margin-bottom: 0.25rem;
}

.fiscal-catalog-grid th,
.fiscal-catalog-grid td {
  vertical-align: middle;
}

.fiscal-catalog-grid td:nth-child(2),
.fiscal-catalog-grid td:nth-child(6),
.fiscal-catalog-grid td:nth-child(7) {
  white-space: nowrap;
}

.fiscal-validation-grid th,
.fiscal-validation-grid td {
  vertical-align: middle;
}

.fiscal-validation-grid td:nth-child(2),
.fiscal-validation-grid td:nth-child(4),
.fiscal-validation-grid td:nth-child(5),
.fiscal-validation-grid td:nth-child(6),
.fiscal-validation-grid td:nth-child(7),
.fiscal-validation-grid td:nth-child(10) {
  white-space: nowrap;
}

.reconciliation-grid {
  min-width: 1400px;
  table-layout: fixed;
}

.reconciliation-grid th,
.reconciliation-grid td {
  vertical-align: middle;
}

.reconciliation-status-col,
.reconciliation-action-col,
.reconciliation-select-col,
.reconciliation-number-col,
.reconciliation-validation-col,
.reconciliation-money-col,
.reconciliation-count-col,
.reconciliation-cause-col,
.reconciliation-user-col {
  white-space: nowrap;
}

.reconciliation-status-col {
  min-width: 6.3rem;
}

.reconciliation-action-col {
  min-width: 4.6rem;
}

.reconciliation-select-col {
  min-width: 2.7rem;
  width: 2.7rem;
  text-align: center;
}

.reconciliation-number-col {
  min-width: 6.8rem;
}

.reconciliation-validation-col {
  min-width: 7rem;
}

.reconciliation-money-col {
  min-width: 7rem;
}

.reconciliation-count-col {
  min-width: 6rem;
  text-align: center;
}

.reconciliation-cause-col {
  min-width: 10rem;
}

.reconciliation-user-col {
  min-width: 10rem;
}

.party-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.party-cell-label {
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.party-cell-cnpj {
  color: var(--app-heading);
  font-size: 0.9rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.party-cell-name {
  color: var(--bs-secondary-color);
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: normal;
}

.reconciliation-actions-col {
  min-width: 6rem;
  position: sticky;
  right: 0;
  background: var(--bs-body-bg);
  box-shadow: -0.45rem 0 0.65rem rgba(16, 24, 40, 0.05);
  z-index: 1;
}

.reconciliation-grid thead .reconciliation-actions-col {
  z-index: 2;
}

.reconciliation-grid tbody tr:hover .reconciliation-actions-col {
  background: var(--bs-table-hover-bg);
}

.reconciliation-action-col .btn {
  min-width: 3.35rem;
  padding-inline: 0.45rem;
  font-size: 0.8rem;
  width: auto;
}

.reconciliation-select-col .form-check-input {
  float: none;
  margin: 0;
  vertical-align: middle;
}

.reconciliation-grid td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.reconciliation-grid td .party-cell-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reconciliation-grid td .badge {
  max-width: 100%;
}

.app-content-header h1 {
  color: var(--app-heading);
  font-size: 1.45rem;
  font-weight: 650;
}

.sidebar-menu .nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0.35rem;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  height: 1.45rem;
  justify-content: center;
  margin-right: 0.4rem;
  width: 1.45rem;
}

.info-card {
  border-left: 0.28rem solid var(--app-primary);
  min-height: 7.5rem;
}

.chart-list {
  display: grid;
  gap: 0.85rem;
}

.chart-row-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.chart-row-header span {
  color: var(--app-heading);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-row-header strong {
  color: var(--app-heading);
  font-variant-numeric: tabular-nums;
}

.chart-track {
  background: rgba(var(--app-primary-rgb), 0.12);
  border-radius: 999px;
  height: 0.55rem;
  overflow: hidden;
}

.chart-bar {
  border-radius: inherit;
  height: 100%;
  min-width: 0.4rem;
}

.chart-bar.problem {
  background: #dc3545;
}

.chart-bar.provider {
  background: var(--app-primary);
}

.chart-bar.customer {
  background: var(--app-accent);
}

body.sidebar-hidden .app-wrapper {
  grid-template-areas: "lte-app-header" "lte-app-main" "lte-app-footer";
  grid-template-columns: 1fr;
}

body.sidebar-hidden .app-sidebar {
  display: none !important;
}

.table thead th {
  color: var(--bs-secondary-color);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

[data-theme-mode="dark"] .table {
  --bs-table-bg: var(--app-surface);
  --bs-table-color: #d8e0e8;
  --bs-table-border-color: var(--app-border);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
  --bs-table-hover-color: #ffffff;
}

[data-theme-mode="dark"] .form-control,
[data-theme-mode="dark"] .form-select {
  background-color: #101820;
  border-color: var(--app-border);
  color: #e6edf3;
}

[data-theme-mode="dark"] .form-control:focus,
[data-theme-mode="dark"] .form-select:focus {
  background-color: #101820;
  color: #e6edf3;
}

[data-theme-mode="dark"] .breadcrumb-item.active,
[data-theme-mode="dark"] .text-secondary,
[data-theme-mode="dark"] .text-muted {
  color: #9ba8b6 !important;
}

.text-bg-purple {
  background-color: #6f42c1 !important;
  color: #fff !important;
}

.border-purple {
  border-color: #6f42c1 !important;
}

.text-purple {
  color: #6f42c1 !important;
}

.text-bg-orange {
  background-color: #fd7e14 !important;
  color: #fff !important;
}

.border-orange {
  border-color: #fd7e14 !important;
}

.text-orange {
  color: #fd7e14 !important;
}

.status-semaforo {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  justify-content: center;
  min-height: 1.45rem;
  min-width: 1.45rem;
  padding: 0.16rem;
  vertical-align: middle;
}

.status-semaforo i {
  font-size: 0.88rem;
  line-height: 1;
}

.reconciliation-status-col,
.reconciliation-validation-col,
.reconciliation-cause-col {
  text-align: center;
}

.reconciliation-open-btn {
  min-width: 4.2rem;
  padding-inline: 0.65rem;
  line-height: 1.05;
}

.status-semaforo-success {
  color: #198754;
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(25, 135, 84, 0.25);
}

.status-semaforo-warning {
  color: #b58100;
  background: rgba(255, 193, 7, 0.16);
  border-color: rgba(255, 193, 7, 0.3);
}

.status-semaforo-danger {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.25);
}

.status-semaforo-info {
  color: #0dcaf0;
  background: rgba(13, 202, 240, 0.12);
  border-color: rgba(13, 202, 240, 0.25);
}

.status-semaforo-primary {
  color: var(--app-primary);
  background: rgba(var(--app-primary-rgb), 0.1);
  border-color: rgba(var(--app-primary-rgb), 0.22);
}

.status-semaforo-secondary {
  color: #6c757d;
  background: rgba(108, 117, 125, 0.12);
  border-color: rgba(108, 117, 125, 0.22);
}

.status-semaforo-purple {
  color: #6f42c1;
  background: rgba(111, 66, 193, 0.12);
  border-color: rgba(111, 66, 193, 0.25);
}

.status-semaforo-orange {
  color: #fd7e14;
  background: rgba(253, 126, 20, 0.12);
  border-color: rgba(253, 126, 20, 0.25);
}

.status-semaforo-light {
  color: #adb5bd;
  background: rgba(173, 181, 189, 0.12);
  border-color: rgba(173, 181, 189, 0.25);
}

.comparison-diff {
  --bs-table-bg: #ffe5e8;
  --bs-table-color: #58151c;
  background: #ffe5e8 !important;
  box-shadow: inset 0.28rem 0 0 #dc3545;
  color: #58151c;
}

.comparison-tolerance {
  --bs-table-bg: #e7f1ff;
  --bs-table-color: #052c65;
  background: #e7f1ff !important;
  box-shadow: inset 0.28rem 0 0 #0d6efd;
  color: #052c65;
}

.comparison-ressalva {
  --bs-table-bg: #fff3cd;
  --bs-table-color: #664d03;
  background: #fff3cd !important;
  box-shadow: inset 0.28rem 0 0 #ffc107;
  color: #664d03;
}

/* Valor confere, mas so um lado retem: muda o valor pago ao fornecedor */
.comparison-retencao {
  --bs-table-bg: #ffe8d1;
  --bs-table-color: #6a3203;
  background: #ffe8d1 !important;
  box-shadow: inset 0.28rem 0 0 #fd7e14;
  color: #6a3203;
}

.badge-retencao {
  background: #fd7e14;
  color: #fff;
}

.alert-retencao {
  background: #fff4e8;
  border-color: #fd7e14;
  color: #6a3203;
}

.comparison-success {
  --bs-table-bg: #e8f5e9;
  --bs-table-color: #1b5e20;
  background: #e8f5e9 !important;
  box-shadow: inset 0.28rem 0 0 #198754;
  color: #1b5e20;
}

.comparison-value {
  font-weight: 700;
}

.comparison-diff .comparison-value {
  color: #b02a37;
}

.comparison-success .comparison-value {
  color: #146c43;
}

.xml-preview {
  background: #101418;
  border-radius: 0.35rem;
  color: #d7e1ea;
  max-height: 32rem;
  overflow: auto;
  padding: 1rem;
  white-space: pre;
  tab-size: 2;
}

.danfse-document {
  background: #fff;
  border: 1px solid #bfc9d5;
  color: #102031;
  margin: 0 auto 2rem;
  max-width: 1120px;
  padding: 0.9rem;
  box-shadow: 0 1px 0 rgba(16, 32, 49, 0.03);
}

[data-theme-mode="dark"] .danfse-document {
  background: #fff;
  color: #102031;
}

.danfse-banner {
  align-items: stretch;
  border: 2px solid #102031;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.danfse-banner-brand {
  flex: 1 1 auto;
  padding: 0.95rem 1rem;
}

.danfse-kicker,
.danfse-section-title,
.danfse-table th,
.danfse-notes span,
.danfse-banner-meta span {
  color: #4d5a67;
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.danfse-banner h1 {
  font-size: 2.15rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  margin: 0.25rem 0 0.1rem;
}

.danfse-subtitle {
  color: #4d5a67;
  font-size: 0.95rem;
  font-weight: 600;
}

.danfse-banner-number {
  border-left: 2px solid #102031;
  min-width: 19rem;
  padding: 0.95rem 1rem;
  text-align: center;
}

.danfse-banner-number span {
  color: #4d5a67;
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.danfse-banner-number strong {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.danfse-banner-meta {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.85rem;
}

.danfse-banner-meta > div,
.danfse-notes {
  border: 1px solid #cfd6df;
  padding: 0.65rem 0.75rem;
}

.danfse-banner-meta strong,
.danfse-table td {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  margin-top: 0.12rem;
  overflow-wrap: anywhere;
}

.danfse-section {
  margin-top: 0.85rem;
}

.danfse-section-title {
  background: #e9eef3;
  border: 1px solid #bfc9d5;
  border-bottom: 0;
  color: #102031;
  padding: 0.45rem 0.7rem;
}

.danfse-table {
  border-collapse: collapse;
  width: 100%;
}

.danfse-table th,
.danfse-table td {
  border: 1px solid #bfc9d5;
  padding: 0.55rem 0.7rem;
  vertical-align: top;
}

.danfse-table th {
  background: #f6f8fb;
  width: 14%;
}

.danfse-table td {
  background: #fff;
  width: 36%;
}

.danfse-table-compact th {
  width: 34%;
}

.danfse-table-values th,
.danfse-table-values td {
  width: 25%;
}

.danfse-panel {
  min-width: 0;
}

.danfse-split {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.85rem;
}

.danfse-notes {
  border-top: 0;
}

.danfse-notes + .danfse-notes {
  margin-top: 0.5rem;
}

.danfse-notes p {
  margin: 0.25rem 0 0;
}

.danfse-footer-note {
  border-top: 1px solid #bfc9d5;
  color: #4d5a67;
  font-size: 0.85rem;
  margin-top: 0.9rem;
  padding-top: 0.6rem;
}

@media (max-width: 767.98px) {
  .theme-toolbar {
    gap: 0.5rem !important;
  }

  .palette-select {
    min-width: 6.2rem;
  }

  .danfse-banner,
  .danfse-split {
    display: block;
  }

  .danfse-banner-number {
    border-left: 0;
    border-top: 2px solid #1f2933;
  }

  .danfse-table,
  .danfse-table tbody,
  .danfse-table tr,
  .danfse-table th,
  .danfse-table td {
    display: block;
    width: 100%;
  }

  .danfse-table th {
    border-bottom: 0;
  }

  .danfse-table td {
    margin-bottom: 0.25rem;
  }
}

@media print {
  .app-header,
  .app-sidebar,
  .app-footer,
  .app-content-header,
  .no-print {
    display: none !important;
  }

  .app-main,
  .app-content,
  .container-fluid {
    margin: 0 !important;
    padding: 0 !important;
  }

  .danfse-document {
    border: 0;
    max-width: none;
    padding: 0;
    box-shadow: none;
  }

  .danfse-section,
  .danfse-split,
  .danfse-banner {
    break-inside: avoid;
  }
}


/* Contadores da conciliacao: nao usam .badge para nao virarem semaforo no modo compacto (site.js). */
.count-pill {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.count-pill-danger {
  border-color: var(--bs-danger);
  background: var(--bs-danger);
  color: #fff;
}

.count-pill-success {
  border-color: var(--bs-success);
  background: var(--bs-success);
  color: #fff;
}

/* Cartoes de etapa do dashboard: clicaveis, com leve destaque ao passar o mouse. */
.dashboard-step {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-step:hover,
.dashboard-step:focus-visible {
  box-shadow: 0 0.5rem 1rem rgba(16, 24, 40, 0.12) !important;
  transform: translateY(-1px);
}

/* Validacao fiscal: causas explicadas em <details> */
details.card > summary {
    cursor: pointer;
    list-style: none;
}

details.card > summary::-webkit-details-marker {
    display: none;
}

details.card > summary::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    margin-left: .5rem;
    transition: transform .15s ease;
}

details.card[open] > summary::after {
    transform: rotate(180deg);
}

.fiscal-issue-card {
    border-left-width: 4px !important;
    border-top-color: var(--bs-border-color-translucent) !important;
    border-right-color: var(--bs-border-color-translucent) !important;
    border-bottom-color: var(--bs-border-color-translucent) !important;
}
