* {
  box-sizing: border-box;
}

/* Redespacho - conferência financeira */
body.redespacho-page-active .redespacho-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.redespacho-page-active .redespacho-conferencia-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-width: 0;
}

body.redespacho-page-active .redespacho-conferencia-summary article {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dfe9e3;
  border-radius: 10px;
  background: #fff;
}

body.redespacho-page-active .redespacho-conferencia-summary span {
  display: block;
  margin-bottom: 3px;
  color: #66756f;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

body.redespacho-page-active .redespacho-conferencia-summary strong {
  color: #17322a;
  font-size: 1rem;
}

body.redespacho-page-active .filters-grid.redespacho-conferencia-filters-grid {
  display: grid;
  grid-template-columns:
    minmax(125px, 0.8fr)
    minmax(125px, 0.8fr)
    minmax(180px, 1.2fr)
    minmax(130px, 0.8fr)
    minmax(110px, 0.7fr)
    minmax(130px, 0.8fr)
    minmax(176px, auto);
  gap: 8px;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.redespacho-page-active .redespacho-conferencia-table {
  min-width: 1540px;
}

body.redespacho-page-active .redespacho-conferencia-table th:nth-child(7),
body.redespacho-page-active .redespacho-conferencia-table td:nth-child(7),
body.redespacho-page-active .redespacho-conferencia-table th:nth-child(8),
body.redespacho-page-active .redespacho-conferencia-table td:nth-child(8) {
  width: 190px;
}

body.redespacho-page-active .redespacho-conferencia-table th:nth-child(9),
body.redespacho-page-active .redespacho-conferencia-table td:nth-child(9),
body.redespacho-page-active .redespacho-conferencia-table th:nth-child(10),
body.redespacho-page-active .redespacho-conferencia-table td:nth-child(10),
body.redespacho-page-active .redespacho-conferencia-table th:nth-child(11),
body.redespacho-page-active .redespacho-conferencia-table td:nth-child(11) {
  width: 124px;
  text-align: right;
}

body.redespacho-page-active .redespacho-conferencia-table th:nth-child(14),
body.redespacho-page-active .redespacho-conferencia-table td:nth-child(14) {
  width: 180px;
}

body.redespacho-page-active .redespacho-editable-unit-cell {
  padding: 0;
}

body.redespacho-page-active .redespacho-unit-form {
  margin: 0;
}

body.redespacho-page-active .redespacho-editable-unit {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  padding: 8px 10px;
}

body.redespacho-page-active .redespacho-editable-unit:hover {
  background: #eef6ff;
  color: #0f4c81;
}

body.redespacho-page-active .redespacho-editable-unit.is-saving {
  opacity: 0.65;
  pointer-events: none;
}

body.redespacho-page-active .redespacho-editable-unit.is-saved {
  background: #ecfdf3;
  color: #166534;
}

body.redespacho-page-active .redespacho-money-negative {
  color: #a53b1f;
  font-weight: 800;
}

body.redespacho-page-active .redespacho-status-conciliado {
  background: #e3f4ec;
  color: #14623f;
}

body.redespacho-page-active .redespacho-status-divergente {
  background: #fdebdc;
  color: #9a3f0c;
}

body.redespacho-page-active .redespacho-status-sem_base {
  background: #f4e7bd;
  color: #7a5a08;
}

body.redespacho-page-active .redespacho-report-card {
  margin-top: 14px;
}

body.redespacho-page-active .redespacho-report-table {
  min-width: 820px;
}

body.redespacho-page-active .redespacho-report-table th:nth-child(3),
body.redespacho-page-active .redespacho-report-table td:nth-child(3),
body.redespacho-page-active .redespacho-report-table th:nth-child(4),
body.redespacho-page-active .redespacho-report-table td:nth-child(4),
body.redespacho-page-active .redespacho-report-table th:nth-child(5),
body.redespacho-page-active .redespacho-report-table td:nth-child(5) {
  text-align: right;
  width: 130px;
}

@media (max-width: 1180px) {
  body.redespacho-page-active .redespacho-conferencia-summary {
    grid-template-columns: 1fr;
  }

  body.redespacho-page-active .filters-grid.redespacho-conferencia-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.redespacho-page-active .redespacho-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body.redespacho-page-active .redespacho-header-actions .action-button {
    width: 100%;
    justify-content: center;
  }

  body.redespacho-page-active .filters-grid.redespacho-conferencia-filters-grid {
    grid-template-columns: 1fr;
  }
}

.roteirizador-page {
  display: grid;
  gap: 16px;
}

.roteirizador-toolbar {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.roteirizador-copy h3 {
  margin: 0 0 4px;
}

.roteirizador-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.roteirizador-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.roteirizador-filters input,
.roteirizador-filters select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  text-transform: none;
}

.roteirizador-filters button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.roteirizador-kpis {
  align-items: stretch;
}

.roteirizador-route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.roteirizador-route-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.roteirizador-route-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.roteirizador-route-card header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.roteirizador-route-card header strong {
  color: #111827;
  font-size: 17px;
}

.roteirizador-route-card header span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.roteirizador-route-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.roteirizador-route-card dl div {
  min-width: 0;
}

.roteirizador-route-card dt {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.roteirizador-route-card dd {
  margin: 2px 0 0;
  color: #111827;
  font-weight: 700;
}

.roteirizador-route-card details {
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
}

.roteirizador-route-card summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 800;
}

.roteirizador-route-card ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.roteirizador-route-card li {
  min-width: 0;
}

.roteirizador-route-card li span,
.roteirizador-route-card li small {
  display: block;
  color: #6b7280;
}

.roteirizador-rule-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roteirizador-rule-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.roteirizador-rule-strip strong {
  color: #111827;
}

.roteirizador-blocked {
  margin-top: 12px;
}

.roteirizador-blocked summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 800;
}

.roteirizador-table th,
.roteirizador-table td {
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .roteirizador-filters {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .roteirizador-filters,
  .roteirizador-route-card dl {
    grid-template-columns: 1fr;
  }
}

.ferias-page {
  --ferias-text: #111827;
  --ferias-muted: #6b7280;
  --ferias-border: #e5e7eb;
  --ferias-bg: #f3f4f6;
  --ferias-card: #ffffff;
  --ferias-blue: #2563eb;
  --ferias-green: #16a34a;
  --ferias-red: #dc2626;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ferias-text);
}

body.ferias-page-active .finance-main,
body.ferias-page-active .fin-content,
body.ferias-page-active .main-content {
  background: #f3f4f6;
}

body.ferias-page-active .fin-header {
  border-bottom-color: #e5e7eb;
  background: #f3f4f6;
}

.ferias-hero,
.ferias-toolbar,
.ferias-summary-card,
.ferias-calendar-card,
.ferias-side-panel,
.ferias-drawer {
  border: 1px solid var(--ferias-border);
  background: var(--ferias-card);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.ferias-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 10px;
}

.ferias-hero-copy {
  display: grid;
  gap: 7px;
}

.ferias-eyebrow {
  color: var(--ferias-blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ferias-hero h3,
.ferias-calendar-header h3,
.ferias-side-panel h3,
.ferias-drawer h3 {
  margin: 0;
  color: var(--ferias-text);
}

.ferias-hero h3 {
  font-size: 26px;
}

.ferias-hero p,
.ferias-drawer p {
  max-width: 720px;
  margin: 0;
  color: var(--ferias-muted);
  line-height: 1.4;
}

.ferias-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ferias-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--ferias-border);
  border-radius: 999px;
  color: var(--ferias-muted);
  font-size: 12px;
  font-weight: 700;
}

.ferias-legend-item i,
.ferias-upcoming-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.ferias-legend-item.is-programada i,
.ferias-upcoming-dot.is-programada {
  background: var(--ferias-blue);
}

.ferias-legend-item.is-andamento i,
.ferias-upcoming-dot.is-andamento {
  background: var(--ferias-green);
}

.ferias-legend-item.is-concluida i,
.ferias-upcoming-dot.is-concluida {
  background: #9ca3af;
}

.ferias-legend-item.is-cancelada i,
.ferias-upcoming-dot.is-cancelada {
  background: #fca5a5;
}

.ferias-action-primary,
.ferias-action-secondary,
.ferias-action-danger,
.ferias-icon-button,
.ferias-more {
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ferias-action-primary {
  min-height: 38px;
  padding: 9px 14px;
  background: var(--ferias-blue);
  color: #fff;
  white-space: nowrap;
}

.ferias-action-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.ferias-action-secondary {
  min-height: 36px;
  padding: 8px 12px;
  border-color: var(--ferias-border);
  background: #fff;
  color: #374151;
}

.ferias-action-secondary:hover,
.ferias-icon-button:hover,
.ferias-more:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ferias-action-danger {
  min-height: 36px;
  padding: 8px 12px;
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.ferias-icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-color: var(--ferias-border);
  background: #fff;
  color: #374151;
  font-size: 24px;
  line-height: 1;
}

.ferias-toolbar {
  display: grid;
  grid-template-columns: 126px 120px 160px 160px minmax(220px, 1.3fr) 140px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 10px;
}

.ferias-filter-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--ferias-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ferias-filter-field input,
.ferias-filter-field select {
  min-width: 0;
  width: 100%;
  height: 36px;
  border: 1px solid var(--ferias-border);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ferias-text);
  font-size: 13px;
  text-transform: none;
}

.ferias-filter-field input[type="month"] {
  max-width: 126px;
  padding-left: 8px;
  padding-right: 6px;
}

.ferias-filter-field input:focus,
.ferias-filter-field select:focus,
.ferias-form input:focus,
.ferias-form select:focus,
.ferias-form textarea:focus {
  outline: 2px solid #bfdbfe;
  outline-offset: 1px;
  border-color: var(--ferias-blue);
}

.ferias-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ferias-summary-card {
  display: grid;
  gap: 2px;
  min-height: 82px;
  padding: 12px 14px;
  border-radius: 10px;
}

.ferias-summary-card span,
.ferias-summary-card small {
  color: var(--ferias-muted);
}

.ferias-summary-card span {
  font-size: 12px;
  font-weight: 800;
}

.ferias-summary-card strong {
  color: var(--ferias-text);
  font-size: 28px;
  line-height: 1.05;
}

.ferias-summary-card small {
  font-size: 12px;
}

.ferias-calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  gap: 14px;
  align-items: start;
}

.ferias-calendar-card,
.ferias-side-panel {
  border-radius: 12px;
}

.ferias-calendar-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.ferias-calendar-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--ferias-border);
}

.ferias-calendar-title {
  text-align: center;
}

.ferias-calendar-title h3 {
  font-size: 20px;
}

.ferias-calendar-title span,
.ferias-side-panel header span {
  color: var(--ferias-muted);
  font-size: 12px;
}

.ferias-calendar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ferias-calendar-weekdays,
.ferias-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ferias-calendar-weekdays {
  border-bottom: 1px solid var(--ferias-border);
  background: #f9fafb;
  color: var(--ferias-muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.ferias-calendar-weekdays span {
  padding: 9px 6px;
}

.ferias-filial-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ferias-border);
  background: #fff;
}

.ferias-filial-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--ferias-border);
  border-radius: 999px;
  background: var(--ferias-filial-bg);
  color: #374151;
  font-size: 12px;
  font-weight: 800;
}

.ferias-filial-legend-item i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ferias-filial-main);
}

.ferias-calendar {
  border-left: 1px solid var(--ferias-border);
}

.ferias-day {
  min-width: 0;
  min-height: 128px;
  padding: 8px;
  border-right: 1px solid var(--ferias-border);
  border-bottom: 1px solid var(--ferias-border);
  background: #fff;
}

.ferias-day.is-muted {
  background: #f9fafb;
}

.ferias-day.is-today {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px #93c5fd;
}

.ferias-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  color: #374151;
  font-size: 12px;
}

.ferias-day header span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 900;
}

.ferias-day-items {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.ferias-chip {
  display: grid;
  gap: 1px;
  width: 100%;
  min-height: 34px;
  padding: 5px 7px 5px 8px;
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--ferias-filial-main, #6b7280);
  border-radius: 8px;
  background: var(--ferias-filial-bg, #f3f4f6);
  color: var(--ferias-text);
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.ferias-chip:hover {
  border-color: var(--ferias-filial-main, #6b7280);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.12);
}

.ferias-chip-main,
.ferias-chip-name,
.ferias-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ferias-chip-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.ferias-chip-name {
  min-width: 0;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.ferias-filial-pill {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--ferias-filial-main, #6b7280);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  letter-spacing: 0;
}

.ferias-chip small {
  color: #4b5563;
  font-size: 10px;
  opacity: 0.9;
}

.ferias-chip.is-programada {
  color: var(--ferias-text);
}

.ferias-chip.is-andamento {
  color: var(--ferias-text);
}

.ferias-chip.is-concluida {
  color: var(--ferias-text);
}

.ferias-chip.is-cancelada {
  opacity: 0.74;
}

.ferias-chip.is-filial-unknown {
  --ferias-filial-main: #6b7280;
  --ferias-filial-bg: #f3f4f6;
}

.ferias-more {
  width: 100%;
  min-height: 28px;
  border-color: var(--ferias-border);
  background: #fff;
  color: var(--ferias-muted);
  font-size: 12px;
}

.ferias-day-list {
  display: none;
}

.ferias-list-day {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--ferias-border);
}

.ferias-list-day > strong {
  color: var(--ferias-text);
}

.ferias-list-day > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ferias-empty-state {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 150px;
  padding: 24px;
  color: var(--ferias-muted);
  text-align: center;
}

.ferias-calendar > .ferias-empty-state {
  grid-column: 1 / -1;
}

.ferias-empty-state strong {
  color: var(--ferias-text);
  font-size: 15px;
}

.ferias-side-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.ferias-side-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ferias-upcoming-list {
  display: grid;
  gap: 8px;
}

.ferias-upcoming-section {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ferias-upcoming-section + .ferias-upcoming-section {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--ferias-border);
}

.ferias-upcoming-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ferias-upcoming-section-header small {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--ferias-muted);
  font-size: 11px;
  line-height: 1;
}

.ferias-upcoming-section-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ferias-upcoming-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--ferias-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ferias-text);
  text-align: left;
  cursor: pointer;
}

.ferias-upcoming-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.ferias-upcoming-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
}

.ferias-upcoming-content {
  display: block;
  min-width: 0;
  flex: 1;
}

.ferias-upcoming-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ferias-upcoming-name {
  min-width: 0;
  color: var(--ferias-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ferias-upcoming-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.ferias-upcoming-status.is-andamento {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.ferias-upcoming-status.is-concluida {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
}

.ferias-upcoming-status.is-cancelada {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.ferias-upcoming-meta,
.ferias-upcoming-period {
  display: block;
  min-width: 0;
  margin-top: 4px;
  color: var(--ferias-muted);
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ferias-modal[hidden] {
  display: none;
}

.ferias-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.ferias-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.42);
}

.ferias-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(540px, 100%);
  height: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.ferias-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--ferias-border);
  background: #fff;
}

.ferias-form {
  display: grid;
  grid-template-rows: repeat(4, auto) minmax(0, auto) auto;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 84px;
  background: #fff;
}

.ferias-form-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ferias-form-section legend {
  margin-bottom: 8px;
  color: var(--ferias-text);
  font-size: 13px;
  font-weight: 900;
}

.ferias-form label {
  display: grid;
  gap: 6px;
  color: var(--ferias-muted);
  font-size: 12px;
  font-weight: 800;
}

.ferias-form input,
.ferias-form select,
.ferias-form textarea {
  width: 100%;
  border: 1px solid var(--ferias-border);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ferias-text);
  font: inherit;
}

.ferias-form textarea {
  resize: vertical;
}

.ferias-form .ferias-readonly {
  background: #f3f4f6;
  color: #4b5563;
  cursor: default;
}

.ferias-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ferias-form-spacer {
  flex: 1;
}

.ferias-form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  font-weight: 800;
}

.ferias-form-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--ferias-border);
  background: rgba(255, 255, 255, 0.96);
}

.ferias-form-actions button[type="submit"].ferias-action-primary {
  appearance: none;
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.ferias-form-actions button[type="submit"].ferias-action-primary:hover,
.ferias-form-actions button[type="submit"].ferias-action-primary:focus {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

@media (max-width: 1280px) {
  .ferias-toolbar {
    grid-template-columns: 126px 1fr 1fr minmax(220px, 1.4fr) 150px auto;
  }

  .ferias-calendar-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .ferias-side-panel {
    order: 2;
  }
}

@media (max-width: 900px) {
  .ferias-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .ferias-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ferias-filter-employee,
  .ferias-toolbar .ferias-action-secondary {
    grid-column: 1 / -1;
  }

  .ferias-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ferias-calendar-header {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .ferias-calendar-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .ferias-calendar-weekdays,
  .ferias-filial-legend,
  .ferias-calendar {
    display: none;
  }

  .ferias-day-list {
    display: block;
  }
}

@media (max-width: 560px) {
  .ferias-toolbar,
  .ferias-summary,
  .ferias-form-grid {
    grid-template-columns: 1fr;
  }

  .ferias-drawer {
    width: 100%;
  }

  .ferias-form-actions {
    flex-wrap: wrap;
  }

  .ferias-form-spacer {
    display: none;
  }
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #f2f5f1 0%, #e4ebe2 100%);
  color: #1f2a24;
}

img,
svg,
canvas,
table {
  max-width: 100%;
}

input,
select,
button,
textarea {
  max-width: 100%;
  font: inherit;
}

.fin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
}

.fin-sidebar {
  background: #17322a;
  color: #f4f3ed;
  padding: 24px;
  min-width: 0;
}

.fin-sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.fin-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #f4f3ed;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.fin-sidebar a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.fin-content {
  padding: 24px;
  min-width: 0;
  overflow-x: hidden;
}

.page,
.dashboard-page,
.content,
.main-content {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.fin-header {
  margin-bottom: 20px;
}

.metrics-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.cards-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.cards-grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.metric-card,
.card {
  background: white;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.08);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.metric-card span,
.card-title {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5b6b62;
}

.metric-card strong,
.card-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.card-meta {
  font-size: 13px;
}

.metric-card-wide {
  grid-column: span 2;
}

.resultado-mensal-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.resultado-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  flex-wrap: wrap;
}

.resultado-header-copy h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.resultado-header-copy .note {
  margin: 0;
  max-width: 780px;
}

.resultado-header-form {
  min-width: 220px;
}

.resultado-header-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.resultado-header-form select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #b7c6bb;
  border-radius: 10px;
  background: #fff;
}

.resultado-section {
  margin-top: 24px;
  margin-bottom: 24px;
}

.resultado-card-grid {
  display: grid;
  gap: 16px;
}

.resultado-card-grid-primary {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.resultado-card-grid-secondary {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.resultado-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.08);
  border: 1px solid #e2e9e4;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.resultado-card-primary {
  min-height: 170px;
}

.resultado-card-secondary {
  min-height: 148px;
}

.resultado-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.resultado-card-deltas {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.resultado-card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b6b62;
}

.resultado-card-value {
  font-size: 30px;
  line-height: 1.05;
  color: #17322a;
  overflow-wrap: anywhere;
}

.resultado-card-subtitle {
  font-size: 13px;
  color: #53665b;
  opacity: 0.82;
}

.resultado-card-compare {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-size: 11px;
  color: #7a8a81;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.resultado-delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.resultado-delta-secondary {
  opacity: 0.78;
  transform: scale(0.96);
  transform-origin: right center;
}

.delta-positive {
  background: rgba(32, 125, 80, 0.12);
  color: #1f7a50;
}

.delta-warning {
  background: rgba(180, 126, 24, 0.14);
  color: #9a6a13;
}

.delta-negative {
  background: rgba(170, 55, 55, 0.12);
  color: #9f3434;
}

.resultado-card .resultado-delta:not(.delta-positive):not(.delta-warning):not(.delta-negative) {
  background: #edf2ef;
  color: #53665b;
}

.resultado-card-positive {
  border-color: #d7e7de;
}

.resultado-card-attention {
  border-color: #ecd7b8;
}

.resultado-card-negative {
  border-color: #edd6d6;
}

.resultado-card-neutral {
  border-color: #e2e9e4;
}

.resultado-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
}

.resultado-insight-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid #e2e9e4;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.06);
}

.resultado-insight-card strong {
  display: block;
  margin-bottom: 8px;
}

.resultado-insight-card p {
  margin: 0;
  color: #53665b;
  line-height: 1.45;
}

.resultado-updated {
  font-size: 12px;
  color: #53665b;
  white-space: nowrap;
}

.filters {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.filters label,
.filter-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}

.filters input,
.filters select,
.filters button,
.filter-field input,
.filter-field select {
  padding: 10px 12px;
  border: 1px solid #b7c6bb;
  border-radius: 10px;
  width: 100%;
  min-width: 0;
}

.filters button {
  background: #20483b;
  color: white;
  cursor: pointer;
}

.deep-dive-filters {
  gap: 8px;
  margin-bottom: 10px;
}

.deep-dive-filters-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 158px));
  gap: 8px;
  justify-content: start;
}

.deep-dive-filters .filter-field {
  gap: 4px;
  font-size: 10px;
}

.deep-dive-filters input {
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 11px;
}

.deep-dive-filters .filter-actions {
  margin-top: 0;
}

.deep-dive-filters button {
  min-height: 30px;
  width: auto;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 11px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.filter-actions .action-button,
.filter-actions button {
  min-height: 42px;
}

.settings-card {
  background: white;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.08);
}

.settings-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.settings-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.settings-form > h3,
.settings-form > p,
.settings-form > .note,
.settings-form > .status-text {
  grid-column: 1 / -1;
  margin: 0;
}

.settings-form input,
.settings-form button,
.settings-form select,
.settings-form textarea {
  padding: 10px 12px;
  border: 1px solid #b7c6bb;
  border-radius: 10px;
  width: 100%;
  min-width: 0;
}

.settings-form button {
  background: #20483b;
  color: white;
  cursor: pointer;
}

.import-card {
  margin-bottom: 24px;
  border: 1px solid #dce6df;
}

.import-card h3 {
  margin-top: 0;
}

.importacoes-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.importacoes-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.importacoes-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.importacoes-subtitle {
  color: #5f6f68;
  font-size: 0.95rem;
  margin: 0;
}

.importacoes-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.kpi-label {
  font-size: 0.8rem;
  color: #6b7c74;
}

.kpi-value {
  margin-top: 6px;
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
}

.kpi-value-sm {
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.import-section {
  background: transparent;
}

.redespacho-page {
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

.redespacho-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.redespacho-header h3 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.redespacho-subtitle {
  margin: 0;
  color: #5f6f68;
  font-size: 0.9rem;
  line-height: 1.35;
}

.redespacho-import-button {
  gap: 8px;
  white-space: nowrap;
}

.redespacho-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.redespacho-kpi {
  min-height: 82px;
  padding: 12px 14px;
  border-radius: 12px;
}

.redespacho-kpi .kpi-value {
  margin-top: 5px;
  font-size: 1.28rem;
}

.redespacho-kpi-highlight {
  border-color: #f4c86a;
  background: #fff9eb;
  box-shadow: 0 6px 18px rgba(122, 90, 0, 0.1);
}

.redespacho-filters.panel-card,
.redespacho-table-card.panel-card,
.redespacho-info-state.panel-card {
  margin-bottom: 0;
  border-radius: 13px;
  padding: 14px;
}

.redespacho-filters-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 9px;
}

.redespacho-filters .filter-field {
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #53665b;
}

.redespacho-filters input,
.redespacho-filters select {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.redespacho-filter-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.redespacho-filter-actions .action-button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.redespacho-info-state {
  border: 1px solid #d8e5dd;
  background: #f8fbf9;
}

.redespacho-info-state strong,
.redespacho-info-state p {
  margin: 0;
}

.redespacho-info-state {
  display: grid;
  gap: 4px;
}

.redespacho-section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.redespacho-section-header h4,
.redespacho-section-header p {
  margin: 0;
}

.redespacho-section-header h4 {
  font-size: 1rem;
}

.redespacho-table-wrapper {
  border-radius: 12px;
}

.redespacho-table {
  font-size: 12px;
}

.redespacho-table th,
.redespacho-table td {
  min-width: 112px;
  padding: 10px 12px;
  text-align: left;
}

.redespacho-table th:first-child,
.redespacho-table td:first-child {
  min-width: 118px;
  max-width: 150px;
}

.redespacho-table th button {
  border: 0;
  background: transparent;
  color: #17322a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.redespacho-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.redespacho-status-pendente {
  background: #fff4d6;
  color: #7a5a00;
}

.redespacho-status-recebido {
  background: #e6f4ec;
  color: #176b3a;
}

.redespacho-detail-button {
  min-height: 28px;
  border: 1px solid #c9d7cf;
  border-radius: 8px;
  background: #fff;
  color: #17322a;
  font-weight: 700;
  cursor: pointer;
}

.redespacho-empty {
  padding: 16px 4px 4px;
  font-size: 0.9rem;
}

.redespacho-error {
  color: #a32727;
}

.redespacho-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.redespacho-pagination .action-button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.redespacho-pagination .action-button:disabled,
.redespacho-modal-actions .action-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.redespacho-modal[hidden] {
  display: none;
}

.redespacho-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.redespacho-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.redespacho-modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 680px);
  overflow: auto;
  display: grid;
  gap: 12px;
  border-radius: 14px;
  border: 1px solid #dfe7e2;
  background: #fff;
  padding: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.redespacho-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.redespacho-modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.redespacho-modal-header button {
  width: 34px;
  height: 34px;
  border: 1px solid #d7e1db;
  border-radius: 8px;
  background: #f8fbf9;
  color: #17322a;
  font-size: 1.2rem;
  cursor: pointer;
}

.redespacho-dropzone {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed #9db3a6;
  border-radius: 12px;
  padding: 22px 16px;
  background: #f8fbf9;
  text-align: center;
}

.redespacho-dropzone.is-dragging {
  border-color: #20483b;
  background: #edf4ef;
}

.redespacho-dropzone > span {
  color: #20483b;
  font-size: 1.35rem;
}

.redespacho-dropzone small,
.redespacho-import-note {
  color: #5f6f68;
}

.redespacho-selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dfe7e2;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.redespacho-selected-file[hidden] {
  display: none;
}

.redespacho-selected-file strong,
.redespacho-selected-file span {
  display: block;
  overflow-wrap: anywhere;
}

.redespacho-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.redespacho-detail-panel {
  width: min(620px, 100%);
}

.redespacho-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.redespacho-detail-grid div {
  min-width: 0;
  border: 1px solid #e5ece7;
  border-radius: 10px;
  padding: 10px;
}

.redespacho-detail-grid span {
  display: block;
  color: #6b7c74;
  font-size: 0.74rem;
  font-weight: 700;
}

.redespacho-detail-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .redespacho-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1440px) and (max-height: 900px) {
  .redespacho-page {
    gap: 10px;
    padding-bottom: 12px;
  }

  .redespacho-header {
    align-items: center;
  }

  .redespacho-header h3 {
    font-size: 1.16rem;
  }

  .redespacho-subtitle {
    max-width: 720px;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .redespacho-import-button {
    min-height: 32px;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 0.82rem;
  }

  .redespacho-kpis {
    gap: 8px;
  }

  .redespacho-kpi {
    min-height: 62px;
    padding: 9px 11px;
    border-radius: 10px;
  }

  .redespacho-kpi .kpi-label {
    font-size: 0.72rem;
  }

  .redespacho-kpi .kpi-value {
    margin-top: 3px;
    font-size: 1.05rem;
  }

  .redespacho-filters.panel-card,
  .redespacho-table-card.panel-card,
  .redespacho-info-state.panel-card {
    padding: 10px;
    border-radius: 10px;
  }

  .redespacho-filters-grid {
    grid-template-columns: repeat(6, minmax(94px, 1fr));
    gap: 7px;
  }

  .redespacho-filters .filter-field {
    gap: 3px;
    font-size: 10px;
  }

  .redespacho-filters input,
  .redespacho-filters select {
    min-height: 30px;
    padding: 5px 7px;
    border-radius: 7px;
    font-size: 0.76rem;
  }

  .redespacho-filter-actions {
    margin-top: 8px;
  }

  .redespacho-filter-actions .action-button {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .redespacho-info-state {
    gap: 2px;
    font-size: 0.82rem;
  }

  .redespacho-section-header {
    align-items: center;
    margin-bottom: 8px;
  }

  .redespacho-section-header h4 {
    font-size: 0.92rem;
  }

  .redespacho-section-header .note {
    font-size: 0.76rem;
  }

  .redespacho-table {
    font-size: 11px;
  }

  .redespacho-table th,
  .redespacho-table td {
    min-width: 86px;
    padding: 7px 8px;
  }

  .redespacho-table th:first-child,
  .redespacho-table td:first-child {
    min-width: 96px;
    max-width: 112px;
  }

  .redespacho-table th:nth-child(5),
  .redespacho-table td:nth-child(5) {
    min-width: 160px;
    max-width: 220px;
  }

  .redespacho-table th:nth-child(10),
  .redespacho-table td:nth-child(10) {
    min-width: 96px;
  }

  .redespacho-table th:nth-child(11),
  .redespacho-table td:nth-child(11) {
    min-width: 142px;
    max-width: 180px;
  }

  .redespacho-table th:nth-child(6),
  .redespacho-table td:nth-child(6),
  .redespacho-table th:nth-child(7),
  .redespacho-table td:nth-child(7),
  .redespacho-table th:nth-child(8),
  .redespacho-table td:nth-child(8),
  .redespacho-table th:nth-child(9),
  .redespacho-table td:nth-child(9) {
    display: none;
  }

  .redespacho-status {
    min-height: 21px;
    padding: 2px 7px;
    font-size: 0.66rem;
  }

  .redespacho-detail-button {
    min-height: 25px;
    padding: 3px 7px;
    border-radius: 7px;
    font-size: 0.72rem;
  }

  .redespacho-empty {
    padding: 10px 2px 2px;
    font-size: 0.82rem;
  }

  .redespacho-pagination {
    margin-top: 8px;
  }

  .redespacho-pagination .action-button {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 0.76rem;
  }
}

@media (max-width: 1180px) and (min-width: 761px) {
  .redespacho-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .redespacho-header,
  .redespacho-section-header,
  .redespacho-selected-file,
  .redespacho-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .redespacho-kpis,
  .redespacho-filters-grid,
  .redespacho-detail-grid {
    grid-template-columns: 1fr;
  }

  .redespacho-import-button,
  .redespacho-filter-actions .action-button,
  .redespacho-modal-actions .action-button {
    width: 100%;
  }

  .redespacho-pagination {
    justify-content: space-between;
  }
}

.import-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.import-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.import-card-featured {
  padding: 20px;
}

.import-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.import-card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.import-card-description {
  color: #5f6f68;
  font-size: 0.92rem;
  margin: 0;
}

.import-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  align-items: end;
}

.operational-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.import-card-form {
  display: grid;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #30423a;
}

.field-group input[type="text"],
.field-group input[type="file"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.field-help {
  color: #5f6f68;
  font-size: 0.82rem;
}

.import-preview-form {
  display: grid;
  gap: 14px;
}

.import-actions,
.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions-row {
  align-items: flex-end;
}

.actions-row-stacked {
  flex-direction: column;
}

.actions-row button,
.import-card button {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.details-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(23, 50, 42, 0.14);
  background: #f3f7f4;
  color: #17322a;
}

.import-preview {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.preview-panel {
  margin-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 14px;
}

.preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.preview-item {
  background: #f7faf8;
  border-radius: 10px;
  padding: 10px;
}

.preview-label {
  font-size: 0.75rem;
  color: #65766e;
}

.preview-value {
  margin-top: 4px;
  font-weight: 700;
  display: block;
}

.import-warnings {
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff4e5;
  color: #7a3d0a;
}

.import-warnings ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}

.table-toolbar-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.table-toolbar input,
.table-toolbar select {
  min-height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.table-toolbar input {
  flex: 1 1 280px;
}

.imports-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.imports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.imports-table th {
  background: #eaf2ed;
  text-align: left;
  font-weight: 700;
  padding: 11px 10px;
  white-space: nowrap;
}

.imports-table td {
  padding: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: middle;
}

.imports-table tr:hover td {
  background: #f8fbf9;
}

.truncate-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nowrap-cell {
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: lowercase;
}

.status-success {
  background: #e6f4ec;
  color: #176b3a;
}

.status-error {
  background: #fdeaea;
  color: #a32727;
}

.status-pending {
  background: #fff4d6;
  color: #7a5a00;
}

.history-details-row td {
  background: #fbfdfc;
}

.history-details-panel {
  display: grid;
  gap: 12px;
}

.history-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  font-size: 0.88rem;
}

.history-error-box {
  padding: 12px;
  border-radius: 12px;
  background: #fff6f6;
  border: 1px solid #f2d4d4;
}

.history-error-box p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.tech-routes-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.tech-routes-card summary {
  cursor: pointer;
  font-weight: 700;
  color: #17322a;
  margin-bottom: 12px;
}

.settings-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 42px;
  border-radius: 10px;
  background: #20483b;
  color: white;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
}

.action-button-secondary {
  background: #dbe7e0;
  color: #17322a;
}

.table-wrap,
.table-wrapper,
.dre-table-wrapper,
.veiculos-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap table,
.table-wrapper table {
  min-width: 900px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5ece7;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #edf4ef;
  position: sticky;
  top: 0;
}

.empty-state,
.note,
.todo-note,
.pagination {
  color: #4f6157;
}

.status-card {
  padding: 14px 18px;
}

.status-text {
  margin: 0;
  color: #20483b;
  font-weight: 600;
}

.status-error {
  color: #9f2f2f;
}

.vehicle-form {
  width: 100%;
}

.vehicle-form input,
.vehicle-form button {
  padding: 10px 12px;
  border: 1px solid #b7c6bb;
  border-radius: 10px;
}

.vehicle-form button {
  background: #20483b;
  color: white;
  cursor: pointer;
}

.veiculos-table-wrap {
  background: #fff;
  border: 1px solid #e3ebe6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.veiculos-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.veiculos-table thead th {
  background: #eef7f2;
  color: #071f18;
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #dbe7df;
  position: static;
}

.veiculos-table tbody td {
  padding: 10px;
  border-bottom: 1px solid #edf2ef;
  vertical-align: middle;
}

.veiculos-table tbody tr:hover {
  background: #fbfdfc;
}

.veiculos-table tbody tr:last-child td {
  border-bottom: none;
}

.veiculos-table .col-placa {
  width: 150px;
}

.veiculos-table .col-id {
  width: 160px;
}

.veiculos-table .col-tipo {
  width: 130px;
}

.veiculos-table .col-filial {
  width: 220px;
}

.veiculos-table .col-select {
  width: 44px;
}

.veiculos-table .col-acoes {
  width: 210px;
  text-align: right;
}

.vehicle-cell-input {
  width: 100%;
  height: 36px;
  border: 1px solid #b9c9c0;
  border-radius: 10px;
  padding: 0 11px;
  font-size: 14px;
  color: #1f2a24;
  background: #fff;
  box-sizing: border-box;
}

.vehicle-cell-input:focus {
  outline: none;
  border-color: #1f513f;
  box-shadow: 0 0 0 3px rgba(31, 81, 63, 0.12);
}

.vehicle-plate-input {
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.vehicle-id-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vehicle-id-missing {
  border-color: #e0a800;
  background: #fffaf0;
}

.vehicle-badge-warning {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff4d6;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.vehicle-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-save-vehicle,
.btn-delete-vehicle {
  height: 36px;
  min-width: 78px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-save-vehicle {
  background: #1f513f;
  color: #fff;
}

.btn-save-vehicle:hover {
  background: #173f31;
}

.btn-delete-vehicle {
  background: #fde8e8;
  color: #991b1b;
  border-color: #f5c2c2;
}

.btn-delete-vehicle:hover {
  background: #fbd5d5;
}

.vehicle-row-hidden-form {
  display: none;
}

.dre-table-wrapper {
  overflow-y: visible;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dre-table-wrapper::-webkit-scrollbar {
  height: 10px;
}

.dre-table-wrapper::-webkit-scrollbar-track {
  background: #eef3ef;
  border-radius: 999px;
}

.dre-table-wrapper::-webkit-scrollbar-thumb {
  background: #b8c9bf;
  border-radius: 999px;
}

.dre-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #8faa9a;
}

.dre-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  --dre-header-bg: #dde9e4;
  --dre-row-hover-bg: #eef5f1;
  --dre-highlight-bg: #eaf3ee;
}

.dre-table th,
.dre-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #dfe7e2;
  white-space: nowrap;
  text-align: right;
  min-width: 135px;
}

.dre-table th:first-child,
.dre-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 260px;
  max-width: 320px;
  text-align: left;
  font-weight: 700;
  background: inherit;
}

.dre-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--dre-header-bg);
  font-weight: 800;
}

.dre-table thead th:first-child {
  z-index: 4;
  background: var(--dre-header-bg);
}

@media (max-width: 980px) {
  .fin-shell {
    grid-template-columns: 1fr;
  }

  .veiculos-table-wrap {
    border-radius: 16px;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .veiculos-table,
  .veiculos-table thead,
  .veiculos-table tbody,
  .veiculos-table th,
  .veiculos-table td,
  .veiculos-table tr {
    display: block;
  }

  .veiculos-table thead {
    display: none;
  }

  .veiculos-table tbody {
    display: grid;
    gap: 12px;
  }

  .veiculos-table tbody tr {
    background: #fff;
    border: 1px solid #e5eee8;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }

  .veiculos-table tbody td {
    border-bottom: none;
    padding: 6px 0;
  }

  .veiculos-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #5c6f66;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .veiculos-table .col-placa,
  .veiculos-table .col-id,
  .veiculos-table .col-tipo,
  .veiculos-table .col-filial,
  .veiculos-table .col-select,
  .veiculos-table .col-acoes {
    width: auto;
    text-align: left;
  }

  .veiculos-table .col-placa .vehicle-cell-input {
    font-size: 16px;
    font-weight: 700;
  }

  .vehicle-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .btn-save-vehicle,
  .btn-delete-vehicle {
    flex: 1;
  }
}

.dre-table tbody tr {
  background: #fff;
}

.dre-table tbody tr th,
.dre-table tbody tr td {
  background: inherit;
}

.dre-table tbody tr:hover {
  background: var(--dre-row-hover-bg);
}

.dre-table .linha-total,
.dre-table .linha-resultado {
  background: var(--dre-highlight-bg);
}

.dre-table .linha-total td,
.dre-table .linha-total th,
.dre-table .linha-resultado td,
.dre-table .linha-resultado th {
  font-weight: 800;
}

.dre-table .linha-receita-bruta td,
.dre-table .linha-receita-bruta th {
  font-weight: 800;
}

.dre-table .linha-despesa td,
.dre-table .linha-despesa th {
  font-weight: 400;
}

.dre-table .linha-percentual td,
.dre-table .linha-percentual th {
  font-size: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.gerencial-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.08);
}

.gerencial-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
}

.gerencial-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #12372f;
  white-space: nowrap;
}

.gerencial-select {
  min-width: 280px;
  max-width: 360px;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(18, 55, 47, 0.22);
  border-radius: 12px;
  background: #fff;
  color: #0f2f28;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

.gerencial-select:focus {
  border-color: #1f513f;
  box-shadow: 0 0 0 3px rgba(31, 81, 63, 0.12);
}

.gerencial-help {
  font-size: 13px;
  color: #4d675e;
  line-height: 1.4;
  flex: 1 1 320px;
  min-width: 0;
}

.dre-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dre-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  padding: 0;
  width: 18px;
  color: inherit;
  flex: 0 0 18px;
}

.dre-toggle-spacer {
  display: inline-block;
  width: 18px;
  flex: 0 0 18px;
}

.filial-dre-table thead .is-selected,
.filial-dre-table tbody .is-selected {
  background: #dcece3;
}

.filial-dre-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 12.5px;
}

.filial-dre-table .dre-label-wrap {
  font-size: 11.5px;
}

.filial-dre-table th,
.filial-dre-table td {
  padding: 8px 10px;
  line-height: 1.25;
  white-space: nowrap;
}

.filial-dre-table th:first-child,
.filial-dre-table td:first-child {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  text-align: left;
}

.filial-dre-table th:not(:first-child),
.filial-dre-table td:not(:first-child) {
  width: 115px;
  min-width: 105px;
  max-width: 125px;
  text-align: center;
}

.filial-dre-table thead th:not(:first-child) {
  text-align: center;
}

.filial-dre-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1366px) {
  .filial-dre-table {
    font-size: 12px;
  }

  .filial-dre-table .dre-label-wrap {
    font-size: 11px;
  }

  .filial-dre-table th,
  .filial-dre-table td {
    padding: 7px 8px;
  }

  .filial-dre-table th:first-child,
  .filial-dre-table td:first-child {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }

  .filial-dre-table th:not(:first-child),
  .filial-dre-table td:not(:first-child) {
    width: 100px;
    min-width: 95px;
    max-width: 110px;
  }
}

.dre-row.is-hidden {
  display: none;
}

.dre-drill-table .dre-child td,
.dre-drill-table .dre-child th {
  background: #fbfdfb;
  font-size: 13px;
}

.dre-drill-table .dre-level-1 th:first-child,
.dre-drill-table .dre-level-1 td:first-child {
  padding-left: 34px;
  font-weight: 600;
}

.dre-drill-table .dre-level-2 th:first-child,
.dre-drill-table .dre-level-2 td:first-child {
  padding-left: 62px;
  font-weight: 400;
  color: #334155;
}

.dre-drill-table .dre-level-3 th:first-child,
.dre-drill-table .dre-level-3 td:first-child {
  padding-left: 90px;
  font-weight: 400;
  color: #475569;
}

.dre-drill-table .dre-level-4 th:first-child,
.dre-drill-table .dre-level-4 td:first-child {
  padding-left: 118px;
  font-weight: 400;
  color: #64748b;
}

.dre-drill-table .dre-parent th:first-child,
.dre-drill-table .dre-parent td:first-child {
  font-weight: 800;
}

.dre-drill-table .dre-child:hover td,
.dre-drill-table .dre-child:hover th {
  background: #f2f7f4;
}

.frota-table th:first-child,
.frota-table td:first-child {
  text-align: left;
  min-width: 280px;
}

.frota-table td:not(:first-child),
.frota-table th:not(:first-child) {
  text-align: center;
  min-width: 130px;
}

.frota-parent th,
.frota-parent td {
  font-weight: 800;
}

.frota-child td,
.frota-child th {
  background: #fbfdfb;
}

.frota-label-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.frota-label {
  line-height: 1.2;
}

.frota-meta {
  font-size: 12px;
  font-weight: 400;
  color: #5b6b62;
}

.frota-module {
  display: grid;
  gap: 14px;
}

.frota-filter-bar {
  margin-bottom: 0;
}

.frota-filters-grid {
  grid-template-columns: repeat(9, minmax(120px, 1fr));
  gap: 8px;
}

.frota-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid #d8e3dc;
}

.frota-tabs a {
  color: #244438;
  text-decoration: none;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-bottom: 0;
  font-weight: 700;
  white-space: nowrap;
}

.frota-tabs a.is-active {
  background: #fff;
  border-color: #d8e3dc;
  color: #113d2f;
}

.frota-kpi-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.frota-overview-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: start;
}

.frota-report-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.frota-alert-list,
.frota-source-list,
.frota-vehicle-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.frota-source-list {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #53645b;
  margin-top: 10px;
}

.frota-text-cell {
  min-width: 260px;
  max-width: 360px;
  white-space: normal;
}

.frota-table-wrap {
  max-height: calc(100vh - 285px);
  overflow: auto;
}

.frota-classification-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.frota-classify-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 35, 28, 0.34);
  display: none;
  justify-content: flex-end;
  z-index: 80;
}

.frota-classify-panel.is-open {
  display: flex;
}

.frota-panel-card {
  width: min(1050px, 92vw);
  height: 100%;
  background: #fff;
  box-shadow: -18px 0 42px rgba(15, 35, 27, 0.22);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  transform: translateX(18px);
  animation: frota-drawer-in 160ms ease-out forwards;
}

@keyframes frota-drawer-in {
  from {
    opacity: 0.92;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

body.frota-panel-open {
  overflow: hidden;
}

.frota-panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 16px;
  border-bottom: 1px solid #dbe5e0;
  background: #fff;
}

.frota-panel-header h3 {
  margin: 0;
  color: #17322a;
  font-size: 20px;
  line-height: 1.2;
}

.frota-panel-header p,
.frota-allocation-bar p {
  margin: 4px 0 0;
  color: #63746b;
  font-size: 13px;
}

.frota-panel-close {
  width: 36px;
  height: 36px;
  border: 1px solid #dbe5e0;
  border-radius: 8px;
  background: #f7faf8;
  color: #244438;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.frota-panel-close:hover {
  background: #edf4ef;
}

.frota-panel-body {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 16px 22px 20px;
  overflow-y: auto;
  background: #f5f8f6;
}

.frota-panel-summary {
  display: block;
}

.frota-expense-card {
  padding: 14px;
  border: 1px solid #cfe0d7;
  border-radius: 12px;
  background: #f2faf5;
  box-shadow: 0 1px 2px rgba(15, 35, 27, 0.04);
}

.frota-expense-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: start;
}

.frota-expense-badge {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dff0e7;
  color: #176b4d;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.frota-expense-main h4 {
  margin: 0;
  color: #17322a;
  font-size: 16px;
  line-height: 1.3;
}

.frota-expense-main p {
  margin: 5px 0 0;
  color: #415148;
  font-size: 13px;
  line-height: 1.45;
}

.frota-expense-main > strong {
  color: #17322a;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.frota-expense-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  color: #53645b;
  font-size: 12px;
}

.frota-panel-totals {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe5e0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 35, 27, 0.04);
}

.frota-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.frota-total-grid > div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #f7faf8;
}

.frota-total-grid span {
  display: block;
  color: #66776f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.frota-total-grid strong {
  display: block;
  margin-top: 4px;
  color: #17322a;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.frota-total-balance strong {
  font-size: 17px;
}

.frota-panel-totals.is-zero .frota-total-balance {
  background: #e6f5ec;
}

.frota-panel-totals.is-zero .frota-total-balance strong {
  color: #176b4d;
}

.frota-panel-totals.is-open .frota-total-balance {
  background: #fff5d9;
}

.frota-panel-totals.is-open .frota-total-balance strong {
  color: #775400;
}

.frota-panel-totals.is-negative .frota-total-balance {
  background: #fde2e2;
}

.frota-panel-totals.is-negative .frota-total-balance strong {
  color: #8a1f1f;
}

.frota-total-progress {
  display: grid;
  gap: 5px;
}

.frota-total-progress > div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8e2;
}

.frota-total-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #176b4d;
}

.frota-panel-totals.is-negative .frota-total-progress span {
  background: #b43a3a;
}

.frota-total-progress p {
  margin: 0;
  color: #66776f;
  font-size: 12px;
}

.frota-allocation-lines {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: visible;
}

.frota-allocation-line {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e3dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 35, 27, 0.05);
}

.frota-allocation-card-header,
.frota-allocation-card-header > div,
.frota-allocation-bar,
.frota-allocation-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.frota-allocation-card-header,
.frota-allocation-bar {
  justify-content: space-between;
}

.frota-allocation-section {
  display: grid;
  gap: 12px;
}

.frota-allocation-bar h4 {
  margin: 0;
  color: #17322a;
  font-size: 16px;
}

.frota-allocation-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.frota-allocation-toolbar .action-button,
.frota-panel-footer .action-button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.frota-allocation-card-header strong {
  color: #17322a;
  font-size: 14px;
}

.frota-allocation-value {
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4ef;
  color: #17322a;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.frota-allocation-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.frota-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #53645b;
  font-size: 12px;
  font-weight: 800;
}

.frota-field > span {
  overflow-wrap: anywhere;
}

.frota-field-hidden {
  display: none;
}

.frota-span-2 {
  grid-column: span 2;
}

.frota-span-4 {
  grid-column: span 4;
}

.frota-span-full {
  grid-column: 1 / -1;
}

.frota-allocation-line input,
.frota-allocation-line select {
  min-width: 0;
  width: 100%;
  height: 40px;
  border: 1px solid #d8e3dc;
  border-radius: 8px;
  background: #fff;
  color: #17322a;
  font: inherit;
  font-weight: 600;
  padding: 8px 10px;
}

.frota-allocation-line input:focus,
.frota-allocation-line select:focus,
.frota-panel-close:focus,
.frota-classify-panel .action-button:focus {
  outline: 2px solid rgba(23, 107, 77, 0.28);
  outline-offset: 2px;
}

.frota-money-input {
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid #d8e3dc;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.frota-money-input > span {
  flex: 0 0 auto;
  padding-left: 10px;
  color: #66776f;
  font-size: 12px;
  font-weight: 900;
}

.frota-money-input input {
  height: 38px;
  border: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.frota-value-main .frota-money-input {
  border-color: #9fcab8;
  background: #f7fcf9;
}

.frota-value-main input {
  color: #17322a;
  font-weight: 900;
}

.frota-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid #dbe5e0;
  background: #fff;
}

.frota-panel-save-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.frota-classify-panel .action-button {
  border: 1px solid #176b4d;
  background: #176b4d;
  color: #fff;
}

.frota-classify-panel .action-button:hover {
  background: #11583f;
}

.frota-classify-panel .action-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.frota-classify-panel .action-button-secondary {
  border-color: #d8e3dc;
  background: #fff;
  color: #244438;
}

.frota-classify-panel .action-button-secondary:hover {
  background: #f2f7f4;
}

.frota-panel-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cfe0d7;
  background: #eaf7ef;
  color: #17322a;
}

.frota-panel-message > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #176b4d;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.frota-panel-message p {
  margin: 1px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.frota-panel-message.is-error {
  border-color: #f1b8b8;
  background: #fdeaea;
  color: #8a1f1f;
}

.frota-panel-message.is-error > span {
  background: #b43a3a;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf4ef;
  color: #244438;
  font-size: 12px;
  font-weight: 800;
}

.status-warning {
  background: #fff3cd;
  color: #775400;
}

.status-danger,
.status-error {
  background: #fde2e2;
  color: #8a1f1f;
}

.frota-classify-panel .action-button-danger {
  border-color: #f1b8b8;
  background: #fde2e2;
  color: #8a1f1f;
}

.frota-classify-panel .action-button-danger:hover {
  background: #f8caca;
}

@media (max-width: 1099px) {
  .frota-panel-card {
    width: min(1050px, 95vw);
  }

  .frota-allocation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frota-span-2,
  .frota-span-4,
  .frota-span-full {
    grid-column: 1 / -1;
  }

  .frota-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .frota-panel-card {
    width: 100vw;
  }

  .frota-panel-header,
  .frota-panel-body,
  .frota-panel-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .frota-panel-header h3 {
    font-size: 18px;
  }

  .frota-expense-main {
    grid-template-columns: 1fr;
  }

  .frota-expense-main > strong {
    font-size: 19px;
  }

  .frota-allocation-bar,
  .frota-panel-footer,
  .frota-panel-save-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .frota-allocation-toolbar {
    justify-content: stretch;
  }

  .frota-allocation-toolbar .action-button,
  .frota-panel-footer .action-button {
    width: 100%;
  }

  .frota-allocation-grid,
  .frota-total-grid {
    grid-template-columns: 1fr;
  }

  .frota-allocation-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .frota-allocation-card-header > div {
    width: 100%;
    justify-content: space-between;
  }
}

.is-hidden {
  display: none !important;
}

.dre-matrix-table th:first-child,
.dre-matrix-table td:first-child {
  position: sticky;
  left: 0;
}

.dre-matrix-table thead th:first-child,
.dre-matrix-table tbody th {
  background: #edf4ef;
}

.dre-matrix-table tbody th {
  text-align: left;
  min-width: 240px;
}

.dre-matrix-table td {
  text-align: right;
  min-width: 120px;
}

.generic-table-mobile td,
.generic-table-mobile th {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .fin-shell {
    grid-template-columns: 1fr;
  }

  .resultado-header {
    flex-direction: column;
    align-items: stretch;
  }

  .resultado-header-form {
    min-width: 0;
  }

  .resultado-card-grid-primary,
  .resultado-card-grid-secondary,
  .resultado-insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 680px) {
  .resultado-card-top,
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .resultado-card-deltas {
    justify-items: start;
  }

  .resultado-card-compare {
    justify-content: flex-start;
  }

  .resultado-delta,
  .resultado-updated {
    white-space: normal;
  }

  .resultado-card-value {
    font-size: 26px;
  }
}

@media (max-width: 520px) {
  .resultado-card-grid-primary,
  .resultado-card-grid-secondary,
  .resultado-insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1440px) {
  .fin-shell {
    grid-template-columns: 248px 1fr;
  }

  .fin-sidebar,
  .fin-content {
    padding: 20px;
  }

  .dre-table th:first-child,
  .dre-table td:first-child {
    min-width: 220px;
    max-width: 280px;
  }
}

@media (max-width: 1024px) {
  .fin-shell {
    grid-template-columns: 1fr;
  }

  .fin-sidebar {
    padding-bottom: 18px;
  }

  .fin-sidebar nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .fin-content {
    padding: 18px;
  }

  .resultado-insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dre-table th,
  .dre-table td {
    padding: 11px 12px;
    min-width: 120px;
  }

  .dre-table th:first-child,
  .dre-table td:first-child {
    min-width: 200px;
    max-width: 240px;
  }
}

@media (max-width: 760px) {
  .fin-sidebar {
    position: static;
  }

  .fin-sidebar nav {
    grid-template-columns: 1fr 1fr;
  }

  .todo-note {
    display: none;
  }

  .filters-grid,
  .settings-form,
  .combustivel-filters .filtros-grid,
  .clientes-kpi-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions button,
  .filter-actions .action-button,
  .settings-actions .action-button,
  .settings-actions button,
  .section-actions .action-button,
  .section-actions button {
    width: 100%;
  }

  .table-wrap table,
  .table-wrapper table {
    min-width: 760px;
  }

  .generic-table-mobile table,
  .generic-table-mobile thead,
  .generic-table-mobile tbody,
  .generic-table-mobile th,
  .generic-table-mobile td,
  .generic-table-mobile tr {
    display: block;
  }

  .generic-table-mobile table {
    min-width: 0;
  }

  .generic-table-mobile thead {
    display: none;
  }

  .generic-table-mobile tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .generic-table-mobile tbody tr {
    border: 1px solid #e3ebe6;
    border-radius: 14px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }

  .generic-table-mobile tbody td,
  .generic-table-mobile tbody th {
    border-bottom: none;
    padding: 6px 0;
    white-space: normal;
    text-align: left;
  }

  .generic-table-mobile tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #5c6f66;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .dre-table th:first-child,
  .dre-table td:first-child {
    position: static;
    left: auto;
    min-width: 180px;
    max-width: none;
  }

  .dre-table th,
  .dre-table td {
    min-width: 110px;
  }

  .dre-table thead th {
    position: static;
  }

  .dre-matrix-table th:first-child,
  .dre-matrix-table td:first-child {
    position: static;
    left: auto;
  }

  .resultado-delta,
  .resultado-updated,
  .cliente-receita,
  .mini-chart-value,
  .legend-meta {
    white-space: normal;
  }

  .vehicle-actions {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .fin-sidebar nav {
    grid-template-columns: 1fr;
  }

  .fin-content,
  .fin-sidebar {
    padding: 14px;
  }

  .metric-card,
  .card,
  .panel-card,
  .settings-card {
    padding: 14px;
  }

  .metric-card strong,
  .card-value,
  .resultado-card-value,
  .kpi-value {
    font-size: clamp(20px, 7vw, 26px);
  }

  th,
  td {
    padding: 10px 8px;
  }
}

.panel-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.08);
}

.page-combustivel {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.page-combustivel .panel-card,
.page-combustivel .metric-card {
  max-width: 100%;
}

.page-combustivel .kpi-title {
  font-size: 10px;
}

.page-combustivel .kpi-value {
  font-size: 26px;
}

.clientes-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.clientes-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.clientes-header-copy h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.clientes-filtros {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.clientes-filtros label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}

.clientes-filtros input,
.clientes-filtros select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #b7c6bb;
  border-radius: 10px;
  background: #fff;
}

.clientes-filtros button,
.clientes-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #1f513f;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.clientes-filtros button:hover,
.clientes-tab:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.clientes-filter-card {
  padding: 12px 14px;
}

.clientes-filter-card .clientes-header-copy {
  margin-bottom: 8px;
}

.clientes-filter-card .clientes-header-copy .note {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.clientes-filter-card .clientes-filtros {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.8fr)
    minmax(170px, 0.9fr)
    minmax(112px, 0.55fr)
    minmax(310px, 1.7fr)
    auto;
  gap: 8px;
  align-items: end;
  width: 100%;
}

.clientes-filter-card .clientes-filtros label {
  gap: 4px;
  font-size: 12px;
  line-height: 1.2;
}

.clientes-filter-card .clientes-filtros input,
.clientes-filter-card .clientes-filtros select,
.clientes-filter-card .clientes-filtros button,
.clientes-clear-filters {
  height: 38px;
  box-sizing: border-box;
}

.clientes-filter-card .clientes-filtros input,
.clientes-filter-card .clientes-filtros select {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.clientes-filter-search input {
  min-width: 280px;
}

.clientes-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  white-space: nowrap;
}

.clientes-filter-card .clientes-filtros button {
  border: 1px solid #1f513f;
  border-radius: 8px;
  padding: 0 14px;
  background: #f7fbf8;
  color: #1f513f;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.clientes-clear-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: #60756b;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.clientes-clear-filters:hover {
  color: #1f513f;
  text-decoration: underline;
}

.clientes-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.clientes-summary-section {
  margin-bottom: 28px;
}

.clientes-summary-section .section-header {
  margin-bottom: 0;
}

.clientes-summary-section .section-header h3,
.quick-filters .section-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  color: #14352e;
}

.clientes-summary-section .section-header .note,
.quick-filters .section-header .note {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  color: #66736f;
}

.summary-card {
  min-height: 112px;
  height: 112px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(12, 61, 53, 0.08);
  box-shadow: 0 4px 14px rgba(20, 45, 38, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.summary-card-label,
.summary-card .kpi-title {
  font-size: 10px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #687771;
}

.summary-card-value,
.summary-card .kpi-value {
  margin-top: 7px;
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  color: #092f2b;
  white-space: nowrap;
}

.summary-card-description,
.summary-card .clientes-kpi-subtitle {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.25;
  color: #66736f;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.clientes-kpi-subtitle {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #5b6b62;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.clientes-tabs {
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.clientes-tab {
  background: #edf3ef;
  color: #1f513f;
  min-height: 38px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.clientes-tab.is-active {
  background: #1f513f;
  color: #fff;
}

.quick-filters {
  min-height: 112px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(12, 61, 53, 0.08);
  box-shadow: 0 4px 14px rgba(20, 45, 38, 0.05);
  margin-bottom: 18px;
}

.quick-filters-header {
  min-height: 78px;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.quick-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .summary-grid,
  .clientes-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card-value,
  .summary-card .kpi-value {
    font-size: 23px;
  }

  .quick-filters-header {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .clientes-tabs,
  .quick-filter-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .summary-grid,
  .clientes-kpi-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    height: 100px;
    min-height: 100px;
  }

  .summary-card-value,
  .summary-card .kpi-value {
    font-size: 20px;
  }

  .quick-filters {
    display: block;
    min-height: 0;
  }

  .quick-filters-header {
    display: block;
    min-height: 0;
  }

  .quick-filter-buttons {
    margin-top: 14px;
  }
}

.clientes-ranking {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.clientes-ranking-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.clientes-ranking-meta span {
  border-radius: 999px;
  padding: 6px 10px;
  background: #edf3ef;
  color: #41554a;
  font-size: 12px;
  font-weight: 700;
}

.cliente-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--shadow-card, 0 6px 18px rgba(0, 0, 0, 0.05));
  border: 1px solid #e2e9e4;
  overflow: hidden;
  box-sizing: border-box;
}

.cliente-card:has(.cliente-card-details[open]) {
  border-color: #b8d0c2;
}

.cliente-card summary {
  list-style: none;
}

.cliente-card summary::-webkit-details-marker {
  display: none;
}

.cliente-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 40px;
  gap: 14px;
  align-items: center;
  min-height: 70px;
  padding: 12px 16px;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
}

.cliente-card-top:hover {
  background: #f7faf8;
}

.cliente-nome-wrap,
.cliente-conteudo {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.cliente-rank,
.cliente-ranking {
  font-size: 11px;
  line-height: 1;
  color: #68736f;
  font-weight: 600;
  opacity: 1;
}

.cliente-nome {
  margin-top: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cliente-top-summary,
.cliente-indicadores {
  width: 170px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.cliente-receita,
.cliente-valor {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
  color: #092f2b;
}

.cliente-participacao,
.cliente-percentual {
  font-size: 12px;
  line-height: 1.1;
  color: #66736f;
  white-space: nowrap;
}

.cliente-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 16px 14px;
}

.cliente-ctrcs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #bcd8cd;
  background: #e8f3ee;
  color: #145c49;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.cliente-ctrcs-button:hover {
  background: #dcece5;
  border-color: #9fc9b9;
  color: #145c49;
  box-shadow: 0 4px 10px rgba(20, 92, 73, 0.14);
  transform: translateY(-1px);
  text-decoration: none;
}

.cliente-minimos-button {
  background: #fff7e8;
  border-color: #e0c891;
  color: #73530f;
}

.cliente-minimos-button:hover {
  background: #f7ebcf;
  border-color: #c9ac63;
  color: #73530f;
  box-shadow: 0 4px 10px rgba(115, 83, 15, 0.14);
}

.cliente-details-button {
  background: #edf1ff;
  border-color: #b9c6ef;
  color: #2f477f;
}

.cliente-details-button:hover {
  background: #e2e8fb;
  border-color: #98aadd;
  color: #2f477f;
  box-shadow: 0 4px 10px rgba(47, 71, 127, 0.14);
}

.cliente-ctrcs-button:focus-visible {
  outline: 3px solid rgba(20, 92, 73, 0.35);
  outline-offset: 2px;
}

.cliente-ctrcs-button-icon,
.cliente-ctrcs-button-arrow {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.cliente-ctrcs-button-arrow {
  opacity: 0.72;
}

.cliente-expand-icon,
.cliente-acao {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  background: #edf3ef;
  position: relative;
  box-sizing: border-box;
}

.cliente-expand-icon::before,
.cliente-expand-icon::after {
  content: "";
  position: absolute;
  background: #1f513f;
  border-radius: 2px;
  left: 8px;
  right: 8px;
  top: 13px;
  height: 2px;
}

.cliente-expand-icon::after {
  left: 13px;
  right: auto;
  top: 8px;
  width: 2px;
  height: 12px;
}

.cliente-card-details[open] .cliente-expand-icon::after {
  display: none;
}

.cliente-card-expanded {
  padding: 0 16px 14px;
  border-top: 1px solid #eef3ef;
}

@media (max-width: 700px) {
  .cliente-card-top {
    grid-template-columns: minmax(0, 1fr) 96px 34px;
    gap: 8px;
    min-height: 70px;
    padding: 12px;
  }

  .cliente-top-summary,
  .cliente-indicadores {
    width: 96px;
    align-items: flex-end;
  }

  .cliente-nome {
    font-size: 13px;
  }

  .cliente-receita,
  .cliente-valor {
    font-size: 16px;
  }

  .cliente-participacao,
  .cliente-percentual {
    font-size: 11px;
  }
}

@media (max-width: 1180px) {
  .cliente-operational-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cliente-operational-item:nth-child(4n) {
    border-right: 0;
  }

  .cliente-minimum-row {
    grid-template-columns: minmax(118px, 1fr) minmax(86px, 0.75fr) minmax(86px, 0.75fr) minmax(86px, 0.75fr);
  }
}

@media (max-width: 760px) {
  .cliente-operational-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cliente-operational-item {
    border-right: 1px solid #e8eee9;
    border-bottom: 1px solid #e8eee9;
  }

  .cliente-operational-item:nth-child(2n) {
    border-right: 0;
  }

  .cliente-minimum-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 10px;
  }

  .cliente-minimum-head {
    display: none;
  }

  .cliente-minimum-row span:not(.cliente-minimum-metric),
  .cliente-minimum-row strong {
    text-align: left;
  }

  .cliente-minimum-metric {
    grid-column: 1 / -1;
  }

  .cliente-minimum-row strong:nth-child(2)::before {
    content: "Realizado: ";
    color: #66736f;
    font-size: 11px;
    font-weight: 700;
  }

  .cliente-minimum-row strong:nth-child(3)::before {
    content: "Mínimo: ";
    color: #66736f;
    font-size: 11px;
    font-weight: 700;
  }

  .cliente-minimum-row strong:nth-child(4)::before {
    content: "Alvo: ";
    color: #66736f;
    font-size: 11px;
    font-weight: 700;
  }

  .cliente-card-actions {
    margin: 0 12px 12px;
  }
}

.cliente-metricas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.cliente-metrica-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.cliente-metrica-valor {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.cliente-metrica-minimo {
  margin-top: 3px;
  font-size: 12px;
  color: #66736f;
  font-weight: 600;
}

.cliente-operational-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid #e8eee9;
  border-bottom: 1px solid #e8eee9;
}

.cliente-operational-item {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid #e8eee9;
}

.cliente-operational-item:last-child {
  border-right: 0;
}

.cliente-operational-item span,
.cliente-complementary-strip span {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: #66736f;
  font-weight: 600;
}

.cliente-operational-item strong,
.cliente-complementary-strip strong {
  display: block;
  margin-top: 4px;
  color: #1f2a24;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.cliente-minimum-comparison {
  margin-top: 14px;
  border: 1px solid #e0e8e2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.cliente-minimum-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.05fr) minmax(98px, 0.82fr) minmax(98px, 0.82fr) minmax(98px, 0.82fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-top: 1px solid #edf2ee;
}

.cliente-minimum-row:first-child {
  border-top: 0;
}

.cliente-minimum-head {
  background: #f7faf8;
  color: #5d6b64;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cliente-minimum-row strong,
.cliente-minimum-row span {
  min-width: 0;
}

.cliente-minimum-row strong {
  text-align: center;
  color: #16251f;
  font-size: 14px;
  line-height: 1.2;
}

.cliente-minimum-row span:not(.cliente-minimum-metric) {
  text-align: center;
}

.cliente-minimum-head span:first-child {
  text-align: left;
}

.cliente-minimum-metric {
  color: #22342d;
  font-weight: 800;
}

.cliente-minimum-diff {
  color: #4f5e57;
  font-size: 13px;
  font-weight: 800;
}

.cliente-minimum-row.below {
  background: #fff7f7;
}

.cliente-minimum-row.below .cliente-minimum-diff,
.cliente-minimum-row.below .cliente-minimum-metric {
  color: #9f3434;
}

.cliente-minimum-row.ok .cliente-minimum-diff {
  color: #187e52;
}

.cliente-minimum-row.undefined .cliente-minimum-diff {
  color: #6f766f;
}

.cliente-complementary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8eee9;
}

.cliente-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cliente-badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(21, 81, 64, 0.1);
  color: #155140;
}

.cliente-badge.warning {
  background: rgba(180, 126, 24, 0.14);
  color: #9a6a13;
}

.cliente-badge.danger {
  background: rgba(170, 55, 55, 0.12);
  color: #9f3434;
}

.cliente-badge.success {
  background: rgba(24, 126, 82, 0.12);
  color: #187e52;
}

.cliente-minimo-resumo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.2;
  color: #65736d;
}

.cliente-minimo-resumo strong {
  color: #1f2a24;
}

.cliente-minimo-resumo small {
  flex-basis: 100%;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cliente-minimo-resumo.abaixo {
  color: #9f3434;
}

.cliente-minimo-resumo.acima {
  color: #187e52;
}

.cliente-minimo-resumo span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f4f7f5;
  color: #65736d;
  font-weight: 800;
}

.cliente-minimo-resumo.abaixo span {
  background: #fff1f1;
  color: #9f3434;
}

.cliente-minimo-resumo.acima span {
  background: #eef8f1;
  color: #187e52;
}

.cliente-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e6ece7;
}

.cliente-detail-item {
  min-width: 0;
}

.cliente-detail-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5b6b62;
}

.cliente-detail-value {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #1f2a24;
  overflow-wrap: anywhere;
}

.clientes-empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.rotas-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.rotas-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.rotas-header-copy h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.rotas-filtros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  width: min(100%, 940px);
}

.rotas-filtros label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}

.rotas-filtros input,
.rotas-filtros select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #b7c6bb;
  border-radius: 10px;
  background: #fff;
}

.rotas-filtros button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #1f513f;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.rotas-filtros button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.rotas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.rota-kpi-card {
  min-height: 136px;
}

.rota-kpi-value {
  white-space: normal;
  overflow-wrap: anywhere;
}

.rotas-kpi-subtitle {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #5b6b62;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.rotas-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.rotas-meta span {
  border-radius: 999px;
  padding: 6px 10px;
  background: #edf3ef;
  color: #41554a;
  font-size: 12px;
  font-weight: 700;
}

.matrix-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 18px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e9e4;
}

.rotas-matrix {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.rotas-matrix th,
.rotas-matrix td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.rotas-matrix th:first-child,
.rotas-matrix td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  font-weight: 800;
}

.rotas-matrix th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(21, 81, 64, 0.06);
}

.rotas-matrix td span {
  display: inline-block;
  min-width: 100%;
}

.matrix-cell-empty {
  opacity: 0.35;
}

.matrix-cell-neutral {
  color: #7a877f;
  background: rgba(31, 81, 63, 0.03);
}

.matrix-cell-active {
  font-weight: 800;
  color: #17322a;
  background: rgba(21, 81, 64, var(--matrix-alpha, 0.16));
}

.matrix-cell-active span {
  cursor: help;
}

.matrix-cell-active.is-warning {
  color: #9a6a13;
  box-shadow: inset 0 0 0 1px rgba(180, 126, 24, 0.18);
}

.matrix-cell-active.is-danger {
  color: #9f3434;
  box-shadow: inset 0 0 0 1px rgba(170, 55, 55, 0.16);
}

.matrix-cell-total {
  font-weight: 900;
  color: #17322a;
  background: rgba(21, 81, 64, 0.12);
}

.dre-route-matrices-section {
  margin-top: 14px;
  max-width: 100%;
  overflow-x: hidden;
}

.dre-route-page-header {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.dre-route-note {
  margin-top: 2px;
  color: #718078;
  font-size: 11px;
}

.dre-route-main-card {
  border: 1px solid #dfe8e2;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 49, 38, 0.04);
}

.dre-route-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid #e6eee9;
  background: #f8fbf9;
}

.dre-route-tab {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #17322a;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
}

.dre-route-tab:hover {
  background: #eef6f1;
}

.dre-route-tab.is-active {
  border-color: #bfd5c8;
  background: #fff;
  color: #0e5a43;
  box-shadow: 0 1px 3px rgba(15, 49, 38, 0.06);
}

.dre-route-summary {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(180px, 1.6fr) minmax(110px, 0.8fr);
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #e6eee9;
}

.dre-route-summary > div,
.dre-route-detail-grid > div {
  min-width: 0;
  border: 1px solid #edf2ef;
  border-radius: 6px;
  background: #fbfdfc;
  padding: 7px 8px;
}

.dre-route-summary span,
.dre-route-detail span,
.dre-route-detail-label {
  display: block;
  color: #6d7a72;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.dre-route-summary strong,
.dre-route-detail strong {
  color: #17322a;
  display: block;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dre-route-panels {
  min-width: 0;
}

.dre-route-matrix-wrapper {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  max-width: 100%;
}

.dre-route-matrix {
  min-width: 560px;
  width: 100%;
  table-layout: fixed;
}

.dre-route-matrix th,
.dre-route-matrix td {
  min-width: 0 !important;
  padding: 8px 7px;
  font-size: 11px;
}

.dre-route-matrix td[data-route-cell] {
  cursor: pointer;
}

.dre-route-matrix td[data-route-cell]:hover {
  box-shadow: inset 0 0 0 1px rgba(21, 81, 64, 0.22);
}

.dre-route-detail {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(0, 2.2fr);
  gap: 10px;
  padding: 10px;
  border-top: 1px solid #e6eee9;
  background: #fff;
}

.dre-route-detail > div:first-child {
  min-width: 0;
}

.dre-route-detail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(80px, 1fr));
  gap: 6px;
}

.dre-route-totals-wrapper {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-top: 1px solid #e6eee9;
  max-width: 100%;
  overflow-x: auto;
}

.dre-route-totals-table {
  min-width: 0;
  width: auto;
  table-layout: auto;
}

.dre-route-totals-table th,
.dre-route-totals-table td {
  padding: 7px 8px;
  font-size: 11px;
  min-width: 0 !important;
  white-space: nowrap;
}

.dre-route-totals-table th:first-child,
.dre-route-totals-table td:first-child {
  width: 38px;
  min-width: 38px !important;
  max-width: 38px;
  padding-right: 6px;
}

.dre-route-totals-table th:not(:first-child),
.dre-route-totals-table td:not(:first-child) {
  text-align: right;
}

.dre-route-history-grid {
  display: contents;
}

.dre-route-history-wrapper {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  max-width: 100%;
  overflow-x: auto;
}

.dre-route-history-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}

.dre-route-history-table th,
.dre-route-history-table td {
  padding: 7px 8px;
  font-size: 11px;
  min-width: 0 !important;
  white-space: nowrap;
}

.dre-route-history-table th:first-child,
.dre-route-history-table td:first-child {
  width: 66px;
  min-width: 66px !important;
  max-width: 66px;
}

.dre-route-history-table th:not(:first-child),
.dre-route-history-table td:not(:first-child) {
  text-align: right;
}

@media (max-width: 1100px) {
  .dre-route-matrices-grid {
    grid-template-columns: 1fr;
  }

  .dre-route-summary {
    grid-template-columns: 1fr;
  }

  .dre-route-detail {
    grid-template-columns: 1fr;
  }

  .dre-route-detail-grid {
    grid-template-columns: repeat(3, minmax(80px, 1fr));
  }
}

.rotas-total-row td {
  border-top: 2px solid rgba(21, 81, 64, 0.18);
}

.rotas-ranking {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.rota-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-card, 0 8px 22px rgba(0, 0, 0, 0.06));
  border: 1px solid #e2e9e4;
}

.rota-rank {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.7;
}

.rota-title {
  font-size: 16px;
  font-weight: 900;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.rota-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: #53665b;
  font-weight: 700;
}

.rota-highlight {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 900;
  color: #17322a;
  overflow-wrap: anywhere;
}

.rota-metricas {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rota-attention-card.warning {
  border-color: rgba(180, 126, 24, 0.22);
}

.rota-attention-card.danger {
  border-color: rgba(170, 55, 55, 0.22);
}

.rotas-mobile-list {
  display: none;
  margin-top: 18px;
  gap: 12px;
}

.combustivel-filter-card {
  padding: 14px 18px !important;
  border-radius: 14px;
  margin-bottom: 14px;
}

.combustivel-filters,
.combustivel-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: end;
}

.filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.combustivel-filter-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px 12px;
}

.combustivel-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.combustivel-filter-field label,
.combustivel-filters label {
  display: block;
  min-width: 0;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.1;
  color: #10251f;
  font-weight: 500;
}

.combustivel-filter-field input,
.combustivel-filter-field select,
.combustivel-filters input,
.combustivel-filters select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 35px;
  min-height: 35px;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.filters-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.combustivel-filter-actions,
.filtros-actions {
  justify-content: flex-end;
}

.combustivel-filter-actions {
  grid-column: 3 / 5;
  gap: 8px;
  justify-self: stretch;
}

.combustivel-filter-actions .action-button,
.combustivel-filter-actions button,
.filters-actions .action-button,
.filters-actions button {
  max-width: 100%;
}

.combustivel-filter-actions .action-button,
.combustivel-filter-actions button {
  width: auto;
  height: 35px;
  min-height: 35px;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.combustivel-filter-actions .btn-filtrar {
  width: auto !important;
  min-width: 110px;
  background: #198754;
  border-color: #198754;
  color: #fff;
}

.combustivel-filter-actions .btn-limpar {
  width: auto !important;
  min-width: 80px;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.kpi-card {
  min-height: 128px;
}

.kpi-title {
  font-size: 12px;
}

.kpi-value {
  font-size: 28px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header h3 {
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.combustivel-chart-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.combustivel-chart-grid .panel-card {
  margin-bottom: 0;
}

.mini-chart-list {
  display: grid;
  gap: 12px;
}

.mini-chart-row,
.ranking-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.mini-chart-label {
  font-size: 12px;
  font-weight: 700;
  color: #41554a;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mini-chart-track {
  height: 12px;
  background: #e7efea;
  border-radius: 999px;
  overflow: hidden;
  min-width: 0;
}

.mini-chart-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f513f 0%, #5d7a6d 100%);
}

.mini-chart-fill-alt {
  background: linear-gradient(90deg, #9b6a12 0%, #d0a24f 100%);
}

.mini-chart-value {
  font-size: 12px;
  color: #1f2a24;
  white-space: nowrap;
}

.ranking-value {
  justify-self: end;
}

.oficina-vehicle-chart-link {
  padding: 6px 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.oficina-vehicle-chart-link:hover,
.oficina-vehicle-chart-link.is-active {
  background: #f4f8f5;
}

.oficina-vehicle-chart-link.is-active {
  box-shadow: inset 3px 0 0 #176b4d;
}

.driver-compact-chart {
  align-self: start;
  padding-top: 10px;
  padding-bottom: 10px;
}

.driver-compact-chart .section-header {
  margin-bottom: 6px;
}

.driver-compact-chart .section-header h3 {
  font-size: 13px;
  line-height: 1.15;
}

.driver-compact-chart .mini-chart-list {
  gap: 4px;
}

.driver-compact-chart .mini-chart-row,
.driver-compact-chart .ranking-row {
  grid-template-columns: minmax(118px, 0.8fr) minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 14px;
}

.driver-compact-chart .mini-chart-label {
  font-size: 9px;
  line-height: 1.1;
}

.driver-compact-chart .mini-chart-value {
  font-size: 10px;
  line-height: 1.1;
}

.driver-compact-chart .mini-chart-label {
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
}

.driver-compact-chart .mini-chart-track {
  height: 6px;
}

.stacked-chart {
  display: grid;
  gap: 14px;
}

.stacked-chart-bar {
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efea;
}

.stacked-chart-bar span {
  display: block;
  height: 100%;
}

.stacked-chart-legend {
  display: grid;
  gap: 8px;
}

.stacked-chart-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.legend-label {
  font-weight: 700;
}

.legend-meta {
  color: #53665b;
}

.combustivel-table-wrapper {
  max-height: 520px;
  overflow: auto;
}

.combustivel-table-wrapper-tall {
  max-height: 640px;
}

.combustivel-table th:first-child,
.combustivel-table td:first-child {
  min-width: 200px;
  max-width: 280px;
}

.combustivel-table td:not(:first-child),
.combustivel-table th:not(:first-child) {
  min-width: 140px;
}

.combustivel-table tbody td {
  vertical-align: top;
}

.table-primary-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-inline-note {
  font-size: 11px;
  line-height: 1.3;
  color: #7a5b16;
  font-weight: 600;
}

.combustivel-row-alert {
  --dre-row-hover-bg: #fff9ed;
  background: #fffaf3 !important;
}

@media (max-width: 1180px) {
  .combustivel-filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .combustivel-filter-actions {
    grid-column: 2 / 4;
  }
}

@media (max-width: 900px) {
  .combustivel-filter-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .combustivel-filter-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .combustivel-filter-actions .action-button,
  .combustivel-filter-actions button {
    flex: 1;
  }
}

@media (max-width: 1500px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
  }
}

@media (max-width: 1400px) {
  .kpi-card {
    padding: 18px;
    min-height: 120px;
  }

  .kpi-value {
    font-size: 26px;
  }

  .kpi-title {
    font-size: 11px;
  }

  .page-combustivel .kpi-value {
    font-size: 24px;
  }

  .page-combustivel .kpi-title {
    font-size: 9px;
  }
}

@media (max-width: 980px) {
  .gerencial-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .gerencial-filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .gerencial-select {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
  }

  .gerencial-help {
    font-size: 12px;
    flex-basis: auto;
  }

  .section-header {
    flex-direction: column;
  }

  .section-actions,
  .filters-actions {
    width: 100%;
  }

  .section-actions .action-button,
  .filters-actions .action-button,
  .filters-actions button {
    flex: 1 1 auto;
  }

  .clientes-filtros {
    width: 100%;
  }

  .clientes-filtros label {
    flex: 1 1 180px;
  }

  .clientes-filter-card .clientes-filtros {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clientes-filter-search {
    grid-column: 1 / -1;
  }

  .clientes-filter-search input {
    min-width: 0;
  }

  .clientes-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .rotas-filtros {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mini-chart-row,
  .ranking-row {
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .filtros-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .combustivel-filter-grid {
    grid-template-columns: 1fr;
  }

  .combustivel-filter-actions {
    grid-column: 1 / -1;
  }

  .panel-card {
    padding: 16px;
  }

  .clientes-filter-card {
    padding: 12px;
  }

  .clientes-filter-card .clientes-filtros {
    grid-template-columns: 1fr;
  }

  .clientes-filter-actions {
    justify-content: stretch;
    align-items: center;
    flex-wrap: wrap;
  }

  .clientes-filtros button {
    width: 100%;
  }

  .clientes-clear-filters {
    flex: 1 1 100%;
  }

  .rotas-filtros button {
    width: 100%;
  }

  .cliente-card-top {
    grid-template-columns: minmax(0, 1fr) 96px 34px;
    gap: 8px;
    min-height: 92px;
    padding: 12px 12px 48px;
  }

  .cliente-top-summary,
  .cliente-indicadores {
    width: 96px;
  }

  .cliente-nome {
    font-size: 13px;
  }

  .cliente-receita,
  .cliente-valor {
    font-size: 16px;
  }

  .cliente-participacao,
  .cliente-percentual {
    font-size: 11px;
  }

  .cliente-ctrcs-button {
    height: 32px;
    min-height: 32px;
    margin: 0 0 12px 12px;
    padding: 0 12px;
    font-size: 13px;
  }

  .cliente-expand-icon,
  .cliente-acao {
    width: 30px;
    height: 30px;
  }

  .cliente-metricas {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .rotas-matrix {
    min-width: 680px;
  }

  .rotas-ranking {
    grid-template-columns: 1fr;
  }

  .rota-metricas {
    grid-template-columns: 1fr 1fr;
  }

  .rotas-mobile-list {
    display: grid;
  }
}

@media (max-width: 1100px) {
  .importacoes-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-grid {
    grid-template-columns: 1fr;
  }

  .actions-row-stacked {
    flex-direction: row;
  }

  .preview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .ranking-row {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .ranking-value {
    grid-column: 2;
    justify-self: end;
  }

  .cliente-metricas,
  .cliente-detail-grid {
    grid-template-columns: 1fr;
  }

  .rota-metricas {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .importacoes-kpis,
  .operational-grid,
  .preview-summary,
  .history-details-grid {
    grid-template-columns: 1fr;
  }

  .actions-row,
  .actions-row-stacked {
    flex-direction: column;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-toolbar-filters {
    flex-direction: column;
  }
}

.fluxo-page {
  display: grid;
  gap: 18px;
}

.fluxo-page.is-loading {
  opacity: 0.82;
}

.fluxo-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.fluxo-header h3 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

.fluxo-subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fluxo-subnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(23, 50, 42, 0.08);
  color: #17322a;
  text-decoration: none;
  font-weight: 600;
}

.fluxo-subnav-link.is-active {
  background: #17322a;
  color: #f4f3ed;
}

.fluxo-filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.fluxo-filter-actions {
  justify-content: flex-end;
}

.fluxo-status-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.fluxo-data-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fluxo-data-badge.is-manual {
  background: rgba(32, 125, 80, 0.14);
  color: #1f7a50;
}

.fluxo-data-badge.is-fallback {
  background: rgba(180, 126, 24, 0.16);
  color: #9a6a13;
}

.fluxo-data-note {
  color: #53665b;
  font-size: 0.92rem;
}

.fluxo-cards .metric-card {
  min-height: 154px;
  border: 1px solid #e1e8e3;
}

.fluxo-card .card-meta {
  margin: 0;
  color: #5b6b62;
  line-height: 1.4;
}

.fluxo-card-positive {
  border-color: #d7e7de;
}

.fluxo-card-negative {
  border-color: #edd6d6;
}

.fluxo-card-warning {
  border-color: #ecd7b8;
}

.fluxo-card-positive strong,
.is-positive-text {
  color: #1f7a50;
}

.fluxo-card-negative strong,
.is-negative-text {
  color: #9f3434;
}

.fluxo-hero-grid,
.fluxo-two-column {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
}

.fluxo-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fluxo-chart-area {
  min-height: 380px;
}

.fluxo-chart-svg {
  width: 100%;
  height: 320px;
}

.fluxo-axis-zero,
.fluxo-today-marker {
  stroke: rgba(23, 50, 42, 0.2);
  stroke-width: 1;
}

.fluxo-today-marker {
  stroke-dasharray: 6 4;
}

.fluxo-line-real {
  fill: none;
  stroke: #1f513f;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fluxo-line-projected {
  fill: none;
  stroke: #c58f2a;
  stroke-width: 3;
  stroke-dasharray: 8 6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fluxo-bar-in {
  fill: rgba(31, 122, 80, 0.35);
}

.fluxo-bar-out {
  fill: rgba(159, 52, 52, 0.26);
}

.fluxo-chart-svg text {
  fill: #62736b;
  font-size: 11px;
}

.fluxo-chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: #53665b;
}

.legend-line,
.legend-box {
  display: inline-block;
  width: 16px;
  height: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-line-real {
  background: #1f513f;
}

.legend-line-projected {
  background: linear-gradient(90deg, #c58f2a 0 50%, transparent 50% 100%);
  background-size: 8px 100%;
}

.legend-box {
  height: 10px;
}

.legend-box-in {
  background: rgba(31, 122, 80, 0.35);
}

.legend-box-out {
  background: rgba(159, 52, 52, 0.26);
}

.fluxo-alert-list {
  display: grid;
  gap: 12px;
}

.fluxo-alert {
  border: 1px solid #e1e8e3;
  border-left-width: 5px;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

.fluxo-alert strong {
  display: block;
  margin-bottom: 6px;
}

.fluxo-alert p {
  margin: 0;
  color: #53665b;
  line-height: 1.45;
}

.fluxo-alert-critico {
  border-left-color: #9f3434;
}

.fluxo-alert-atencao {
  border-left-color: #c58f2a;
}

.fluxo-alert-informacao {
  border-left-color: #1f513f;
}

.fluxo-bars,
.fluxo-aging-list {
  display: grid;
  gap: 12px;
}

.fluxo-bar-row,
.fluxo-aging-row {
  display: grid;
  gap: 8px;
}

.fluxo-bar-head,
.fluxo-aging-row,
.fluxo-aging-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.fluxo-bar-head span,
.fluxo-aging-row span,
.fluxo-aging-meta span {
  color: #5f6f68;
  font-size: 0.9rem;
}

.fluxo-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf2ef;
  overflow: hidden;
}

.fluxo-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #20483b 0%, #4f7b69 100%);
}

.fluxo-mini-cards .metric-card {
  min-height: 120px;
}

.fluxo-projection-table td small {
  color: #6b7c74;
}

.fluxo-table-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
}

.fluxo-quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fluxo-quick-filters button {
  border: 1px solid #cfdad3;
  border-radius: 999px;
  background: #fff;
  color: #17322a;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.fluxo-quick-filters button.is-active {
  background: #17322a;
  color: #f4f3ed;
  border-color: #17322a;
}

.fluxo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.fluxo-pill.is-positive {
  background: rgba(31, 122, 80, 0.14);
  color: #1f7a50;
}

.fluxo-pill.is-negative {
  background: rgba(159, 52, 52, 0.14);
  color: #9f3434;
}

.fluxo-pill.is-neutral {
  background: #edf2ef;
  color: #53665b;
}

.fluxo-table td.is-right,
.fluxo-table th.is-right {
  text-align: right;
}

.fluxo-pagination {
  margin-top: 12px;
  font-size: 13px;
}

@media (max-width: 1200px) {
  .fluxo-hero-grid,
  .fluxo-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .fluxo-chart-area {
    min-height: 300px;
  }

  .fluxo-chart-svg {
    height: 260px;
  }

  .fluxo-filter-actions {
    justify-content: stretch;
  }

  .fluxo-filter-actions .action-button {
    width: 100%;
  }
}

/* =========================================================
   Fluxo de Caixa - ajustes para notebook 14"
   Alvo: 1366x768 / 1440x900
   ========================================================= */

.fluxo-page {
  gap: 14px;
  padding-bottom: 18px;
}

.fluxo-header {
  gap: 10px;
  align-items: center;
}

.fluxo-header h3 {
  margin: 0 0 3px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.fluxo-header p,
.fluxo-header .page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.fluxo-subnav {
  gap: 6px;
}

.fluxo-subnav-link {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 0.86rem;
}

.fluxo-filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.fluxo-filters-grid label,
.fluxo-filters-grid .form-label {
  font-size: 0.78rem;
  margin-bottom: 3px;
}

.fluxo-filters-grid input,
.fluxo-filters-grid select {
  min-height: 34px;
  height: 34px;
  padding: 5px 9px;
  font-size: 0.88rem;
}

.fluxo-filter-actions {
  align-items: end;
}

.fluxo-filter-actions .action-button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.86rem;
}

.fluxo-status-row {
  gap: 8px;
}

.fluxo-data-badge {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 10.5px;
}

.fluxo-data-note {
  font-size: 0.82rem;
}

.fluxo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.fluxo-cards .metric-card {
  min-height: 108px;
  padding: 12px 14px;
}

.fluxo-cards .metric-card h4,
.fluxo-cards .metric-card .metric-title {
  font-size: 0.78rem;
  margin-bottom: 6px;
  line-height: 1.25;
}

.fluxo-cards .metric-card strong,
.fluxo-cards .metric-card .metric-value {
  font-size: 1.28rem;
  line-height: 1.15;
}

.fluxo-card .card-meta {
  font-size: 0.78rem;
  line-height: 1.3;
  margin-top: 5px;
}

.fluxo-mini-cards {
  gap: 10px;
}

.fluxo-mini-cards .metric-card {
  min-height: 92px;
  padding: 10px 12px;
}

.fluxo-mini-cards .metric-card strong,
.fluxo-mini-cards .metric-card .metric-value {
  font-size: 1.12rem;
}

.fluxo-hero-grid,
.fluxo-two-column {
  gap: 14px;
}

.fluxo-chart-area {
  min-height: 280px;
}

.fluxo-chart-svg {
  height: 235px;
}

.fluxo-chart-legend {
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
}

.fluxo-page .card,
.fluxo-page .panel,
.fluxo-page .section-card {
  padding: 14px;
}

.fluxo-page .card h4,
.fluxo-page .panel h4,
.fluxo-page .section-card h4 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
  line-height: 1.25;
}

.fluxo-alert-list {
  gap: 8px;
}

.fluxo-alert {
  border-radius: 12px;
  padding: 10px 12px;
}

.fluxo-alert strong {
  margin-bottom: 3px;
  font-size: 0.9rem;
}

.fluxo-alert p {
  font-size: 0.82rem;
  line-height: 1.35;
}

.fluxo-bars,
.fluxo-aging-list {
  gap: 9px;
}

.fluxo-bar-row,
.fluxo-aging-row {
  gap: 5px;
}

.fluxo-bar-head span,
.fluxo-aging-row span,
.fluxo-aging-meta span {
  font-size: 0.8rem;
}

.fluxo-bar-track {
  height: 8px;
}

.fluxo-table-wrapper,
.fluxo-table-scroll,
.fluxo-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.fluxo-table {
  font-size: 0.82rem;
}

.fluxo-table th,
.fluxo-table td {
  padding: 7px 9px;
  white-space: nowrap;
}

.fluxo-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f3ed;
}

.fluxo-table-toolbar {
  gap: 10px;
  align-items: center;
}

.fluxo-table-toolbar input,
.fluxo-table-toolbar select {
  min-height: 34px;
  height: 34px;
  font-size: 0.86rem;
}

.fluxo-quick-filters {
  gap: 6px;
}

.fluxo-quick-filters button {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.fluxo-pill {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 10.5px;
}

.fluxo-pagination {
  margin-top: 8px;
  font-size: 12px;
}

@media (max-width: 1440px) and (max-height: 900px) {
  .fluxo-page {
    gap: 12px;
  }

  .fluxo-header h3 {
    font-size: 1.28rem;
  }

  .fluxo-cards .metric-card {
    min-height: 102px;
  }

  .fluxo-chart-area {
    min-height: 260px;
  }

  .fluxo-chart-svg {
    height: 215px;
  }

  .fluxo-page .card,
  .fluxo-page .panel,
  .fluxo-page .section-card {
    padding: 12px;
  }

  .fluxo-table-wrapper,
  .fluxo-table-scroll,
  .fluxo-table-wrap {
    max-height: 320px;
  }
}

@media (max-width: 1368px) and (max-height: 780px) {
  .fluxo-page {
    gap: 10px;
  }

  .fluxo-header {
    align-items: center;
  }

  .fluxo-header h3 {
    font-size: 1.2rem;
  }

  .fluxo-subnav-link {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .fluxo-filters-grid {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px;
  }

  .fluxo-filters-grid input,
  .fluxo-filters-grid select {
    min-height: 31px;
    height: 31px;
    padding: 4px 8px;
    font-size: 0.82rem;
  }

  .fluxo-cards {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }

  .fluxo-cards .metric-card {
    min-height: 92px;
    padding: 10px 11px;
  }

  .fluxo-cards .metric-card strong,
  .fluxo-cards .metric-card .metric-value {
    font-size: 1.14rem;
  }

  .fluxo-card .card-meta {
    font-size: 0.72rem;
  }

  .fluxo-chart-area {
    min-height: 235px;
  }

  .fluxo-chart-svg {
    height: 190px;
  }

  .fluxo-chart-svg text {
    font-size: 10px;
  }

  .fluxo-chart-legend {
    font-size: 10.5px;
  }

  .fluxo-mini-cards .metric-card {
    min-height: 82px;
  }

  .fluxo-page .card,
  .fluxo-page .panel,
  .fluxo-page .section-card {
    padding: 10px;
  }

  .fluxo-alert {
    padding: 9px 10px;
  }

  .fluxo-table-wrapper,
  .fluxo-table-scroll,
  .fluxo-table-wrap {
    max-height: 280px;
  }

  .fluxo-table th,
  .fluxo-table td {
    padding: 6px 8px;
  }
}

@media (max-width: 1200px) {
  .fluxo-hero-grid,
  .fluxo-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .fluxo-page {
    gap: 12px;
  }

  .fluxo-header {
    align-items: flex-start;
  }

  .fluxo-chart-area {
    min-height: 260px;
  }

  .fluxo-chart-svg {
    height: 220px;
  }

  .fluxo-filter-actions {
    justify-content: stretch;
  }

  .fluxo-filter-actions .action-button {
    width: 100%;
  }

  .fluxo-table-wrapper,
  .fluxo-table-scroll,
  .fluxo-table-wrap {
    max-height: 340px;
  }
}

/* =========================================================
   Menu lateral financeiro - versão compacta para notebook
   ========================================================= */

.finance-layout {
  --sidebar-width: 210px;
  --sidebar-collapsed-width: 64px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  column-gap: 12px;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.fin-sidebar,
.finance-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: #12392f;
  color: #fff;
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  transition: width 180ms ease, min-width 180ms ease;
  overflow-x: hidden;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
  scrollbar-gutter: stable;
}

.finance-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 10px 10px;
  margin-bottom: 8px;
}

.finance-sidebar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-sidebar-logo {
  width: 112px;
  max-width: 100%;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.finance-sidebar-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-sidebar-toggle {
  width: 38px;
  height: 34px;
  min-width: 38px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f3ed;
  cursor: pointer;
}

.finance-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.finance-menu {
  display: grid;
  gap: 6px;
  padding: 10px 8px 16px;
  flex: 1 1 auto;
}

.finance-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #f4f3ed;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.2;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.15s ease;
}

.finance-menu a span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-menu a::before {
  content: attr(data-short);
  display: none;
  width: 38px;
  height: 32px;
  min-width: 38px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.10);
  color: currentColor;
  white-space: nowrap;
}

/* ===== Agregados ===== */

.agregados-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.agregados-toolbar {
  display: grid;
  gap: 14px;
}

.agregados-toolbar-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-button.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.agregados-filters-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.agregados-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.agregados-kpi {
  min-width: 0;
}

.agregados-table-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.agregados-table {
  min-width: 1880px;
}

.agregado-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 180px;
}

.agregado-alert-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.agregado-alert-badge.is-warning {
  background: #fff4d8;
  color: #7a5411;
}

.agregado-alert-badge.is-danger {
  background: #fde1e1;
  color: #942d2d;
}

.agregado-row-warning td:first-child {
  box-shadow: inset 4px 0 0 #d8a13d;
}

.agregado-row-danger td:first-child {
  box-shadow: inset 4px 0 0 #c94b4b;
}

.action-button-inline {
  white-space: nowrap;
}

.agregado-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 250px;
}

.agregado-edit-row td {
  background: #f7faf8;
  border-top: 1px solid #dbe6df;
  border-bottom: 1px solid #dbe6df;
}

.agregado-edit-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(120px, 0.75fr)) minmax(220px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 1100px;
}

.agregado-edit-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agregado-edit-heading strong {
  color: #18372d;
  font-size: 0.9rem;
  line-height: 1.2;
}

.agregado-edit-heading span,
.agregado-edit-form label span {
  color: #5c6a63;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.agregado-edit-form label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.agregado-edit-form input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #b8c7bd;
  border-radius: 7px;
  background: #fff;
  color: #1f2f28;
  font-size: 0.82rem;
}

.agregado-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agregado-edit-actions button {
  white-space: nowrap;
}

.agregados-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.agregado-checkbox,
.agregado-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agregado-observacao {
  grid-column: 1 / -1;
}

.agregado-observacao textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid #b7c6bb;
  border-radius: 10px;
  resize: vertical;
}

.monitoramento-filters {
  margin-bottom: 14px;
}

.monitoramento-subtitle {
  margin-top: -6px;
  margin-bottom: 12px;
}

.monitoramento-filters-grid {
  grid-template-columns: minmax(126px, 146px) minmax(126px, 146px) minmax(120px, 150px) minmax(96px, 120px) minmax(150px, 1fr) auto auto;
  align-items: end;
}

.monitoramento-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
}

.monitoramento-check input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  padding: 0;
}

.monitoramento-filter-actions {
  flex-wrap: nowrap;
}

.monitoramento-filter-actions button {
  width: auto;
  min-width: 96px;
  padding-left: 18px;
  padding-right: 18px;
}

.monitoramento-address-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: -2px 0 12px;
  color: #64748b;
  font-size: 0.8rem;
}

.monitoramento-address-summary span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.monitoramento-address-summary strong {
  color: #0f172a;
}

.monitoramento-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.monitoramento-table th,
.monitoramento-table td {
  min-width: 0;
  padding: 7px 8px;
}

.monitoramento-table .monitoramento-col-placa,
.monitoramento-table th:first-child,
.monitoramento-table td:first-child {
  position: static;
  left: auto;
  z-index: auto;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  white-space: nowrap;
}

.monitoramento-table col.monitoramento-col-placa {
  width: 64px;
}

.monitoramento-table col.monitoramento-col-data {
  width: 104px;
}

.monitoramento-table col.monitoramento-col-filial {
  width: 64px;
}

.monitoramento-table col.monitoramento-col-volumes,
.monitoramento-table col.monitoramento-col-peso {
  width: 78px;
}

.monitoramento-table col.monitoramento-col-documentos {
  width: 92px;
}

.monitoramento-table col.monitoramento-col-status {
  width: 150px;
}

.monitoramento-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitoramento-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #dbe3ea;
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.monitoramento-status-identificada,
.monitoramento-status-disponivel,
.monitoramento-entrega-entregue,
.monitoramento-entrega-coletado {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.monitoramento-status-proxima,
.monitoramento-status-parcial,
.monitoramento-entrega-nao-deu-tempo,
.monitoramento-entrega-nao-realizado {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.monitoramento-status-nao-identificada,
.monitoramento-entrega-ocorrencia {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.monitoramento-status-indisponivel,
.monitoramento-status-aguardando,
.monitoramento-entrega-sem-baixa,
.monitoramento-entrega-misto,
.monitoramento-entrega-nao-aplicavel {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.monitoramento-status-sem-endereco {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.monitoramento-status-aguardando-coordenadas {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.monitoramento-status-realizada {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.monitoramento-detail-table {
  min-width: 1360px;
  font-size: 0.78rem;
}

.monitoramento-detail-table th,
.monitoramento-detail-table td,
.monitoramento-stops-table th,
.monitoramento-stops-table td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.monitoramento-gps-area {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(230px, 2fr);
  gap: 14px;
  margin-top: 12px;
  align-items: stretch;
}

.monitoramento-map-panel {
  min-height: 236px;
}

.monitoramento-map-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 204px;
  overflow: hidden;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    #f8fafc;
  background-size: 42px 42px;
  color: #475569;
  text-align: center;
}

.monitoramento-map-placeholder strong,
.monitoramento-map-placeholder small {
  position: relative;
  z-index: 1;
  display: block;
}

.monitoramento-map-placeholder small {
  max-width: 280px;
  margin-top: 4px;
  font-size: 0.78rem;
}

.monitoramento-map-line {
  position: absolute;
  width: 72%;
  height: 2px;
  transform: rotate(-14deg);
  background: #94a3b8;
  opacity: 0.45;
}

.monitoramento-map-point {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.monitoramento-map-point.is-document {
  left: 28%;
  top: 38%;
  background: #dc2626;
}

.monitoramento-map-point.is-stop {
  right: 30%;
  bottom: 34%;
  background: #94a3b8;
}

.monitoramento-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: #64748b;
  font-size: 0.76rem;
}

.monitoramento-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.monitoramento-map-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.monitoramento-map-legend .is-ok {
  background: #16a34a;
}

.monitoramento-map-legend .is-near {
  background: #f59e0b;
}

.monitoramento-map-legend .is-missing {
  background: #dc2626;
}

.monitoramento-map-legend .is-stop {
  background: #94a3b8;
}

.monitoramento-gps-summary {
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

.monitoramento-gps-summary h3,
.monitoramento-gps-stops h3 {
  margin: 0 0 8px;
  color: #334155;
  font-size: 0.86rem;
}

.monitoramento-gps-summary dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.monitoramento-gps-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 5px;
}

.monitoramento-gps-summary dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.monitoramento-gps-summary dt {
  color: #64748b;
  font-size: 0.78rem;
}

.monitoramento-gps-summary dd {
  margin: 0;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

.monitoramento-gps-stops {
  margin-top: 12px;
}

.monitoramento-stops-table {
  min-width: 760px;
  font-size: 0.78rem;
}

.monitoramento-gps-empty {
  color: #64748b;
  text-align: center;
}

.monitoramento-main-wrapper {
  max-height: none;
}

.monitoramento-operational-panel {
  display: grid;
  gap: 10px;
  padding: 2px 0 4px;
}

.monitoramento-route-header {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) repeat(4, minmax(120px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.monitoramento-route-header > div,
.monitoramento-kpi-strip article {
  min-width: 0;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.monitoramento-route-header span,
.monitoramento-kpi-strip span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.monitoramento-route-header strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #0f172a;
  font-size: 0.86rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitoramento-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 8px;
}

.monitoramento-kpi-strip article {
  padding: 7px 9px;
}

.monitoramento-kpi-strip strong {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1;
}

.monitoramento-kpi-strip article.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.monitoramento-kpi-strip article.is-danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.monitoramento-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.monitoramento-leaflet-map {
  width: 100%;
  height: 330px;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background: #f8fafc;
}

.monitoramento-leaflet-map.is-empty::after {
  content: "Sem coordenadas GPS para desenhar o mapa";
  display: grid;
  place-items: center;
  height: 100%;
  color: #64748b;
  font-size: 0.82rem;
}

.monitoramento-map-marker-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.monitoramento-map-marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.monitoramento-map-marker em {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #0f172a;
  font-size: 0.5rem;
  font-style: normal;
  line-height: 1;
}

.monitoramento-map-marker.is-ok,
.monitoramento-map-legend .is-ok {
  background: #16a34a;
}

.monitoramento-map-marker.is-near,
.monitoramento-map-legend .is-near {
  background: #f59e0b;
}

.monitoramento-map-marker.is-occurrence,
.monitoramento-map-cluster.is-occurrence,
.monitoramento-map-legend .is-occurrence {
  background: #facc15;
  color: #713f12;
}

.monitoramento-map-marker.is-missing,
.monitoramento-map-legend .is-missing {
  background: #dc2626;
}

.monitoramento-map-marker.is-stop,
.monitoramento-map-legend .is-stop {
  background: #f97316;
}

.monitoramento-map-marker.is-base,
.monitoramento-map-legend .is-base {
  background: #2563eb;
}

.monitoramento-gps-summary p {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.monitoramento-doc-section {
  display: grid;
  gap: 8px;
}

.monitoramento-doc-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.monitoramento-doc-toolbar h3 {
  margin: 0;
  color: #334155;
  font-size: 0.86rem;
}

.monitoramento-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.monitoramento-quick-filters button {
  min-height: 26px;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.monitoramento-quick-filters button.is-active,
.monitoramento-quick-filters button:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.monitoramento-detail-table {
  min-width: 900px;
  table-layout: fixed;
}

.monitoramento-detail-table th,
.monitoramento-detail-table td {
  vertical-align: top;
}

.monitoramento-detail-table td small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitoramento-detail-table th:nth-child(3),
.monitoramento-detail-table td:nth-child(3) {
  width: 150px;
  max-width: 150px;
}

.monitoramento-detail-table th:nth-child(4),
.monitoramento-detail-table td:nth-child(4) {
  width: 92px;
  max-width: 92px;
  white-space: nowrap;
}

.monitoramento-detail-table th:nth-child(8),
.monitoramento-detail-table td:nth-child(8) {
  width: 118px;
  max-width: 118px;
}

.monitoramento-detail-table td:nth-child(8) .monitoramento-status {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitoramento-doc-row {
  cursor: pointer;
}

.monitoramento-doc-row.is-expanded td {
  background: #f8fafc;
}

.monitoramento-doc-extra td {
  background: #f8fafc;
}

.monitoramento-doc-extra dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.monitoramento-doc-extra div {
  min-width: 0;
}

.monitoramento-doc-extra dt {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.monitoramento-doc-extra dd {
  overflow: hidden;
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitoramento-status-parada-sem-documento {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.monitoramento-status-base-operacional {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.monitoramento-doc-row.is-filter-hidden,
.monitoramento-doc-extra.is-filter-hidden,
.monitoramento-stops-table tr.is-filter-hidden {
  display: none;
}

.monitoramento-summary-row.is-expanded td {
  background: #f8fafc;
}

.monitoramento-operational-panel {
  gap: 8px;
}

.monitoramento-kpi-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.monitoramento-kpi-strip article {
  display: grid;
  min-height: 72px;
  align-content: space-between;
  gap: 6px;
  border-left-width: 4px;
  padding: 8px 9px;
}

.monitoramento-kpi-strip strong {
  font-size: 1.38rem;
  line-height: 1.05;
}

.monitoramento-kpi-strip span {
  min-height: 24px;
  line-height: 1.15;
}

.monitoramento-kpi-strip article.is-total {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.monitoramento-kpi-strip article.is-compatible {
  border-color: #86efac;
  background: #f0fdf4;
}

.monitoramento-kpi-strip article.is-near {
  border-color: #fcd34d;
  background: #fffbeb;
}

.monitoramento-kpi-strip article.is-missing {
  border-color: #fca5a5;
  background: #fef2f2;
}

.monitoramento-kpi-strip article.is-stop {
  border-color: #fdba74;
  background: #fff7ed;
}

.monitoramento-kpi-strip article.is-delivery {
  border-color: #f9a8d4;
  background: #fdf2f8;
}

.monitoramento-kpi-strip article.is-collection {
  border-color: #93c5fd;
  background: #eff6ff;
}

.monitoramento-visual-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.monitoramento-map-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.monitoramento-leaflet-map {
  height: 430px;
  min-height: 430px;
}

.monitoramento-leaflet-map svg {
  max-width: none;
}

.monitoramento-map-legend {
  position: absolute;
  z-index: 900;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
  pointer-events: none;
}

.monitoramento-map-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
}

.monitoramento-map-legend button.is-active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.monitoramento-map-legend button:not(.is-active) {
  opacity: 0.45;
}

.monitoramento-map-legend button i {
  flex: 0 0 auto;
}

.monitoramento-line-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #475569;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.monitoramento-line-key::before {
  content: "";
  display: inline-block;
  width: 18px;
  border-top: 3px solid currentColor;
}

.monitoramento-line-key.is-gps {
  color: #f97316;
}

.monitoramento-route-arrow-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.monitoramento-route-arrow {
  display: block;
  width: 9px;
  height: 9px;
  background: #f97316;
  clip-path: polygon(50% 0, 90% 100%, 50% 76%, 10% 100%);
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.9)) drop-shadow(0 1px 2px rgba(15, 23, 42, 0.18));
  opacity: 0.72;
  transform-origin: center;
}

.monitoramento-map-legend .is-ok {
  background: #16a34a;
}

.monitoramento-map-legend .is-near,
.monitoramento-map-legend .is-missing {
  background: #7c3aed;
}

.monitoramento-map-legend .is-stop {
  background: #dc2626;
}

.monitoramento-map-legend .is-base {
  background: #1e3a8a;
}

.monitoramento-map-controls {
  position: absolute;
  z-index: 901;
  top: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(520px, calc(100% - 76px));
  gap: 6px;
}

.monitoramento-map-controls button {
  min-height: 26px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.monitoramento-map-controls button.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.monitoramento-map-marker {
  width: 22px;
  height: 22px;
  font-size: 0.66rem;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.2);
}

.monitoramento-map-marker em {
  right: -5px;
  bottom: -5px;
  width: 13px;
  height: 13px;
}

.monitoramento-map-marker.is-delivery em {
  background: #7f1d1d;
}

.monitoramento-map-marker.is-collection em {
  background: #1d4ed8;
}

.monitoramento-map-marker.is-stop-type em {
  display: none;
}

.monitoramento-map-marker.is-stop-type {
  width: 28px;
  height: 28px;
  border-width: 3px;
  border-color: #fff;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.28);
  font-size: 0;
  letter-spacing: 0;
}

.monitoramento-marker-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.monitoramento-marker-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1ch;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.monitoramento-map-marker.is-ok {
  background: #16a34a;
}

.monitoramento-map-marker.is-occurrence {
  background: #facc15;
  color: #713f12;
}

.monitoramento-map-marker.is-near,
.monitoramento-map-marker.is-missing {
  background: #7c3aed;
}

.monitoramento-map-marker.is-stop {
  background: #dc2626;
}

.monitoramento-map-marker.is-base {
  background: #1e3a8a;
}

.monitoramento-map-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
}

.monitoramento-map-cluster span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
}

.monitoramento-map-cluster.is-occurrence span {
  background: #facc15;
  color: #713f12;
}

.monitoramento-map-cluster.is-ok span {
  background: #16a34a;
}

.monitoramento-map-cluster.is-near span,
.monitoramento-map-cluster.is-missing span {
  background: #7c3aed;
}

.monitoramento-map-cluster.is-stop span {
  background: #dc2626;
}

.monitoramento-map-cluster.is-base span {
  background: #1e3a8a;
}

.monitoramento-map-popup {
  display: grid;
  gap: 4px;
  min-width: 170px;
  color: #0f172a;
  font-size: 0.78rem;
  line-height: 1.3;
}

.monitoramento-map-popup strong {
  color: #0f172a;
  font-size: 0.82rem;
}

.monitoramento-route-dot-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.monitoramento-route-dot {
  display: block;
  width: 6px;
  height: 6px;
  border: 1px solid #111827;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 1px 3px rgba(2, 6, 23, 0.24);
}

.monitoramento-map-marker.is-base-type em {
  display: none;
}

.monitoramento-map-marker.is-base-type {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.monitoramento-base-house {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  line-height: 1;
}

.monitoramento-gps-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.monitoramento-gps-summary h3 {
  margin-bottom: 0;
}

.monitoramento-summary-list,
.monitoramento-integration-details dl {
  gap: 4px;
}

.monitoramento-gps-summary dl div,
.monitoramento-integration-details dl div {
  align-items: baseline;
  padding-bottom: 4px;
}

.monitoramento-gps-summary dd {
  font-size: 0.78rem;
}

.monitoramento-integration-details {
  border-top: 1px solid #eef2f7;
  padding-top: 4px;
}

.monitoramento-integration-details summary {
  color: #475569;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.monitoramento-integration-details dl {
  margin-top: 6px;
}

.monitoramento-gps-stops .dre-table-wrapper {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.monitoramento-stops-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 0.76rem;
}

.monitoramento-stops-table th,
.monitoramento-stops-table td {
  padding: 5px 7px;
  line-height: 1.2;
}

.monitoramento-stops-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.monitoramento-stops-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.monitoramento-stops-table tbody tr[data-filter-situacao="identificada"] td {
  border-left: 3px solid #86efac;
}

.monitoramento-stops-table tbody tr[data-filter-situacao="proxima"] td {
  border-left: 3px solid #fcd34d;
}

.monitoramento-stops-table tbody tr[data-filter-situacao="nao-identificada"] td {
  border-left: 3px solid #fca5a5;
}

.monitoramento-stops-table tbody tr[data-filter-situacao="parada-sem-documento"] td {
  border-left: 3px solid #fdba74;
}

.monitoramento-stops-table tbody tr[data-filter-situacao="base-operacional"] td {
  border-left: 3px solid #93c5fd;
}

.monitoramento-stops-table th:nth-child(1),
.monitoramento-stops-table td:nth-child(1) {
  width: 86px;
}

.monitoramento-stops-table th:nth-child(2),
.monitoramento-stops-table td:nth-child(2) {
  width: 24%;
}

.monitoramento-stops-table th:nth-child(3),
.monitoramento-stops-table td:nth-child(3) {
  width: 18%;
}

.monitoramento-stops-table th:nth-child(4),
.monitoramento-stops-table td:nth-child(4) {
  width: 72px;
}

.monitoramento-stops-table th:nth-child(5),
.monitoramento-stops-table td:nth-child(5) {
  width: 20%;
}

.monitoramento-stops-table th:nth-child(6),
.monitoramento-stops-table td:nth-child(6) {
  width: 132px;
}

.monitoramento-time-cell strong,
.monitoramento-time-cell small,
.monitoramento-detail-table td small {
  display: block;
}

.monitoramento-time-cell strong {
  color: #0f172a;
  font-size: 0.82rem;
}

.monitoramento-time-cell small {
  color: #64748b;
  font-size: 0.68rem;
}

.monitoramento-location-cell,
.monitoramento-city-cell,
.monitoramento-doc-cell,
.monitoramento-client-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitoramento-doc-cell {
  color: #0f172a;
  font-weight: 700;
}

.monitoramento-detail-table {
  width: 100%;
  min-width: 0;
}

@media (max-width: 980px) {
  .monitoramento-filters-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .monitoramento-check,
  .monitoramento-filter-actions {
    align-self: end;
  }
}

@media (max-width: 620px) {
  .monitoramento-filters-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .monitoramento-check {
    white-space: normal;
  }

  .monitoramento-filter-actions,
  .monitoramento-filter-actions button {
    width: 100%;
  }
}

@media (max-width: 1180px) {
  .monitoramento-route-header,
  .monitoramento-visual-grid {
    grid-template-columns: 1fr;
  }

  .monitoramento-kpi-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .monitoramento-doc-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .monitoramento-quick-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .monitoramento-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitoramento-doc-extra dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitoramento-leaflet-map {
    height: 340px;
    min-height: 340px;
  }
}

.agregado-vigencia-grid {
  display: grid;
  gap: 8px;
}

.agregados-cadastro-table,
.agregados-custos-table {
  min-width: 1450px;
}

.agregados-cadastro-table {
  min-width: 1220px;
}

.agregados-cadastro-table thead th,
.agregados-cadastro-table tbody td {
  padding: 8px 10px;
  font-size: 11px;
}

.agregados-cadastro-table .vehicle-cell-input,
.agregados-cadastro-table .agregado-inline-check span {
  font-size: 11px;
}

.agregados-cadastro-table .vehicle-cell-input {
  min-height: 32px;
  padding: 6px 8px;
}

.agregados-cadastro-table .vehicle-actions {
  gap: 6px;
}

.agregados-cadastro-table .btn-save-vehicle,
.agregados-cadastro-table .btn-delete-vehicle {
  height: 32px;
  min-width: 68px;
  padding: 0 10px;
  font-size: 11px;
}

.agregados-ctrcs-table {
  min-width: 1700px;
}

@media (max-width: 1366px) {
  .agregados-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .agregados-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .agregados-filters-grid,
  .agregados-form,
  .agregados-cards {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.finance-menu a:hover {
  background: rgba(255, 255, 255, 0.10);
}

.finance-menu a.is-active,
.finance-menu a[aria-current="page"] {
  background: #f4f3ed;
  color: #12392f;
  font-weight: 800;
}

.finance-menu-group {
  margin: 14px 10px 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 243, 237, 0.58);
  white-space: nowrap;
}

.finance-main {
  min-width: 0;
  padding: 32px 20px;
  background: #eef1ec;
}

.finance-user-panel {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finance-user-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.finance-user-label {
  font-size: 0.7rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.finance-user-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
}

.finance-logout-form {
  margin: 0;
  flex: 0 0 auto;
}

.finance-logout-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.finance-logout-button:hover {
  background: rgba(220, 53, 69, 0.18);
  border-color: rgba(220, 53, 69, 0.45);
}

.finance-logout-button:active {
  transform: translateY(1px);
}

.finance-logout-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.finance-logout-icon {
  font-size: 1rem;
  line-height: 1;
}

.finance-layout.is-sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.finance-layout.is-sidebar-collapsed .finance-sidebar-title,
.finance-layout.is-sidebar-collapsed .finance-menu-group,
.finance-layout.is-sidebar-collapsed .todo-note,
.finance-layout.is-sidebar-collapsed .finance-user-info,
.finance-layout.is-sidebar-collapsed .finance-logout-text {
  display: none;
}

.finance-layout.is-sidebar-collapsed .finance-sidebar-brand {
  justify-content: center;
}

.finance-layout.is-sidebar-collapsed .finance-sidebar-logo {
  width: 36px;
}

.finance-layout.is-sidebar-collapsed .fin-sidebar,
.finance-layout.is-sidebar-collapsed .finance-sidebar {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.finance-layout.is-sidebar-collapsed .finance-sidebar-top {
  justify-content: center;
  padding-inline: 8px;
}

.finance-layout.is-sidebar-collapsed .finance-menu {
  padding-inline: 8px;
  gap: 8px;
}

.finance-layout.is-sidebar-collapsed .finance-menu a {
  width: 40px;
  height: 40px;
  min-height: 40px;
  justify-content: center;
  padding: 0;
  overflow: visible;
}

.finance-layout.is-sidebar-collapsed .finance-menu a span {
  display: none;
}

.finance-layout.is-sidebar-collapsed .finance-menu a::before {
  display: flex;
}

.finance-layout.is-sidebar-collapsed .finance-menu a:hover {
  transform: translateX(1px);
}

.finance-layout.is-sidebar-collapsed .finance-user-panel {
  justify-content: center;
  padding-inline: 6px;
}

.finance-layout.is-sidebar-collapsed .finance-logout-button {
  width: 34px;
  padding-inline: 0;
}

@media (max-width: 1440px) and (max-height: 900px) {
  .finance-sidebar {
    padding: 18px 9px;
  }

  .finance-sidebar-top {
    margin-bottom: 18px;
  }

  .finance-sidebar-title {
    font-size: 1.18rem;
    padding: 0 8px;
  }

  .finance-menu {
    gap: 2px;
  }

  .finance-menu a {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.84rem;
    border-radius: 8px;
  }

  .finance-menu-group {
    margin-top: 10px;
    padding: 0 9px 3px;
    font-size: 0.62rem;
  }

  .finance-main {
    padding: 24px 18px;
  }
}

@media (max-width: 1368px) and (max-height: 780px) {
  .finance-sidebar {
    padding: 14px 7px;
  }

  .finance-sidebar-top {
    margin-bottom: 14px;
  }

  .finance-sidebar-title {
    font-size: 1.05rem;
  }

  .finance-menu a {
    min-height: 31px;
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .finance-main {
    padding: 20px 16px;
  }
}

@media (max-width: 760px) {
  .finance-layout {
    display: block;
  }

  .fin-sidebar,
  .finance-sidebar,
  .finance-layout.is-sidebar-collapsed .fin-sidebar,
  .finance-layout.is-sidebar-collapsed .finance-sidebar {
    position: relative;
    width: 100%;
    min-width: 100%;
    height: auto;
    padding: 14px 12px;
  }

  .finance-sidebar-top {
    margin-bottom: 12px;
  }

  .finance-menu a {
    min-height: 38px;
    padding: 8px 10px;
  }

  .finance-layout.is-sidebar-collapsed .finance-sidebar-title,
  .finance-layout.is-sidebar-collapsed .finance-menu-group {
    display: block;
  }

  .finance-main {
    padding: 18px 12px;
  }

  .finance-layout.is-sidebar-collapsed {
    grid-template-columns: 100%;
  }

  .finance-layout.is-sidebar-collapsed .finance-menu a span,
  .finance-layout.is-sidebar-collapsed .todo-note,
  .finance-layout.is-sidebar-collapsed .finance-user-info,
  .finance-layout.is-sidebar-collapsed .finance-logout-text {
    display: block;
  }

  .finance-layout.is-sidebar-collapsed .finance-menu a::before {
    display: none;
  }

  .finance-layout.is-sidebar-collapsed .finance-menu a {
    width: auto;
    height: auto;
    min-height: 38px;
    justify-content: flex-start;
    padding: 8px 10px;
  }

  .finance-user-panel {
    width: 100%;
    padding-inline: 8px;
  }

  .finance-user-name {
    max-width: 100%;
  }
}

.finance-login-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(41, 90, 73, 0.18), transparent 42%), linear-gradient(180deg, #edf2ee 0%, #e1e9e3 100%);
}

.finance-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.finance-login-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(18, 57, 47, 0.12);
  border-radius: 22px;
  box-shadow: 0 24px 54px rgba(18, 57, 47, 0.14);
  padding: 28px;
  display: grid;
  gap: 20px;
}

.finance-login-logo {
  width: min(220px, 100%);
  height: auto;
  display: block;
  margin: 0 0 14px;
}

.finance-login-copy h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  color: #12392f;
}

.finance-login-eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 700;
  color: #5d746a;
}

.finance-login-subtitle {
  margin: 0;
  color: #4c6158;
  line-height: 1.5;
}

.finance-login-form {
  display: grid;
  gap: 14px;
}

.finance-login-field {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #17322a;
}

.finance-login-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bfd0c5;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.finance-login-field input:focus-visible {
  outline: 2px solid rgba(18, 57, 47, 0.35);
  outline-offset: 1px;
}

.finance-login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fde6e6;
  color: #992f2f;
  font-size: 0.9rem;
}

.finance-login-submit {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #12392f;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.finance-login-submit:hover {
  background: #18493c;
}

@media (max-width: 760px) {
  .finance-login-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .finance-login-copy h1 {
    font-size: 1.7rem;
  }
}

/* =========================================================
   Correção definitiva - Fluxo de Caixa em notebook 14"
   ========================================================= */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

.finance-layout {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.finance-main,
.main-content,
.page-content,
.fluxo-page {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.fluxo-page {
  display: grid;
  gap: 14px;
  padding: 0;
}

.fluxo-header {
  margin-bottom: 2px;
  min-width: 0;
}

.fluxo-header h3 {
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0;
}

.fluxo-header h4,
.fluxo-header .page-title {
  margin: 0 0 4px;
}

.fluxo-header p,
.fluxo-header .page-subtitle {
  margin: 0;
  font-size: 0.88rem;
}

.fluxo-filters,
.fluxo-filter-card,
.fluxo-page .filters-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.fluxo-filters-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, 0.8fr);
  gap: 10px;
  align-items: end;
  width: 100%;
  max-width: 100%;
}

.fluxo-filters-grid > * {
  min-width: 0;
}

.fluxo-filters-grid label,
.fluxo-filters-grid .form-label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 4px;
  color: #17322a;
  min-width: 0;
}

.fluxo-filters-grid input,
.fluxo-filters-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 5px 10px;
  font-size: 0.86rem;
}

.fluxo-filter-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 8px;
  width: auto;
  min-width: 0;
  margin-top: 10px;
}

.fluxo-filter-actions .action-button,
.fluxo-filter-actions button,
.fluxo-filter-actions a {
  width: auto;
  min-width: 120px;
  max-width: 180px;
  height: 34px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fluxo-filters-grid .fluxo-filter-actions {
  grid-column: auto;
}

.fluxo-cards,
.metric-grid.fluxo-cards,
.fluxo-page .metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.fluxo-cards > *,
.metric-grid.fluxo-cards > *,
.fluxo-page .metric-grid > * {
  min-width: 0;
}

.fluxo-cards .metric-card {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 12px;
}

.fluxo-cards .metric-card h4,
.fluxo-cards .metric-card .metric-title {
  font-size: 0.75rem;
  margin: 0 0 7px;
  letter-spacing: 0.06em;
}

.fluxo-cards .metric-card strong,
.fluxo-cards .metric-card .metric-value {
  display: block;
  font-size: 1.18rem;
  line-height: 1.15;
  word-break: break-word;
}

.fluxo-card .card-meta,
.fluxo-cards .metric-card p {
  font-size: 0.76rem;
  line-height: 1.3;
  margin: 5px 0 0;
}

.fluxo-status-row {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  gap: 8px;
}

.fluxo-data-note {
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.fluxo-hero-grid,
.fluxo-two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  max-width: 100%;
}

.fluxo-page .card,
.fluxo-page .panel,
.fluxo-page .section-card,
.fluxo-page .panel-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px 16px;
  overflow: hidden;
}

.fluxo-chart-area {
  min-height: 220px;
}

.fluxo-chart-svg {
  width: 100%;
  max-width: 100%;
  height: 190px;
}

.fluxo-table-wrapper,
.fluxo-table-scroll,
.fluxo-table-wrap,
.fluxo-page .dre-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 320px;
}

.fluxo-table {
  min-width: 900px;
  width: max-content;
  font-size: 0.82rem;
}

@media (max-width: 1368px) {
  .finance-main,
  .main-content,
  .page-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .fluxo-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fluxo-filter-actions {
    justify-content: flex-start;
  }

  .fluxo-cards,
  .metric-grid.fluxo-cards,
  .fluxo-page .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .fluxo-cards .metric-card {
    min-height: 92px;
    padding: 10px 11px;
  }

  .fluxo-cards .metric-card strong,
  .fluxo-cards .metric-card .metric-value {
    font-size: 1.05rem;
  }

  .fluxo-page .card,
  .fluxo-page .panel,
  .fluxo-page .section-card,
  .fluxo-page .panel-card {
    padding: 12px 14px;
  }
}

@media (max-width: 1368px) and (max-height: 780px) {
  .fluxo-page {
    gap: 10px;
  }

  .fluxo-header h3 {
    font-size: 1.22rem;
  }

  .fluxo-header p,
  .fluxo-header .page-subtitle {
    font-size: 0.82rem;
  }

  .fluxo-filters-grid input,
  .fluxo-filters-grid select {
    height: 31px;
    min-height: 31px;
    font-size: 0.8rem;
  }

  .fluxo-filter-actions .action-button,
  .fluxo-filter-actions button,
  .fluxo-filter-actions a {
    height: 31px;
    min-height: 31px;
    font-size: 0.78rem;
  }

  .fluxo-cards .metric-card {
    min-height: 84px;
  }

  .fluxo-chart-area {
    min-height: 200px;
  }

  .fluxo-chart-svg {
    height: 170px;
  }
}

@media (max-width: 1100px) {
  .fluxo-cards,
  .metric-grid.fluxo-cards,
  .fluxo-page .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fluxo-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .finance-layout {
    display: block;
  }

  .finance-sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
  }

  .finance-main,
  .main-content,
  .page-content {
    padding: 14px 12px;
  }

  .fluxo-filters-grid {
    grid-template-columns: 1fr;
  }

  .fluxo-filter-actions {
    width: 100%;
  }

  .fluxo-filter-actions .action-button,
  .fluxo-filter-actions button,
  .fluxo-filter-actions a {
    width: 100%;
    max-width: none;
  }

  .fluxo-cards,
  .metric-grid.fluxo-cards,
  .fluxo-page .metric-grid {
    grid-template-columns: 1fr;
  }
}

.folha-page {
  display: grid;
  gap: 14px;
  padding-bottom: 24px;
}

.folha-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin-top: 0;
}

.folha-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

.folha-header h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.15;
}

.folha-header .note {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.folha-filters {
  flex: 1;
  max-width: 560px;
  margin: 0;
}

.folha-filters-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
}

.folha-filters .filter-field {
  font-size: 0.76rem;
}

.folha-filters select {
  min-height: 36px;
  height: 36px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.folha-card {
  background: #fff;
  border: 1px solid #e2e9e4;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(21, 35, 28, 0.08);
  padding: 12px 14px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  overflow: hidden;
}

.folha-card-label {
  font-size: 0.62rem;
  line-height: 1.1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folha-card-value {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.2rem, 1.5vw, 1.55rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #071c22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folha-card-value.is-neutral {
  letter-spacing: -0.02em;
}

.folha-card-detail,
.folha-card-meta {
  display: block;
  font-size: 0.68rem;
  line-height: 1.2;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folha-card-detail {
  color: #334155;
}

.folha-card-meta {
  color: #64748b;
}

.folha-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.folha-chart-area {
  min-height: 150px;
  max-height: 190px;
  overflow: hidden;
}

.folha-chart-row {
  min-height: 26px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
}

.folha-line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.folha-line {
  fill: none;
  stroke-width: 3;
}

.folha-line-primary {
  stroke: #214e40;
}

.folha-line-secondary {
  stroke: #c18b3b;
  stroke-dasharray: 8 6;
}

.folha-legend-secondary {
  background: #c18b3b;
}

.folha-table-wrapper {
  max-width: 100%;
  overflow: auto;
}

.folha-page .panel-card {
  border-radius: 14px;
  padding: 12px 14px;
}

.folha-page .section-header {
  margin-bottom: 8px;
}

.folha-page .section-header h3 {
  font-size: 1rem;
  margin: 0;
}

.folha-table-compact {
  font-size: 0.76rem;
  min-width: 980px;
}

.folha-table-compact th,
.folha-table-compact td {
  padding: 6px 8px;
  line-height: 1.15;
  white-space: nowrap;
}

.folha-table-compact thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.folha-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folha-toolbar input {
  min-width: 240px;
}

.folha-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fbf9;
}

.folha-table tbody .folha-sticky-col {
  background: #fff;
  font-weight: 600;
}

.folha-page section.panel-card:last-of-type .folha-table-wrapper {
  max-height: min(520px, calc(100vh - 260px));
  overflow: auto;
}

.folha-sort-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.folha-sort-button.is-active {
  color: #214e40;
}

.folha-funcionario-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1366px) {
  body.folha-page-active .fin-content,
  body.folha-page-active .finance-main,
  body.folha-page-active .main-content {
    padding-top: 10px;
  }

  body.folha-page-active .fin-header {
    display: none;
  }

  body.folha-page-active .folha-page {
    gap: 10px;
  }

  body.folha-page-active .folha-header {
    align-items: center;
  }

  body.folha-page-active .folha-header .note {
    display: none;
  }

  body.folha-page-active .folha-header h3 {
    font-size: 1.15rem;
  }

  body.folha-page-active .folha-cards {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 8px;
  }

  body.folha-page-active .folha-card {
    min-height: 88px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  body.folha-page-active .folha-card-value {
    font-size: 1.25rem;
  }

  body.folha-page-active .folha-card-detail,
  body.folha-page-active .folha-card-meta {
    font-size: 0.64rem;
  }

  body.folha-page-active .folha-card--secondary {
    display: none;
  }

  body.folha-page-active .folha-chart-area {
    min-height: 130px;
    max-height: 160px;
  }

  body.folha-page-active .folha-table-compact {
    font-size: 0.72rem;
  }

  body.folha-page-active .folha-table-compact th,
  body.folha-page-active .folha-table-compact td {
    padding: 5px 7px;
  }
}

@media (max-width: 1100px) {
  .folha-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .folha-filters {
    max-width: none;
  }

  .folha-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .folha-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .folha-filters-grid {
    grid-template-columns: 1fr;
  }

  .folha-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .folha-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .folha-toolbar input {
    min-width: 0;
    width: 100%;
  }
}

.folha-table-resumo-mobile {
  display: none;
}

/* =========================================================
   Folha de Pagamento - modo notebook compacto 1366x768
   ========================================================= */

@media (max-width: 1366px) {

  body.folha-page-active {
    overflow-x: hidden;
  }

  body.folha-page-active .fin-content,
  body.folha-page-active .finance-main,
  body.folha-page-active .main-content {
    padding: 8px 10px !important;
    min-width: 0;
    overflow-x: hidden;
  }

  body.folha-page-active .fin-header {
    display: none !important;
  }

  body.folha-page-active .folha-page {
    gap: 8px !important;
    padding-bottom: 12px !important;
  }

  body.folha-page-active .folha-header {
    display: grid !important;
    grid-template-columns: minmax(180px, 1fr) minmax(360px, 520px);
    align-items: end !important;
    gap: 10px !important;
    margin: 0 !important;
  }

  body.folha-page-active .folha-header h3 {
    font-size: 1rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
  }

  body.folha-page-active .folha-header .note {
    display: none !important;
  }

  body.folha-page-active .folha-filters {
    margin: 0 !important;
    max-width: none !important;
  }

  body.folha-page-active .folha-filters-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  body.folha-page-active .folha-filters .filter-field {
    font-size: 0.68rem !important;
    line-height: 1.1 !important;
    gap: 3px !important;
  }

  body.folha-page-active .folha-filters select {
    height: 30px !important;
    min-height: 30px !important;
    padding: 4px 9px !important;
    font-size: 0.75rem !important;
    border-radius: 9px !important;
  }

  body.folha-page-active .folha-cards {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin: 0 !important;
  }

  body.folha-page-active .folha-card--secondary {
    display: none !important;
  }

  body.folha-page-active .folha-card {
    min-height: 72px !important;
    max-height: 76px !important;
    padding: 8px 9px !important;
    border-radius: 10px !important;
    gap: 2px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
    overflow: hidden !important;
  }

  body.folha-page-active .folha-card-label {
    font-size: 0.54rem !important;
    line-height: 1 !important;
    letter-spacing: 0.06em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.folha-page-active .folha-card-value {
    font-size: 1.02rem !important;
    line-height: 1 !important;
    margin: 1px 0 0 !important;
    letter-spacing: -0.04em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.folha-page-active .folha-card-detail,
  body.folha-page-active .folha-card-meta {
    font-size: 0.55rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.folha-page-active .folha-card-meta {
    display: none !important;
  }

  body.folha-page-active .folha-card-detail {
    display: none !important;
  }

  body.folha-page-active .folha-card {
    justify-content: center !important;
  }

  body.folha-page-active .folha-page .panel-card {
    padding: 8px 10px !important;
    border-radius: 11px !important;
  }

  body.folha-page-active .folha-page .section-header {
    margin-bottom: 5px !important;
    min-height: 0 !important;
  }

  body.folha-page-active .folha-page .section-header h3 {
    font-size: 0.86rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
  }

  body.folha-page-active .folha-chart-grid {
    display: none !important;
  }

  body.folha-page-active .folha-table-wrapper {
    max-width: 100% !important;
    overflow: auto !important;
  }

  body.folha-page-active .folha-table-compact {
    font-size: 0.64rem !important;
    min-width: 900px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  body.folha-page-active .folha-table-compact th,
  body.folha-page-active .folha-table-compact td {
    padding: 4px 6px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  body.folha-page-active .folha-table-compact thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
  }

  body.folha-page-active .folha-page > section.panel-card:first-of-type .folha-table-wrapper {
    max-height: 190px !important;
  }

  body.folha-page-active .folha-page > section.panel-card:last-of-type .folha-table-wrapper {
    max-height: 310px !important;
    overflow: auto !important;
  }

  body.folha-page-active .folha-toolbar {
    gap: 6px !important;
  }

  body.folha-page-active .folha-toolbar input[type="search"] {
    height: 28px !important;
    min-height: 28px !important;
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
    border-radius: 8px !important;
  }

  body.folha-page-active .folha-toolbar .note {
    font-size: 0.68rem !important;
  }

  body.folha-page-active .folha-sticky-col {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
  }

  body.folha-page-active thead .folha-sticky-col {
    z-index: 4 !important;
  }

  body.folha-page-active .folha-funcionario-cell {
    max-width: 210px !important;
    min-width: 210px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.folha-page-active .folha-table-resumo-desktop {
    display: none !important;
  }

  body.folha-page-active .folha-table-resumo-mobile {
    display: table !important;
    min-width: 0 !important;
    width: 100% !important;
    font-size: 0.72rem !important;
  }

  body.folha-page-active .folha-table-resumo-mobile th,
  body.folha-page-active .folha-table-resumo-mobile td {
    padding: 5px 7px !important;
  }
}

/* =========================================================
   Folha de Pagamento - layout painel notebook
   ========================================================= */

@media (max-width: 1366px) {
  body.folha-page-active {
    overflow: hidden;
  }

  body.folha-page-active .fin-header {
    display: none !important;
  }

  body.folha-page-active .fin-content,
  body.folha-page-active .finance-main,
  body.folha-page-active .main-content {
    height: 100vh;
    overflow: hidden;
    padding: 8px 10px !important;
    min-width: 0;
  }

  body.folha-page-active .folha-page {
    height: calc(100vh - 16px);
    display: grid;
    grid-template-rows: 36px 58px 150px minmax(0, 1fr);
    gap: 8px !important;
    overflow: hidden;
    padding: 0 !important;
  }

  body.folha-page-active .folha-topbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 420px;
    align-items: center;
    gap: 10px;
    min-height: 0;
  }

  body.folha-page-active .folha-topbar h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1;
    font-weight: 800;
  }

  body.folha-page-active .folha-topbar .note,
  body.folha-page-active .folha-header .note {
    display: none !important;
  }

  body.folha-page-active .folha-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 !important;
    max-width: none !important;
  }

  body.folha-page-active .folha-filters .filter-field {
    font-size: 0.64rem;
    line-height: 1;
    gap: 2px;
  }

  body.folha-page-active .folha-filters select {
    height: 26px !important;
    min-height: 26px !important;
    padding: 3px 8px !important;
    font-size: 0.7rem !important;
    border-radius: 8px !important;
  }

  body.folha-page-active .folha-kpi-strip,
  body.folha-page-active .folha-cards {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
    min-height: 0;
    margin: 0 !important;
  }

  body.folha-page-active .folha-card {
    min-height: 58px !important;
    max-height: 58px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 3px !important;
    overflow: hidden !important;
  }

  body.folha-page-active .folha-card:nth-child(n+6),
  body.folha-page-active .folha-card--secondary {
    display: none !important;
  }

  body.folha-page-active .folha-card-label {
    font-size: 0.55rem !important;
    line-height: 1 !important;
    letter-spacing: 0.05em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.folha-page-active .folha-card-value {
    font-size: 1.05rem !important;
    line-height: 1 !important;
    font-weight: 850 !important;
    letter-spacing: -0.04em !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.folha-page-active .folha-card-detail,
  body.folha-page-active .folha-card-meta {
    display: none !important;
  }

  body.folha-page-active .folha-dashboard-row {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }

  body.folha-page-active .folha-page .panel-card {
    padding: 8px 10px !important;
    border-radius: 11px !important;
    min-height: 0;
    overflow: hidden;
  }

  body.folha-page-active .folha-page .section-header {
    min-height: 0 !important;
    margin-bottom: 5px !important;
  }

  body.folha-page-active .folha-page .section-header h3 {
    font-size: 0.82rem !important;
    line-height: 1 !important;
    margin: 0 !important;
  }

  body.folha-page-active .folha-resumo-card,
  body.folha-page-active .folha-composicao-card {
    height: 150px;
  }

  .folha-composicao-card {
    overflow: auto !important;
  }

  body.folha-page-active .folha-table-wrapper {
    width: 100%;
    overflow: auto;
  }

  body.folha-page-active .folha-table-resumo-mobile {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    font-size: 0.68rem !important;
  }

  body.folha-page-active .folha-table-resumo-mobile th,
  body.folha-page-active .folha-table-resumo-mobile td {
    padding: 4px 6px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  body.folha-page-active .folha-table-resumo-mobile thead th {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  body.folha-page-active .folha-composicao-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    max-height: 100%;
    padding-right: 2px;
  }

  body.folha-page-active .folha-composicao-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 9px;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.72);
    min-height: 42px;
  }

  body.folha-page-active .folha-composicao-label {
    display: block;
    font-size: 0.55rem;
    line-height: 1;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
  }

  body.folha-page-active .folha-composicao-value {
    display: block;
    font-size: 0.86rem;
    line-height: 1;
    font-weight: 800;
    color: #071c22;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.folha-page-active .folha-chart-grid {
    display: none !important;
  }

  body.folha-page-active .folha-funcionarios-card {
    min-height: 0;
    overflow: hidden;
  }

  body.folha-page-active .folha-funcionarios-header {
    display: grid !important;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  body.folha-page-active .folha-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }

  body.folha-page-active .folha-toolbar input[type="search"] {
    width: 260px;
    height: 26px !important;
    min-height: 26px !important;
    padding: 3px 8px !important;
    font-size: 0.68rem !important;
    border-radius: 8px !important;
  }

  body.folha-page-active .folha-toolbar .note {
    font-size: 0.65rem !important;
  }

  body.folha-page-active .folha-funcionarios-scroll {
    max-height: calc(100vh - 342px);
    overflow: auto !important;
  }

  body.folha-page-active .folha-table-compact {
    font-size: 0.63rem !important;
    min-width: 980px !important;
  }

  body.folha-page-active .folha-table-compact th,
  body.folha-page-active .folha-table-compact td {
    padding: 3px 6px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  body.folha-page-active .folha-table-compact thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
  }

  body.folha-page-active .folha-sticky-col {
    position: sticky !important;
    left: 0 !important;
    z-index: 4 !important;
  }

  body.folha-page-active thead .folha-sticky-col {
    z-index: 6 !important;
  }

  body.folha-page-active .folha-funcionario-cell {
    max-width: 240px !important;
    min-width: 240px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

body.folha-page-active .folha-table-resumo-desktop,
  body.folha-page-active .folha-data-cache {
    display: none !important;
  }
}

.horas-page {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.horas-topbar,
.horas-table-toolbar,
.horas-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.horas-title-block {
  min-width: 260px;
}

.horas-topbar h3,
.horas-table-toolbar h3 {
  margin: 0;
  line-height: 1.15;
}

.horas-header-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 4px 0 0;
  font-size: 12px;
}

.horas-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.14);
}

.horas-status-dot.is-active {
  background: #138347;
  box-shadow: 0 0 0 3px rgba(19, 131, 71, 0.14);
}

.horas-status-dot.is-error {
  background: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
}

.horas-actions button,
.horas-actions .action-button,
.horas-filter-actions button,
.horas-modal-header button {
  border: 0;
  border-radius: 7px;
  min-height: 36px;
  padding: 8px 11px;
  background: #17322a;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.horas-actions .secondary,
.horas-filter-actions button[type="button"],
.horas-modal-header button {
  background: #e7eee9;
  color: #17322a;
}

.horas-status-message {
  color: #9a3412;
}

.horas-filters {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid #dbe6df;
  border-radius: 8px;
}

.horas-filter-row {
  display: grid;
  gap: 8px;
  align-items: end;
}

.horas-filter-row[hidden] {
  display: none;
}

.horas-filter-row-main {
  grid-template-columns: minmax(126px, 0.85fr) minmax(110px, 0.75fr) minmax(140px, 1fr) minmax(170px, 1.35fr) minmax(170px, 0.9fr);
}

.horas-filter-row-advanced {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.horas-filters label {
  display: grid;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #42534a;
  text-transform: uppercase;
}

.horas-filters input,
.horas-filters select {
  min-width: 0;
  height: 36px;
  padding: 6px 9px;
  border: 1px solid #b7c6bb;
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  text-transform: none;
}

.horas-check {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 6px !important;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid #dbe6df;
  border-radius: 7px;
  background: #f8faf8;
}

.horas-check input {
  width: auto;
  height: auto;
}

.horas-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.horas-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.horas-card {
  border-radius: 8px;
  padding: 10px 11px;
  min-width: 0;
}

.horas-card span {
  font-size: 11px;
  line-height: 1.1;
}

.horas-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.horas-card-submetrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 7px;
}

.horas-card-submetrics small {
  color: #58665e;
  font-size: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.horas-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.horas-chart-grid .panel-card,
.horas-structure-card,
.horas-table-card {
  border-radius: 8px;
}

.horas-structure-card {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: none;
  border: 1px solid #dfe8e2;
}

.horas-structure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.horas-structure-title-block {
  min-width: 220px;
}

.horas-structure-header h3 {
  margin: 0;
  line-height: 1.2;
  font-size: 18px;
}

.horas-structure-header .note {
  margin: 3px 0 0;
  color: #65736d;
  font-size: 13px;
}

.horas-structure-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  margin-bottom: 10px;
}

.horas-structure-tabs {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  padding: 3px !important;
  border: 0 !important;
  border-radius: 9px;
  background: #eef3ef;
}

.horas-structure-tabs button {
  appearance: none;
  min-height: 32px !important;
  height: 32px;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #40534a !important;
  box-shadow: none !important;
  font-weight: 800;
  font-size: 12px !important;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.horas-structure-tabs button[aria-selected="true"] {
  background: #17322a !important;
  color: #fff !important;
  box-shadow: none !important;
}

.horas-structure-chart-toggle,
.horas-structure-empty button {
  appearance: none;
  flex: 0 0 auto;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #cfdcd4;
  border-radius: 7px;
  background: #fff;
  color: #27483d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.horas-structure-tabs button:focus-visible,
.horas-structure-chart-toggle:focus-visible,
.horas-structure-empty button:focus-visible,
.horas-structure-panel:focus-visible {
  outline: 2px solid #356b54;
  outline-offset: 2px;
}

.horas-structure-kpis {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  min-width: 0;
}

.horas-structure-kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 118px;
  min-height: 34px;
  padding: 0 14px;
  border-left: 1px solid #dce4df;
  background: transparent;
}

.horas-structure-kpi:first-child {
  border-left: 0;
}

.horas-structure-kpi span {
  display: block;
  color: #66736d;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.horas-structure-kpi strong {
  display: block;
  margin-top: 3px;
  max-width: 190px;
  overflow: hidden;
  color: #163f34;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.horas-structure-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.horas-structure-table-wrapper {
  border: 1px solid #e1e8e3;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
}

.horas-structure-table {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  table-layout: fixed;
  font-size: 11.5px;
}

.horas-structure-table th,
.horas-structure-table td {
  padding: 5px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horas-structure-table th:first-child,
.horas-structure-table td:first-child {
  width: 24%;
  text-align: left;
}

.horas-structure-table th:nth-last-child(-n + 6),
.horas-structure-table td:nth-last-child(-n + 6) {
  font-variant-numeric: tabular-nums;
}

.horas-structure-table tbody tr:hover td {
  background: #f6faf7;
}

.horas-structure-table .num {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.horas-structure-table tfoot td {
  border-top: 1px solid #d6e0da;
  background: #f7faf8;
  font-weight: 800;
}

.horas-structure-chart {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e1e8e3;
  border-radius: 8px;
  background: #fbfdfc;
}

.horas-structure-chart[hidden],
.horas-structure-panel[hidden],
.horas-structure-empty[hidden],
.horas-structure-error[hidden],
.horas-structure-kpis[hidden] {
  display: none !important;
}

.horas-structure-chart h4 {
  margin-bottom: 8px;
  color: #1f352b;
  font-size: 13px;
}

.horas-structure-empty,
.horas-structure-error {
  min-height: 104px;
  max-height: 140px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 14px;
  border: 1px dashed #cfdcd4;
  border-radius: 8px;
  background: #fbfcfb;
  color: #52635d;
}

.horas-structure-empty strong,
.horas-structure-error {
  color: #17322a;
}

.horas-structure-error {
  border-color: #efc2c2;
  background: #fff7f7;
  color: #8a1f1f;
  font-weight: 800;
}

.horas-share-cell {
  display: inline-grid;
  grid-template-columns: 48px 42px;
  gap: 6px;
  align-items: center;
  justify-content: end;
  max-width: 108px;
  font-variant-numeric: tabular-nums;
}

.horas-share-bar {
  display: block;
  width: 48px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ef;
}

.horas-share-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6f927f;
}

.horas-share-cell strong {
  color: #40534a;
  font-size: 11px;
  text-align: right;
}

.horas-table-card {
  margin-top: 18px;
  min-width: 0;
}

.horas-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.horas-table {
  min-width: 1040px;
  font-size: 12px;
  table-layout: fixed;
}

.horas-table th,
.horas-table td {
  white-space: nowrap;
  padding: 7px 8px;
  vertical-align: middle;
  text-align: center;
}

.horas-table th:first-child,
.horas-table td:first-child {
  text-align: left;
}

.horas-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.horas-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  white-space: normal !important;
}

thead .horas-sticky-col {
  z-index: 4;
  background: #edf4ef;
}

.horas-department-cell {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.horas-table .num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.horas-table .strong {
  font-weight: 800;
}

.horas-table .is-total {
  color: #0f5c3a;
}

.horas-table .is-amber {
  color: #8a5a00;
  font-weight: 700;
}

.horas-table .is-bank {
  color: #1d4f91;
}

.horas-table .is-negative {
  color: #b42318;
  font-weight: 700;
}

.horas-table .is-missing-hours {
  color: #b42318;
  font-weight: 800;
}

.horas-table .is-zero {
  color: #9aa4a0;
}

.horas-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.horas-sort-button span {
  min-width: 10px;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1;
}

.horas-sort-button.is-active,
.horas-sort-button.is-active span {
  color: #0f5c3a;
}

.horas-sort-button:focus-visible {
  outline: 2px solid #356b54;
  outline-offset: 2px;
}

.horas-clickable-row {
  cursor: pointer;
}

.horas-clickable-row:hover td,
.horas-clickable-row:focus td {
  background: #f4faf6;
}

.horas-clickable-row:focus {
  outline: 2px solid #356b54;
  outline-offset: -2px;
}

.horas-table-toolbar {
  align-items: flex-start;
  margin-bottom: 8px;
}

.horas-table-toolbar .note {
  margin: 3px 0 0;
  font-size: 12px;
}

.horas-table-search {
  display: block;
}

.horas-table-toolbar input {
  width: min(300px, 34vw);
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #b7c6bb;
  border-radius: 7px;
}

.horas-filters input:focus-visible,
.horas-filters select:focus-visible,
.horas-actions button:focus-visible,
.horas-actions a:focus-visible,
.horas-filter-actions button:focus-visible,
.horas-table-toolbar input:focus-visible,
.horas-structure-tabs button:focus-visible,
.horas-modal-header button:focus-visible {
  outline: 2px solid #356b54;
  outline-offset: 2px;
}

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

.horas-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 20px;
}

.horas-modal[hidden] {
  display: none;
}

.horas-modal-panel {
  width: min(1180px, 96vw);
  height: calc(100vh - 40px);
  max-height: 88vh;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.horas-modal-panel .horas-detail-wrapper {
  flex: 1 1 0;
  min-height: 0;
  height: calc(100vh - 150px);
  max-height: calc(88vh - 88px);
  overflow-x: auto !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable;
}

.horas-modal-panel .horas-detail-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.horas-modal-panel .horas-detail-wrapper::-webkit-scrollbar-track {
  background: #eef2f7;
}

.horas-modal-panel .horas-detail-wrapper::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #eef2f7;
}

.horas-modal-panel .horas-detail-table {
  margin-bottom: 0;
}

.horas-modal-panel .horas-detail-wrapper .horas-table thead th {
  top: 0;
  z-index: 3;
}

.horas-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.horas-modal-header h3 {
  margin: 0;
}

@media (max-width: 1366px) {
  body.horas-extras-page-active .fin-header {
    display: none;
  }

  body.horas-extras-page-active .fin-content,
  body.horas-extras-page-active .finance-main,
  body.horas-extras-page-active .main-content {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 10px !important;
  }

  body.horas-extras-page-active .horas-page {
    gap: 8px;
    overflow: visible;
  }

  body.horas-extras-page-active .horas-topbar h3 {
    font-size: 1.05rem;
    line-height: 1;
  }

  body.horas-extras-page-active .horas-topbar .note {
    font-size: 11px;
  }

  body.horas-extras-page-active .horas-actions button,
  body.horas-extras-page-active .horas-actions .action-button,
  body.horas-extras-page-active .horas-filter-actions button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 11px;
  }

  body.horas-extras-page-active .horas-filters {
    gap: 6px;
    padding: 8px;
  }

  body.horas-extras-page-active .horas-filter-row-main {
    grid-template-columns: 126px 96px minmax(128px, 1fr) minmax(150px, 1.2fr) 160px;
  }

  body.horas-extras-page-active .horas-filter-row-advanced {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
  }

  body.horas-extras-page-active .horas-filters label {
    font-size: 0.58rem;
  }

  body.horas-extras-page-active .horas-filters input,
  body.horas-extras-page-active .horas-filters select {
    height: 32px;
    padding: 4px 7px;
    font-size: 0.72rem;
  }

  body.horas-extras-page-active .horas-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  body.horas-extras-page-active .horas-card {
    min-height: 64px;
    padding: 8px 9px;
  }

  body.horas-extras-page-active .horas-card span {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.horas-extras-page-active .horas-card strong {
    font-size: 1rem;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.horas-extras-page-active .horas-card-submetrics {
    display: none;
  }

  body.horas-extras-page-active .horas-chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.horas-extras-page-active .horas-chart-grid .panel-card {
    max-height: 104px;
    overflow: hidden;
    padding: 8px;
  }

  body.horas-extras-page-active .horas-structure-card {
    gap: 8px;
    padding: 10px;
  }

  body.horas-extras-page-active .horas-structure-panel {
    gap: 8px;
  }

  body.horas-extras-page-active .horas-structure-chart {
    padding: 8px;
  }

  body.horas-extras-page-active .horas-structure-table {
    min-width: 0;
    font-size: 0.66rem;
  }

  body.horas-extras-page-active .horas-table-card {
    margin-top: 12px;
    padding: 8px;
  }

  body.horas-extras-page-active .horas-table {
    font-size: 0.68rem;
    min-width: 960px;
  }

  body.horas-extras-page-active .horas-table th,
  body.horas-extras-page-active .horas-table td {
    padding: 5px 6px;
  }

  body.horas-extras-page-active .horas-sticky-col {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
  }
}

@media (max-width: 1180px) {
  .horas-structure-toolbar,
  body.horas-extras-page-active .horas-structure-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .horas-structure-kpis,
  body.horas-extras-page-active .horas-structure-kpis {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .horas-structure-kpi,
  body.horas-extras-page-active .horas-structure-kpi {
    min-width: 140px;
  }
}

@media (max-width: 900px) {
  .horas-filter-row-main,
  .horas-filter-row-advanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .horas-cards,
  body.horas-extras-page-active .horas-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .horas-chart-grid,
  body.horas-extras-page-active .horas-chart-grid {
    grid-template-columns: 1fr;
  }

  .horas-structure-tabs {
    width: 100%;
  }

  .horas-structure-tabs button {
    flex: 1 1 0;
  }

  .horas-table-toolbar input {
    width: min(100%, 320px);
  }
}

@media (max-width: 720px) {
  .horas-structure-header,
  body.horas-extras-page-active .horas-structure-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .horas-structure-kpis,
  body.horas-extras-page-active .horas-structure-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    width: 100%;
  }

  .horas-structure-kpi,
  body.horas-extras-page-active .horas-structure-kpi {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #dce4df;
    border-radius: 8px;
  }
}

.freight-calc-page {
  display: grid;
  gap: 18px;
}

.freight-simulator-card {
  margin-bottom: 0;
}

.freight-simulator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.freight-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.freight-result-panel {
  background: #f5f8f5;
  border: 1px solid #dbe5de;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.freight-result-panel h4 {
  margin: 0;
  font-size: 0.95rem;
}

.freight-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.freight-result-grid div {
  background: #fff;
  border: 1px solid #e0e8e2;
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
}

.freight-result-grid span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c7e75;
  margin-bottom: 6px;
}

.freight-result-grid strong {
  display: block;
  font-size: 0.98rem;
  color: #17322a;
  overflow-wrap: anywhere;
}

.freight-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.freight-kpi-card {
  min-height: 110px;
}

.freight-table-wrapper,
.freight-matrix-wrapper {
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #dce6df;
}

.freight-table {
  min-width: 980px;
}

.freight-table th,
.freight-table td {
  white-space: nowrap;
}

.freight-calc-page .freight-table th,
.freight-calc-page .freight-table td {
  text-align: center;
}

.freight-calc-page .freight-table th:first-child,
.freight-calc-page .freight-table td:first-child {
  text-align: left;
}

.freight-table td.is-negative {
  color: #a73737;
  font-weight: 700;
}

.freight-warning-card {
  padding: 14px 16px;
}

.freight-warning-list {
  display: grid;
  gap: 6px;
}

@media (max-width: 1180px) {
  .freight-simulator-layout {
    grid-template-columns: 1fr;
  }

  .freight-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .freight-input-grid,
  .freight-result-grid,
  .freight-kpi-grid {
    grid-template-columns: 1fr;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.finance-layout,
.fin-shell,
.finance-main,
.fin-content,
.main-content,
.freight-calc-page {
  min-width: 0;
}

.finance-main,
.fin-content,
.main-content {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.freight-calc-page {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
}

.fin-header {
  padding: 14px 18px 8px;
  margin: 0;
}

.fin-header h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.resultado-section,
.settings-card {
  padding: 16px 18px;
  margin: 0;
  border-radius: 14px;
}

.resultado-header,
.section-header {
  margin-bottom: 12px;
}

.resultado-header-copy h3,
.section-header h3,
.settings-card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  line-height: 1.2;
}

.note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.filters {
  width: 100%;
  max-width: 100%;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.filter-field {
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.25;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 7px 10px;
  font-size: 0.86rem;
  border-radius: 9px;
}

.freight-simulator-card {
  overflow: hidden;
}

.freight-simulator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.freight-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  min-width: 0;
}

.freight-result-panel {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 14px;
  border-radius: 14px;
  overflow: hidden;
}

.freight-result-panel h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.freight-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.freight-result-grid > div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
}

.freight-result-grid span {
  display: block;
  font-size: 0.68rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.freight-result-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 0.9rem;
  line-height: 1.2;
  word-break: break-word;
}

.filter-actions {
  margin-top: 12px;
}

.filter-actions button {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.metrics-grid,
.freight-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card,
.kpi-card,
.freight-kpi-card {
  min-width: 0;
  padding: 13px;
  border-radius: 13px;
}

.kpi-title {
  font-size: 0.72rem;
  line-height: 1.2;
}

.kpi-value {
  font-size: 1rem;
  line-height: 1.2;
}

.rotas-kpi-subtitle {
  font-size: 0.75rem;
}

.freight-table-wrapper,
.freight-matrix-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ===== Auditoria de Mínimos ===== */

.auditoria-page {
  display: grid;
  gap: 14px;
  padding-bottom: 24px;
}

.auditoria-toolbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.auditoria-toolbar h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.auditoria-toolbar .filters-grid {
  margin-bottom: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: end;
}

.auditoria-toolbar .filter-field {
  font-size: 0.74rem;
}

.auditoria-toolbar .filter-field input,
.auditoria-toolbar .filter-field select {
  height: 34px;
  padding: 6px 9px;
  font-size: 0.82rem;
}

.auditoria-toolbar .filter-actions {
  margin-top: 0;
}

.auditoria-toolbar .filter-actions button {
  min-height: 34px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: #20483b;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.auditoria-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.auditoria-summary-grid .metric-card {
  padding: 12px;
}

.auditoria-summary-grid .kpi-value {
  font-size: 1.05rem;
}

.auditoria-alert-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.auditoria-alert-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff7ea 0%, #f7efe2 100%);
  border: 1px solid #ead8b7;
  min-width: 0;
}

.auditoria-alert-item span,
.auditoria-alert-item small {
  color: #68553a;
}

.auditoria-alert-item span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auditoria-alert-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
}

.auditoria-priority-table {
  overflow-x: auto;
}

.auditoria-priority-table table {
  min-width: 1180px;
  table-layout: fixed;
}

.auditoria-priority-table th,
.auditoria-priority-table td {
  padding: 8px 9px;
  font-size: 0.78rem;
  vertical-align: top;
}

.auditoria-priority-table th:nth-child(2),
.auditoria-priority-table td:nth-child(2),
.auditoria-sticky-client {
  position: sticky;
  left: 88px;
  z-index: 3;
  background: #fff;
}

.auditoria-priority-table thead th:nth-child(2) {
  background: #edf4ef;
  z-index: 5;
}

.auditoria-priority-table th:first-child,
.auditoria-priority-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  background: inherit;
}

.auditoria-priority-table thead th:first-child {
  background: #edf4ef;
  z-index: 6;
}

.auditoria-client-name {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auditoria-problem-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: normal;
  max-width: 280px;
}

.auditoria-problem-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f6e5cf;
  color: #8a5126;
  font-size: 0.69rem;
  font-weight: 700;
}

.auditoria-status-abaixo {
  background: #f7d8da;
  color: #8e2027;
}

.auditoria-status-sem_parametro {
  background: #f7efcd;
  color: #7b630b;
}

.auditoria-status-acima {
  background: #d7ecde;
  color: #1f6a38;
}

.auditoria-status-dado_inconsistente {
  background: #e8def5;
  color: #694393;
}

.auditoria-impact-negative {
  color: #9f2f2f;
  font-weight: 700;
}

.auditoria-impact-positive {
  color: #245e3c;
  font-weight: 700;
}

.auditoria-detail-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.auditoria-detail-summary .card {
  padding: 12px;
}

.auditoria-detail-summary .card-value {
  font-size: 0.98rem;
}

.auditoria-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.auditoria-detail-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dbe7e0;
  color: #17322a;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
}

.auditoria-detail-section .table-wrapper + .table-wrapper {
  margin-top: 12px;
}

.auditoria-route-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.auditoria-route-detail-header h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  color: #17322a;
}

.auditoria-route-detail-list {
  display: grid;
  gap: 14px;
}

.auditoria-route-detail-card {
  overflow: hidden;
  border: 1px solid #dce6df;
  border-radius: 8px;
  background: #fff;
}

.auditoria-route-detail-card h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #edf2ee;
  color: #172b24;
  font-size: 0.96rem;
  line-height: 1.2;
  text-align: left;
}

.auditoria-route-detail-card h4 small {
  color: #65756d;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}

.auditoria-route-detail-wrapper {
  overflow-x: auto;
}

.auditoria-route-detail-table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.auditoria-route-detail-table th,
.auditoria-route-detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2ee;
  color: #1c3028;
  font-size: 0.86rem;
  vertical-align: middle;
}

.auditoria-route-detail-table th {
  background: #f7faf8;
  color: #5d6b64;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.auditoria-route-detail-table th:first-child,
.auditoria-route-detail-table td:first-child {
  text-align: left;
}

.auditoria-route-detail-table th:nth-child(2),
.auditoria-route-detail-table th:nth-child(3),
.auditoria-route-detail-table th:nth-child(4),
.auditoria-route-detail-table td:nth-child(2),
.auditoria-route-detail-table td:nth-child(3),
.auditoria-route-detail-table td:nth-child(4) {
  text-align: center;
  white-space: nowrap;
}

.auditoria-route-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.auditoria-route-detail-metric {
  width: 180px;
  font-weight: 700;
}

@media (max-width: 1366px) {
  .auditoria-page {
    gap: 12px;
  }

  .auditoria-toolbar,
  .resultado-section {
    padding: 14px;
  }

  .auditoria-toolbar .filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .auditoria-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .auditoria-alert-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auditoria-detail-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .auditoria-toolbar .filters-grid,
  .auditoria-summary-grid,
  .auditoria-alert-strip,
  .auditoria-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .auditoria-toolbar {
    position: static;
  }

  .auditoria-toolbar .filters-grid,
  .auditoria-summary-grid,
  .auditoria-alert-strip,
  .auditoria-detail-summary {
    grid-template-columns: 1fr;
  }

  .auditoria-priority-table th:nth-child(2),
  .auditoria-priority-table td:nth-child(2),
  .auditoria-sticky-client,
  .auditoria-priority-table th:first-child,
  .auditoria-priority-table td:first-child {
    position: static;
  }

  .auditoria-route-detail-table {
    min-width: 560px;
  }
}

.freight-table,
.rotas-matrix {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.freight-table th,
.freight-table td,
.rotas-matrix th,
.rotas-matrix td {
  white-space: nowrap;
  padding: 8px 10px;
  font-size: 0.8rem;
}

@media (max-width: 1366px) {
  .finance-main,
  .fin-content,
  .main-content {
    padding: 14px;
  }

  .resultado-section,
  .settings-card {
    padding: 14px;
  }

  .freight-simulator-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
  }

  .freight-result-panel {
    padding: 12px;
  }

  .freight-result-grid {
    gap: 7px;
  }

  .freight-result-grid > div {
    padding: 9px;
  }
}

@media (max-width: 1180px) {
  .freight-simulator-layout {
    grid-template-columns: 1fr;
  }

  .freight-result-panel {
    order: 2;
  }

  .freight-result-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metrics-grid,
  .freight-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .finance-main,
  .fin-content,
  .main-content {
    padding: 10px;
  }

  .filters-grid,
  .freight-input-grid,
  .freight-result-grid,
  .metrics-grid,
  .freight-kpi-grid {
    grid-template-columns: 1fr;
  }

  .resultado-section,
  .settings-card {
    padding: 12px;
    border-radius: 12px;
  }
}

.freight-filters {
  gap: 10px;
  margin-bottom: 0;
}

.freight-simulator-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.freight-simulator-header,
.freight-simulator-card .section-header {
  margin-bottom: 0;
}

.freight-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
}

.freight-toolbar-grid {
  margin-bottom: 0;
}

.freight-toolbar-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.freight-toolbar-actions button {
  white-space: nowrap;
}

.freight-calc-page > .resultado-section {
  margin-top: 0;
  margin-bottom: 0;
}

.freight-calc-page .section-header p.note,
.freight-calc-page .resultado-header p.note {
  max-width: 72ch;
}

.freight-input-grid {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  align-content: start;
}

.freight-input-grid .filter-field {
  gap: 4px;
}

.freight-input-grid .filter-field:last-child:nth-child(odd) {
  grid-column: 1 / span 2;
}

.freight-result-panel {
  align-self: start;
}

.freight-result-grid strong {
  min-height: 2.2em;
}

.freight-kpi-grid {
  margin-bottom: 0;
}

.freight-table-wrapper,
.freight-matrix-wrapper {
  margin-top: 2px;
}

@media (max-width: 1366px) {
  .freight-calc-page {
    gap: 12px;
  }

  .fin-header {
    padding: 10px 14px 6px;
  }

  .freight-simulator-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .freight-toolbar {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 8px 10px;
  }

  .freight-toolbar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .freight-input-grid {
    gap: 8px 10px;
  }

  .freight-input-grid .filter-field,
  .freight-toolbar-grid .filter-field {
    font-size: 0.75rem;
  }

  .freight-input-grid .filter-field input,
  .freight-input-grid .filter-field select,
  .freight-toolbar-grid .filter-field input,
  .freight-toolbar-grid .filter-field select {
    height: 36px;
    padding: 6px 9px;
    font-size: 0.82rem;
  }

  .freight-simulator-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
  }

  .freight-result-panel {
    padding: 10px;
  }

  .freight-result-panel h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .freight-result-grid {
    gap: 6px;
  }

  .freight-result-grid > div {
    padding: 8px;
  }

  .freight-result-grid span {
    font-size: 0.64rem;
  }

  .freight-result-grid strong {
    font-size: 0.84rem;
  }

  .freight-warning-list .note {
    font-size: 0.8rem;
  }
}

@media (max-width: 1180px) {
  .freight-toolbar {
    grid-template-columns: 1fr;
  }

  .freight-toolbar-actions {
    justify-content: flex-start;
  }

  .freight-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .freight-toolbar,
  .freight-toolbar-grid,
  .freight-input-grid,
  .freight-result-grid {
    grid-template-columns: 1fr;
  }

  .freight-input-grid .filter-field:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .freight-toolbar-actions {
    justify-content: stretch;
  }

  .freight-toolbar-actions button {
    width: 100%;
  }
}

/* ===== Calculadora de Frete - layout notebook corrigido ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.finance-layout,
.fin-shell,
.finance-main,
.fin-content,
.main-content,
.freight-calc-page,
.filters,
.settings-card,
.freight-simulator-card {
  min-width: 0;
  max-width: 100%;
}

.finance-main,
.fin-content,
.main-content {
  width: 100%;
  overflow-x: hidden;
}

.freight-calc-page {
  display: grid;
  gap: 14px;
  padding-bottom: 24px;
}

.freight-simulator-card {
  padding: 16px;
  border-radius: 14px;
  overflow: hidden;
}

.freight-calc-page > .resultado-section:first-child {
  padding: 16px;
  border-radius: 14px;
}

.freight-calc-page > .resultado-section:first-child h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.freight-calc-page > .resultado-section:first-child .note {
  max-width: 620px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 12px;
}

.freight-simulator-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.freight-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  width: 100%;
  min-width: 0;
}

.filter-field {
  min-width: 0;
  font-size: 0.76rem;
  line-height: 1.25;
  color: #0f2a25;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 6px 10px;
  font-size: 0.84rem;
  border-radius: 9px;
}

.freight-result-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  overflow: hidden;
}

.freight-result-panel h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.freight-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.freight-result-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
}

.freight-result-grid span {
  display: block;
  font-size: 0.66rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.freight-result-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 0.9rem;
  line-height: 1.2;
  word-break: break-word;
}

.filter-actions {
  margin-top: 10px;
}

.filter-actions button {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.85rem;
}

.metrics-grid,
.freight-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card,
.kpi-card,
.freight-kpi-card {
  min-width: 0;
  padding: 12px;
  border-radius: 13px;
}

.kpi-title {
  font-size: 0.72rem;
  line-height: 1.2;
}

.kpi-value {
  font-size: 1rem;
  line-height: 1.2;
}

.rotas-kpi-subtitle {
  font-size: 0.75rem;
}

.resultado-section {
  padding: 16px;
  border-radius: 14px;
}

.section-header {
  margin-bottom: 12px;
}

.section-header h3 {
  margin: 0 0 5px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.note {
  font-size: 0.86rem;
  line-height: 1.35;
}

.freight-table-wrapper,
.freight-matrix-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.freight-table,
.rotas-matrix {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.freight-table th,
.freight-table td,
.rotas-matrix th,
.rotas-matrix td {
  white-space: nowrap;
  padding: 8px 10px;
  font-size: 0.8rem;
}

@media (max-width: 1366px) {
  .finance-main,
  .fin-content,
  .main-content {
    padding: 12px;
  }

  .freight-calc-page {
    gap: 12px;
  }

  .freight-calc-page > .resultado-section:first-child,
  .resultado-section,
  .freight-simulator-card {
    padding: 14px;
  }

  .freight-result-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .freight-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-grid,
  .freight-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .filters-grid,
  .freight-input-grid,
  .freight-result-grid,
  .metrics-grid,
  .freight-kpi-grid {
    grid-template-columns: 1fr;
  }

  .finance-main,
  .fin-content,
  .main-content {
    padding: 10px;
  }

  .freight-calc-page > .resultado-section:first-child,
  .resultado-section,
  .freight-simulator-card {
    padding: 12px;
  }
}

/* ===== Calculadora de Frete - formulário compacto ===== */

.freight-calc-page {
  width: 100%;
  max-width: 1280px;
  margin: 0;
  padding-right: 0;
}

.freight-calc-page > .freight-filters,
.freight-calc-page > .resultado-section,
.freight-simulator-card {
  width: 100%;
  max-width: 1280px;
}

.freight-simulator-card,
.resultado-section {
  overflow: hidden;
}

.freight-simulator-card {
  padding: 14px;
  border-radius: 12px;
}

.freight-simulator-header,
.freight-simulator-card .section-header.freight-simulator-header {
  max-width: 760px;
  margin-bottom: 10px;
}

.freight-simulator-header h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.freight-simulator-header .note {
  max-width: 680px;
  margin: 0;
  color: #63736d;
  font-size: 0.78rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.freight-toolbar {
  display: none;
}

#freight-calculator-form .freight-simulator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 100%;
  width: 100%;
}

#freight-calculator-form .freight-input-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  width: 100%;
  min-width: 0;
}

#freight-calculator-form .freight-input-grid::before {
  content: "Referência";
  grid-column: 1 / -1;
  color: #48635a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: -2px;
  text-transform: uppercase;
}

#freight-calculator-form .freight-input-grid .filter-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  color: #243a34;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

#freight-calculator-form .freight-input-grid input,
#freight-calculator-form .freight-input-grid select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #d7e1dc;
  border-radius: 7px;
  background: #fff;
  color: #123028;
  font-size: 0.84rem;
  line-height: 1.2;
}

#freight-calculator-form .freight-input-grid input:focus,
#freight-calculator-form .freight-input-grid select:focus {
  border-color: #1f7a56;
  box-shadow: 0 0 0 3px rgba(31, 122, 86, 0.14);
  outline: 0;
}

#freight-calculator-form .freight-result-panel {
  position: sticky;
  top: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  border: 1px solid #cfe0d8;
  border-radius: 12px;
  background: #f8fbf9;
  box-shadow: 0 10px 24px rgba(20, 48, 40, 0.08);
}

#freight-calculator-form .freight-result-panel h4 {
  margin: 0 0 10px;
  color: #0f2f27;
  font-size: 0.92rem;
  line-height: 1.2;
}

#freight-calculator-form .freight-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#freight-calculator-form .freight-result-grid > div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #e0ebe6;
  border-radius: 8px;
  background: #fff;
}

#freight-calculator-form .freight-result-grid > div:nth-child(8),
#freight-calculator-form .freight-result-grid > div:nth-child(9),
#freight-calculator-form .freight-result-grid > div:nth-child(10),
#freight-calculator-form .freight-result-grid > div:nth-child(11),
#freight-calculator-form .freight-result-grid > div:nth-child(12),
#freight-calculator-form .freight-result-grid > div:nth-child(13) {
  border-color: #b9dccd;
  background: #f0faf5;
}

#freight-calculator-form .freight-result-grid span {
  display: block;
  color: #65756f;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.15;
  text-transform: uppercase;
}

#freight-calculator-form .freight-result-grid strong {
  display: block;
  margin-top: 4px;
  color: #123028;
  font-size: 0.88rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#freight-calculator-form .freight-result-grid > div:nth-child(8) strong,
#freight-calculator-form .freight-result-grid > div:nth-child(9) strong,
#freight-calculator-form .freight-result-grid > div:nth-child(11) strong,
#freight-calculator-form .freight-result-grid > div:nth-child(12) strong,
#freight-calculator-form .freight-result-grid > div:nth-child(13) strong {
  color: #177245;
  font-weight: 800;
}

#freight-calculator-form .freight-result-grid .is-negative,
#freight-calculator-form .freight-result-grid .is-negative strong {
  color: #b42318;
}

#freight-calculator-form .freight-warning-list {
  margin-top: 8px;
}

#freight-calculator-form .freight-warning-list .note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.3;
}

.freight-simulator-card > .filter-actions {
  display: flex;
  width: 100%;
  max-width: 100%;
  justify-content: flex-end;
  margin-top: 12px;
}

.freight-simulator-card > .filter-actions button {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 168px;
  min-height: 38px;
  height: 38px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.freight-kpi-grid,
.metrics-grid {
  width: 100%;
  max-width: 100%;
}

.freight-kpi-card,
.metric-card,
.kpi-card {
  min-width: 0;
}

.freight-table-wrapper,
.freight-matrix-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.freight-table,
.rotas-matrix {
  width: max-content;
  min-width: 100%;
}

.freight-table th,
.freight-table td,
.rotas-matrix th,
.rotas-matrix td {
  white-space: nowrap;
}

@media (max-width: 1366px) {
  .freight-calc-page {
    max-width: 100%;
  }

  .freight-calc-page > .freight-filters,
  .freight-calc-page > .resultado-section,
  .freight-simulator-card {
    max-width: 100%;
  }

  .freight-simulator-card {
    padding: 12px;
  }
}

@media (max-width: 1200px) {
  #freight-calculator-form .freight-input-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #freight-calculator-form .freight-simulator-layout {
    grid-template-columns: 1fr;
  }

  #freight-calculator-form .freight-result-panel {
    position: static;
  }

  #freight-calculator-form .freight-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  #freight-calculator-form .freight-input-grid,
  #freight-calculator-form .freight-result-grid {
    grid-template-columns: 1fr;
  }

  .freight-simulator-card > .filter-actions {
    justify-content: stretch;
  }

  .freight-simulator-card > .filter-actions button {
    width: 100% !important;
    min-width: 0;
  }
}

/* =========================================================
   AGREGADOS - FILTRO COMPACTO E TABELA MAIOR
   ========================================================= */

.agregados-page {
  display: grid;
  gap: 8px !important;
  max-width: 100%;
  overflow: hidden;
}

.agregados-page > .note {
  display: none;
}

.agregados-page > .panel-card:first-of-type {
  padding: 8px 10px !important;
  margin: 0 !important;
  border-radius: 12px !important;
}

.agregados-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  align-items: end !important;
}

.agregados-filters {
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
}

.agregados-filter-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.agregados-filters-grid {
  display: grid !important;
  grid-template-columns: 132px 132px 115px 15ch minmax(180px, 1fr) !important;
  gap: 6px !important;
  align-items: end !important;
}

.agregados-page .filter-field {
  display: grid !important;
  gap: 2px !important;
  margin: 0 !important;
  font-size: 0.64rem !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  color: #52635d !important;
  text-transform: uppercase !important;
  letter-spacing: 0.025em !important;
}

.agregados-page .filter-field input,
.agregados-page .filter-field select {
  width: 100% !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 3px 7px !important;
  border-radius: 7px !important;
  font-size: 0.76rem !important;
  line-height: 1 !important;
}

.agregados-page input[name="placa"] {
  max-width: 15ch !important;
}

.agregados-page .filters-actions,
.agregados-page .filter-actions {
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
  margin-top: 6px !important;
}

.agregados-filter-line .filters-actions {
  margin-top: 0 !important;
  white-space: nowrap;
}

.agregados-page .action-button,
.agregados-page button[type="submit"] {
  min-height: 28px !important;
  height: 28px !important;
  padding: 4px 8px !important;
  border-radius: 7px !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.agregados-toolbar-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  justify-content: flex-end !important;
  align-items: end !important;
  max-width: 380px !important;
}

.agregados-cards {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
  gap: 7px !important;
  margin: 0 !important;
}

.agregados-kpi {
  min-height: 58px !important;
  padding: 8px 10px !important;
  border-radius: 11px !important;
}

.agregados-kpi .kpi-title {
  font-size: 0.62rem !important;
  line-height: 1 !important;
}

.agregados-kpi .kpi-value {
  margin-top: 6px !important;
  font-size: 1.08rem !important;
  line-height: 1 !important;
}

.agregados-alert-summary {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
  gap: 6px !important;
}

.agregados-alert-card {
  min-height: 34px !important;
  padding: 6px 9px !important;
  border-radius: 9px !important;
  font-size: 0.7rem !important;
}

.agregados-alert-card strong {
  font-size: 0.95rem !important;
}

.agregados-page section.panel-card:has(.agregados-table-wrapper) {
  padding: 10px !important;
  margin: 0 !important;
  min-width: 0 !important;
}

.agregados-page .section-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
}

.agregados-page .section-header h3 {
  margin: 0 !important;
  font-size: 1rem !important;
  line-height: 1.1 !important;
}

.agregados-page .section-header .note {
  margin: 0 !important;
  font-size: 0.72rem !important;
  white-space: nowrap !important;
}

.agregados-tabs {
  display: flex !important;
  gap: 6px !important;
  overflow-x: auto !important;
  padding-bottom: 5px !important;
  margin-bottom: 6px !important;
}

.agregados-tab {
  min-height: 26px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  font-size: 0.7rem !important;
  line-height: 1 !important;
}

.agregados-tab span {
  margin-left: 4px !important;
  font-size: 0.68rem !important;
}

.agregados-table-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow: auto !important;
  border-radius: 12px !important;
  max-height: calc(100vh - 220px) !important;
}

.agregados-table {
  min-width: 1040px !important;
  font-size: 0.76rem !important;
}

.agregados-table thead th {
  padding: 7px 8px !important;
  font-size: 0.66rem !important;
  line-height: 1 !important;
}

.agregados-table tbody td {
  padding: 6px 8px !important;
  line-height: 1.15 !important;
}

.agregado-name-cell {
  min-width: 185px !important;
}

.agregado-name-cell strong {
  font-size: 0.76rem !important;
  line-height: 1.1 !important;
}

.agregado-name-cell small {
  font-size: 0.65rem !important;
  line-height: 1.1 !important;
}

.agregados-table th:nth-child(1),
.agregados-table td:nth-child(1) {
  min-width: 190px !important;
  left: 0 !important;
}

.agregados-table th:nth-child(2),
.agregados-table td:nth-child(2) {
  min-width: 82px !important;
  left: 190px !important;
}

.agregado-alert-list {
  max-width: 180px !important;
  gap: 3px !important;
}

.agregado-alert-badge {
  min-height: 18px !important;
  padding: 2px 5px !important;
  font-size: 0.6rem !important;
  line-height: 1 !important;
}

.action-button-inline {
  min-height: 24px !important;
  height: 24px !important;
  padding: 3px 6px !important;
  font-size: 0.66rem !important;
  border-radius: 6px !important;
}

@media (max-width: 1366px) {
  .agregados-toolbar {
    grid-template-columns: 1fr !important;
  }

  .agregados-toolbar-actions {
    justify-content: flex-start !important;
    max-width: none !important;
  }

  .agregados-filters-grid {
    grid-template-columns: 122px 122px 105px 15ch minmax(150px, 1fr) !important;
  }

  .agregados-table-wrapper {
    max-height: calc(100vh - 245px) !important;
  }
}

@media (max-width: 1100px) {
  .agregados-filter-line {
    grid-template-columns: 1fr;
  }

  .agregados-filters-grid {
    grid-template-columns: repeat(3, minmax(110px, 1fr)) !important;
  }

  .agregados-cards {
    grid-template-columns: repeat(3, minmax(120px, 1fr)) !important;
  }

  .agregados-alert-summary {
    grid-template-columns: repeat(3, minmax(120px, 1fr)) !important;
  }

  .agregados-table-wrapper {
    max-height: calc(100vh - 300px) !important;
  }
}

/* =========================================================
   AGREGADOS - CADASTRO COMPACTO SEM ESTOURAR TELA
   ========================================================= */

.finance-main,
.fin-content,
.main-content {
  min-width: 0 !important;
  overflow-x: hidden !important;
}

.agregados-page,
.agregados-cadastro-page,
.agregados-form-page {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.agregados-page .panel-card,
.agregados-cadastro-page .panel-card,
.agregados-form-page .panel-card {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.agregados-cadastro-wrapper,
.agregados-form-wrapper,
.agregados-edit-wrapper,
.cadastro-agregados-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid #dce6e1;
  border-radius: 12px;
  background: #fff;
}

.agregados-page table,
.agregados-cadastro-page table,
.agregados-form-page table {
  max-width: none !important;
}

.agregados-cadastro-table,
.cadastro-agregados-table,
.agregados-edit-table {
  width: max-content !important;
  min-width: 980px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 0.76rem !important;
}

.agregados-cadastro-table th,
.cadastro-agregados-table th,
.agregados-edit-table th {
  padding: 7px 8px !important;
  font-size: 0.66rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  background: #e7f1ed !important;
}

.agregados-cadastro-table td,
.cadastro-agregados-table td,
.agregados-edit-table td {
  padding: 7px 8px !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.agregados-cadastro-table input,
.agregados-cadastro-table select,
.cadastro-agregados-table input,
.cadastro-agregados-table select,
.agregados-edit-table input,
.agregados-edit-table select {
  height: 32px !important;
  min-height: 32px !important;
  padding: 4px 8px !important;
  border-radius: 9px !important;
  font-size: 0.74rem !important;
}

.agregados-cadastro-table input[name*="placa"],
.cadastro-agregados-table input[name*="placa"],
.agregados-edit-table input[name*="placa"] {
  width: 92px !important;
}

.agregados-cadastro-table input[name*="nome"],
.cadastro-agregados-table input[name*="nome"],
.agregados-edit-table input[name*="nome"] {
  width: 170px !important;
}

.agregados-cadastro-table input[name*="filial"],
.cadastro-agregados-table input[name*="filial"],
.agregados-edit-table input[name*="filial"] {
  width: 78px !important;
}

.agregados-cadastro-table input[name*="tipo_veiculo"],
.cadastro-agregados-table input[name*="tipo_veiculo"],
.agregados-edit-table input[name*="tipo_veiculo"] {
  width: 90px !important;
}

.agregados-cadastro-table select[name*="tipo_operacao"],
.cadastro-agregados-table select[name*="tipo_operacao"],
.agregados-edit-table select[name*="tipo_operacao"] {
  width: 125px !important;
}

.agregados-cadastro-table input[name*="diaria"],
.cadastro-agregados-table input[name*="diaria"],
.agregados-edit-table input[name*="diaria"],
.agregados-cadastro-table input[name*="valor"],
.cadastro-agregados-table input[name*="valor"],
.agregados-edit-table input[name*="valor"] {
  width: 92px !important;
  text-align: right !important;
}

.agregados-cadastro-table input[name*="observacao"],
.cadastro-agregados-table input[name*="observacao"],
.agregados-edit-table input[name*="observacao"] {
  width: 190px !important;
}

.agregados-cadastro-table input[type="checkbox"],
.cadastro-agregados-table input[type="checkbox"],
.agregados-edit-table input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
}

.agregados-cadastro-table .action-button,
.cadastro-agregados-table .action-button,
.agregados-edit-table .action-button,
.agregados-cadastro-table button,
.cadastro-agregados-table button,
.agregados-edit-table button {
  min-height: 30px !important;
  height: 30px !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
  font-size: 0.7rem !important;
  white-space: nowrap !important;
}

body {
  overflow-x: hidden !important;
}

.recibo-page {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #eef3f0;
}

.recibo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.recibo-document {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 18mm;
  background: #fff;
  color: #10221d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.recibo-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid #173f35;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.recibo-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.recibo-header p {
  margin: 4px 0 0;
  color: #61716b;
}

.recibo-header-meta {
  display: grid;
  gap: 4px;
  text-align: right;
}

.recibo-box {
  margin-top: 14px;
}

.recibo-box h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #173f35;
}

.recibo-subtitle {
  margin: 12px 0 6px;
  font-size: 0.82rem;
  color: #173f35;
}

.recibo-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recibo-summary-grid div {
  border: 1px solid #dce6e1;
  border-radius: 10px;
  padding: 8px;
}

.recibo-summary-grid span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: #66766f;
}

.recibo-summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 0.86rem;
}

.recibo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.recibo-table th,
.recibo-table td {
  border-bottom: 1px solid #dde8e3;
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
}

.recibo-table th {
  background: #e7f1ed;
  color: #10221d;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.recibo-table td:nth-last-child(-n + 3),
.recibo-table th:nth-last-child(-n + 3) {
  white-space: nowrap;
}

.recibo-table td:last-child,
.recibo-table th:last-child {
  white-space: normal;
}

.recibo-table td:last-child {
  min-width: 120px;
}

.recibo-table-small {
  font-size: 0.68rem;
}

.recibo-performance-table th:nth-child(n + 2),
.recibo-performance-table td:nth-child(n + 2) {
  text-align: center;
}

.recibo-adjustments {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.recibo-adjustments div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #dce6e1;
  border-radius: 10px;
  font-size: 0.76rem;
}

.recibo-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #173f35;
  color: #fff;
}

.recibo-total span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recibo-total strong {
  font-size: 1.35rem;
}

.status-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-banner-success {
  background: #e7f6ee;
  color: #0f5b3b;
}

.status-banner-error {
  background: #fdeceb;
  color: #8a2323;
}

.admin-users-page {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.admin-users-page-header h3,
.admin-users-section-header h3,
.admin-edit-panel-header h4,
.admin-password-panel-header h5,
.admin-panel-section-header h5 {
  margin: 0;
}

.admin-users-page-header .note,
.admin-users-section-header .note,
.admin-edit-panel-header .note,
.admin-password-panel-header .note,
.admin-panel-section-header .note {
  margin: 6px 0 0;
}

.admin-create-user-card {
  padding-top: 18px;
}

.admin-create-user-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.admin-users-table-wrap {
  width: 100%;
  overflow: hidden;
}

.admin-users-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.admin-users-table thead th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #60736a;
  padding: 0 14px 12px;
}

.admin-users-table tbody td {
  padding: 14px;
  background: #fff;
  border-top: 1px solid #e3ece7;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-users-table tbody tr:first-child td {
  border-top: 1px solid #d8e4de;
}

.admin-users-table-row td:first-child {
  border-left: 1px solid #d8e4de;
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

.admin-users-table-row td:last-child {
  border-right: 1px solid #d8e4de;
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.admin-edit-row td {
  padding: 0 0 14px;
  background: transparent;
  border: 0;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.admin-inline-action {
  display: contents;
}

.admin-edit-panel {
  margin-top: 10px;
  padding: 18px;
  border: 1px solid #d8e4de;
  border-radius: 18px;
  background: linear-gradient(180deg, #fcfefd 0%, #f5faf7 100%);
  box-shadow: 0 16px 36px rgba(16, 34, 29, 0.08);
}

.admin-edit-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-panel-close {
  border: 0;
  background: transparent;
  color: #355249;
  cursor: pointer;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-tab {
  border: 1px solid #d1ded7;
  background: #f4f8f5;
  color: #365148;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
}

.admin-tab.is-active {
  background: #17322a;
  color: #f4f3ed;
  border-color: #17322a;
}

.admin-panel-mode-pane,
.admin-tab-panel {
  display: none;
}

.admin-panel-mode-pane.is-active,
.admin-tab-panel.is-active {
  display: block;
}

.admin-access-form {
  display: grid;
  gap: 16px;
}

.admin-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.admin-data-card {
  border: 1px solid #dce8e2;
  box-shadow: none;
}

.admin-data-card strong {
  font-size: 1.05rem;
}

.admin-access-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.admin-superuser-toggle {
  padding: 10px 12px;
  border-radius: 12px;
  background: #edf3ef;
}

.admin-panel-section {
  display: grid;
  gap: 14px;
}

.admin-panel-section-header {
  display: grid;
  gap: 4px;
}

.admin-checkbox-list,
.admin-permission-groups {
  display: grid;
  gap: 10px;
}

.admin-profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-profile-option {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px;
  border: 1px solid #d8e4de;
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}

.admin-profile-option input {
  margin: 0;
}

.admin-profile-option-title {
  font-weight: 700;
  color: #183128;
}

.admin-profile-option small {
  color: #64776d;
}

.admin-quick-actions {
  display: grid;
  gap: 12px;
}

.admin-quick-actions-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.admin-quick-actions-line .filter-field {
  min-width: min(320px, 100%);
  flex: 1 1 320px;
}

.admin-module-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.admin-module-card {
  border: 1px solid #dbe7e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 34, 29, 0.04);
}

.admin-module-card-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e5efe9;
  color: #19352d;
}

.admin-module-card-body {
  display: grid;
  gap: 10px;
  max-height: min(56vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 16px;
}

.checkbox-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

.admin-permission-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe7e1;
  border-radius: 12px;
  background: #fff;
}

.admin-permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 0.84rem;
}

.admin-permission-row-friendly {
  padding: 8px 0;
  border-bottom: 1px solid #edf3ef;
}

.admin-permission-row-friendly:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.admin-permission-choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

button.permission-pill {
  cursor: pointer;
  background: transparent;
}

.permission-pill.is-selected {
  box-shadow: inset 0 0 0 2px rgba(20, 34, 28, 0.12);
}

.permission-pill--inherit {
  background: #edf2ef;
  border-color: #d9e3de;
  color: #54655d;
}

.permission-pill--allow {
  background: rgba(32, 125, 80, 0.12);
  border-color: rgba(32, 125, 80, 0.22);
  color: #1f7a50;
}

.permission-pill--deny {
  background: rgba(170, 55, 55, 0.12);
  border-color: rgba(170, 55, 55, 0.22);
  color: #9f3434;
}

.admin-select-fallback {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.admin-advanced-permissions,
.admin-effective-permissions {
  padding: 14px 16px;
  border: 1px dashed #c4d7ce;
  border-radius: 12px;
  background: #fafcfb;
}

.admin-advanced-permissions summary,
.admin-effective-permissions summary {
  cursor: pointer;
  font-weight: 600;
  color: #29453c;
}

.admin-advanced-permissions .note,
.admin-effective-permissions .note {
  margin: 10px 0 12px;
}

.admin-effective-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.admin-password-panel {
  display: grid;
  gap: 16px;
}

.admin-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.recibo-signature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 36px;
}

.recibo-signature-inline {
  margin-top: 18px;
}

.recibo-signature div {
  border-top: 1px solid #10221d;
  padding-top: 8px;
  text-align: center;
  font-size: 0.76rem;
  color: #40514b;
}

@media (max-width: 1100px) {
  .admin-create-user-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recibo-document {
    width: 100%;
    min-height: auto;
    padding: 22px;
  }

  .recibo-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-users-table,
  .admin-users-table thead,
  .admin-users-table tbody,
  .admin-users-table tr,
  .admin-users-table td {
    display: block;
  }

  .admin-users-table thead {
    display: none;
  }

  .admin-users-table-row {
    display: grid;
    gap: 0;
    margin-bottom: 12px;
  }

  .admin-users-table tbody td {
    border-left: 1px solid #d8e4de;
    border-right: 1px solid #d8e4de;
  }

  .admin-users-table-row td:first-child {
    border-top-right-radius: 14px;
  }

  .admin-users-table-row td:last-child {
    border-bottom-right-radius: 14px;
  }

  .admin-users-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6a7b73;
  }

  .admin-create-user-form,
  .admin-password-grid {
    grid-template-columns: 1fr;
  }

  .admin-module-cards {
    grid-template-columns: 1fr;
  }

  .admin-quick-actions-line {
    flex-direction: column;
    align-items: stretch;
  }

  .recibo-page {
    padding: 12px;
  }

  .recibo-actions {
    justify-content: stretch;
  }

  .recibo-actions .action-button,
  .recibo-actions button {
    width: 100%;
  }

  .recibo-header,
  .recibo-signature {
    display: grid;
    grid-template-columns: 1fr;
  }

  .recibo-header-meta {
    text-align: left;
  }

  .recibo-summary-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-edit-panel-header {
    display: grid;
  }

  .admin-permission-choice {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    background: #fff !important;
  }

  .finance-sidebar,
  .fin-header,
  .recibo-actions,
  .no-print {
    display: none !important;
  }

  .finance-layout,
  .finance-main,
  .fin-content,
  .main-content {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .recibo-page {
    padding: 0 !important;
    background: #fff !important;
  }

  .recibo-document {
    width: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .recibo-table thead {
    display: table-header-group;
  }

  .recibo-table tr,
  .recibo-box,
  .recibo-signature {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .recibo-table th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
.frota162-page {
  display: grid;
  gap: 14px;
}

.frota162-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.frota162-subtitle {
  margin: 0 0 4px;
  color: var(--muted, #667085);
  font-size: 0.95rem;
}

.frota162-actions,
.frota162-row-actions,
.frota162-pagination,
.frota162-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.frota162-actions {
  justify-content: flex-end;
}

.frota162-tabs {
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.frota162-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  color: #475467;
  font-weight: 700;
  cursor: pointer;
}

.frota162-tabs button.is-active {
  color: #0f172a;
  box-shadow: inset 0 -2px 0 #0f766e;
}

.frota162-kpis.metrics-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.frota162-filters .filters-grid,
.frota162-period-form .filters-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.frota162-table-wrap {
  max-height: calc(100vh - 360px);
  min-height: 260px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 8px;
}

.frota162-table {
  min-width: 1180px;
}

.frota162-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.frota162-table td,
.frota162-table th {
  white-space: normal;
  vertical-align: top;
}

.frota162-table td:nth-child(5) {
  min-width: 230px;
}

.frota162-table tr.is-warning {
  background: #fff7ed;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.status-badge.is-alert {
  background: #fee4e2;
  color: #b42318;
}

.status-badge.is-ok {
  background: #dcfae6;
  color: #067647;
}

.frota162-pagination {
  justify-content: flex-end;
  padding: 8px 0;
}

.frota162-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.32);
}

.frota162-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 96vw);
  height: 100%;
  overflow: auto;
  background: #fff;
  padding: 22px;
  box-shadow: -12px 0 28px rgba(15, 23, 42, 0.18);
}

.frota162-drawer-close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.frota162-detail-grid {
  display: grid;
  gap: 12px;
}

.frota162-detail-grid section,
.frota162-config-grid > div {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.frota162-detail-grid h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.frota162-detail-grid p {
  margin: 4px 0;
}

.frota162-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.frota162-config-grid span {
  display: block;
  color: #667085;
  font-size: 0.78rem;
}

.frota162-config-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.monitoramento-summary-row {
  cursor: pointer;
}

.monitoramento-summary-row:hover {
  background: #f8fafc;
}

.monitoramento-summary-row.is-expanded {
  background: #eef6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.monitoramento-detail-row > td {
  background: #f9fafb;
  padding: 12px 16px;
}

.velocidade-page {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.velocidade-page-active .finance-main,
body.velocidade-page-active .fin-content,
body.velocidade-page-active .main-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.velocidade-page > [data-velocidade-panel] {
  min-width: 0;
  max-width: 100%;
}

.velocidade-tabs {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  padding: 3px;
}

.velocidade-tabs button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.velocidade-tabs button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.velocidade-filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  align-items: end;
}

.velocidade-cadastro-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.velocidade-history-grid {
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(170px, 1fr)) auto;
  align-items: end;
}

.velocidade-cadastro-message {
  align-self: end;
}

.velocidade-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.velocidade-check input {
  width: 16px;
  height: 16px;
}

.velocidade-actions button,
.velocidade-detail-button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.velocidade-actions .secondary-button,
.velocidade-detail-button.danger {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
}

.velocidade-detail-button.danger {
  color: #991b1b;
}

.form-feedback {
  margin: 8px 0 0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.velocidade-row-actions {
  display: flex;
  gap: 6px;
}

.velocidade-syncbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.velocidade-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.velocidade-kpis .kpi-card {
  min-height: 78px;
}

.velocidade-kpis .kpi-value {
  font-size: 22px;
}

.velocidade-table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: calc(100vh - 330px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.velocidade-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.velocidade-table th,
.velocidade-table td {
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-inline: 8px;
  font-size: 12px;
}

.velocidade-table th:nth-child(1) { width: 12%; }
.velocidade-table th:nth-child(2) { width: 11%; }
.velocidade-table th:nth-child(3) { width: 14%; }
.velocidade-table th:nth-child(4) { width: 8%; }
.velocidade-table th:nth-child(5) { width: 16%; }
.velocidade-table th:nth-child(6) { width: 11%; }
.velocidade-table th:nth-child(7) { width: 9%; }
.velocidade-table th:nth-child(8) { width: 11%; }
.velocidade-table th:nth-child(9) { width: 8%; }

.velocidade-table td:last-child {
  text-align: right;
}

.velocidade-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
}

.velocidade-critico {
  background: #fee2e2;
  color: #991b1b;
}

.velocidade-atencao {
  background: #fef3c7;
  color: #92400e;
}

.velocidade-normal {
  background: #dcfce7;
  color: #166534;
}

.velocidade-parado {
  background: #e5e7eb;
  color: #374151;
}

.velocidade-sem_sinal,
.velocidade-invalido {
  background: #f3f4f6;
  color: #6b7280;
}

.velocidade-row[data-status="critico"] td {
  background: #fff7f7;
}

.velocidade-row[data-status="atencao"] td {
  background: #fffbeb;
}

.velocidade-drawer[hidden] {
  display: none;
}

.velocidade-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.velocidade-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, .35);
}

.velocidade-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  gap: 14px;
  width: min(760px, 100vw);
  height: 100%;
  overflow: auto;
  border-left: 1px solid #e5e7eb;
  background: #fff;
  padding: 18px;
  box-shadow: -12px 0 28px rgba(17, 24, 39, .16);
}

.velocidade-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.velocidade-drawer-header h3 {
  margin: 8px 0 0;
  color: #111827;
  font-size: 20px;
}

.velocidade-drawer-header button {
  width: 34px;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 22px;
  cursor: pointer;
}

.velocidade-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.velocidade-detail-grid div,
.velocidade-chart-panel,
.velocidade-occurrences {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.velocidade-detail-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.velocidade-detail-grid span {
  color: #6b7280;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.velocidade-detail-grid strong {
  color: #111827;
  font-size: 15px;
}

.velocidade-address {
  margin: 0;
  color: #374151;
  font-weight: 700;
}

.velocidade-chart-panel {
  padding: 10px;
}

.velocidade-history-chart {
  min-width: 0;
  overflow: auto;
}

.velocidade-chart-panel canvas {
  display: block;
  width: 100%;
  height: auto;
}

.velocidade-history-table-wrapper {
  max-height: calc(100vh - 430px);
}

.velocidade-history-table {
  min-width: 980px;
}

.velocidade-history-table th:nth-child(1) { width: 15%; }
.velocidade-history-table th:nth-child(2) { width: 12%; }
.velocidade-history-table th:nth-child(3) { width: 11%; }
.velocidade-history-table th:nth-child(4) { width: 10%; }
.velocidade-history-table th:nth-child(5) { width: 16%; }
.velocidade-history-table th:nth-child(6) { width: 9%; }
.velocidade-history-table th:nth-child(7) { width: 27%; }

.velocidade-notificacoes-table {
  min-width: 1060px;
}

.velocidade-notificacoes-table th:nth-child(1) { width: 15%; }
.velocidade-notificacoes-table th:nth-child(2) { width: 11%; }
.velocidade-notificacoes-table th:nth-child(3) { width: 12%; }
.velocidade-notificacoes-table th:nth-child(4) { width: 16%; }
.velocidade-notificacoes-table th:nth-child(5) { width: 11%; }
.velocidade-notificacoes-table th:nth-child(6) { width: 10%; }
.velocidade-notificacoes-table th:nth-child(7) { width: 10%; }
.velocidade-notificacoes-table th:nth-child(8) { width: 13%; }

.velocidade-notificacoes-table-wrapper {
  max-height: calc(100vh - 250px);
}

.velocidade-occurrences {
  padding: 12px;
}

.velocidade-occurrences h4 {
  margin: 0 0 10px;
}

.velocidade-occurrence-list {
  display: grid;
  gap: 8px;
}

.velocidade-occurrence-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
  color: #4b5563;
  font-size: 12px;
}

.velocidade-map-link {
  justify-self: start;
  color: #2563eb;
  font-weight: 900;
}

.velocidade-map-link.inline {
  min-height: 28px;
  font-size: 11px;
}

@media (max-width: 1180px) {
  .monitoramento-gps-area {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1280px) {
  .velocidade-filters-grid,
  .velocidade-history-grid,
  .velocidade-cadastro-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .velocidade-kpis {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .velocidade-filters-grid,
  .velocidade-history-grid,
  .velocidade-cadastro-grid,
  .velocidade-detail-grid,
  .velocidade-kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .frota162-toolbar {
    display: grid;
  }

  .frota162-actions {
    justify-content: flex-start;
  }

  .frota162-kpis.metrics-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .frota162-filters .filters-grid,
  .frota162-period-form .filters-grid,
  .frota162-config-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 760px) {
  .frota162-filters .filters-grid,
  .frota162-period-form .filters-grid,
  .frota162-config-grid,
  .frota162-kpis.metrics-grid {
    grid-template-columns: 1fr;
  }

  .frota162-table {
    min-width: 980px;
  }
}

/* Oficina redesign */
.finance-main:has(.oficina-page) > .fin-header {
  display: none;
}

.finance-main:has(.oficina-page) {
  padding-top: 16px;
  min-width: 0;
  overflow-x: visible;
}

.frota-module.oficina-page {
  gap: 8px;
  min-width: 0;
}

#oficina-content-root.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.oficina-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}

.oficina-page-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  color: #17322a;
}

.oficina-page-header p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #5b6b62;
}

.oficina-tabs {
  gap: 2px;
  min-width: 0;
  padding-top: 2px;
  border-bottom: 1px solid #cbd9d1;
  scrollbar-width: thin;
}

.oficina-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px 8px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: #53645b;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.oficina-tabs a.is-active {
  background: #fff;
  border-color: #d8e3dc;
  border-bottom-color: #176b4d;
  color: #173b2e;
  box-shadow: 0 -1px 8px rgba(21, 35, 28, 0.04);
}

.oficina-tabs a strong {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e6f1ea;
  color: #176b4d;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.oficina-filter-bar {
  gap: 6px;
  margin: 0;
  padding: 10px;
  border: 1px solid #d8e3dc;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(21, 35, 28, 0.06);
}

.oficina-main-filters {
  display: grid;
  grid-template-columns: 126px 126px 82px 136px 122px minmax(150px, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.oficina-filter-bar .filter-field {
  gap: 4px;
  color: #415148;
  font-size: 12px;
  font-weight: 700;
}

.oficina-filter-bar input,
.oficina-filter-bar select {
  height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.oficina-filter-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: end;
  flex-wrap: nowrap;
}

.oficina-filter-actions button,
.oficina-filter-actions .action-button {
  width: auto;
  min-width: 64px;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
}

.oficina-advanced-filters {
  border-top: 1px solid #edf3ef;
  padding-top: 6px;
}

.oficina-advanced-filters summary {
  width: max-content;
  cursor: pointer;
  color: #176b4d;
  font-size: 12px;
  font-weight: 800;
  list-style-position: inside;
}

.oficina-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 8px;
}

.oficina-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 0;
}

.oficina-result-totals,
.oficina-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.oficina-result-totals strong {
  color: #17322a;
  font-size: 13px;
}

.oficina-result-totals span {
  padding-left: 9px;
  border-left: 1px solid #cbd9d1;
  color: #415148;
  font-size: 13px;
  font-weight: 700;
}

.oficina-active-filters span,
.oficina-active-filters a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf4ef;
  color: #415148;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.oficina-active-filters a {
  background: transparent;
  color: #176b4d;
}

.oficina-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 10px;
}

.oficina-expenses-table {
  width: 1080px;
  min-width: 1080px;
  max-width: none;
  table-layout: fixed;
}

.oficina-expenses-table th,
.oficina-expenses-table td {
  height: 46px;
  padding: 7px 9px;
  vertical-align: middle;
  font-size: 12px;
  min-width: 0;
  max-width: none;
}

.oficina-expenses-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #edf4ef;
  color: #2a3f35;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.oficina-expenses-table th:nth-child(1),
.oficina-expenses-table td:nth-child(1) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: center;
}

.oficina-expenses-table th:nth-child(2),
.oficina-expenses-table td:nth-child(2) {
  width: 170px;
}

.oficina-expenses-table th:nth-child(3),
.oficina-expenses-table td:nth-child(3) {
  width: 88px;
}

.oficina-expenses-table th:nth-child(4),
.oficina-expenses-table td:nth-child(4) {
  width: 260px;
}

.oficina-expenses-table th:nth-child(5),
.oficina-expenses-table td:nth-child(5),
.oficina-expenses-table th:nth-child(7),
.oficina-expenses-table td:nth-child(7) {
  width: 96px;
}

.oficina-expenses-table th:nth-child(6),
.oficina-expenses-table td:nth-child(6) {
  width: 110px;
}

.oficina-expenses-table th:nth-child(8),
.oficina-expenses-table td:nth-child(8) {
  width: 107px;
  text-align: center;
}

.oficina-expenses-table th:nth-child(9),
.oficina-expenses-table td:nth-child(9) {
  width: 94px;
  text-align: center;
}

.oficina-supplier-cell,
.oficina-doc-cell,
.oficina-history-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.oficina-money-cell {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.oficina-pending-cell {
  color: #17322a;
  font-size: 13px;
  font-weight: 900;
}

.oficina-allocated-cell > span:first-child {
  display: block;
}

.oficina-progress {
  display: block;
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8e2;
}

.oficina-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #176b4d;
}

.oficina-status-badge {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 11px;
  text-transform: none;
}

.oficina-status-badge.is-warning {
  background: #fff3cd;
  color: #775400;
}

.oficina-status-badge.is-info {
  background: #dcecff;
  color: #215385;
}

.oficina-status-badge.is-success {
  background: #dff3e5;
  color: #176b4d;
}

.oficina-status-badge.is-danger {
  background: #fde2e2;
  color: #8a1f1f;
}

.oficina-expenses-table .frota-classify-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 7px;
  background: #176b4d;
  font-size: 12px;
  font-weight: 800;
}

.oficina-expenses-table th:first-child,
.oficina-expenses-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 #e4ece7;
}

.oficina-expenses-table thead th:first-child {
  z-index: 4;
  background: #edf4ef;
}

.oficina-expenses-table th:last-child,
.oficina-expenses-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -1px 0 0 #e4ece7;
}

.oficina-expenses-table thead th:last-child {
  z-index: 4;
  background: #edf4ef;
}

.oficina-profile-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe5e0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(21, 35, 28, 0.05);
}

.oficina-profile-section-header {
  margin: 0;
  padding: 0;
}

.oficina-profile-section-header h3 {
  margin: 0;
  color: #17322a;
  font-size: 18px;
  line-height: 1.2;
}

.oficina-profile-header {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d8e3dc;
  border-radius: 8px;
  background: #f8fbf9;
}

.oficina-profile-header strong {
  color: #17322a;
}

.oficina-profile-header span {
  border-color: #d8e3dc;
  color: #53645b;
}

.oficina-profile-kpis {
  margin: 0;
}

.oficina-profile-kpis .metric-card {
  border-color: #dbe5e0;
  box-shadow: none;
}

.oficina-profile-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dbe5e0;
  border-radius: 10px;
}

.oficina-profile-table {
  width: max-content;
  min-width: 980px;
  max-width: none;
  table-layout: auto;
  border-collapse: collapse;
}

.oficina-profile-table th,
.oficina-profile-table td {
  height: 42px;
  padding: 7px 9px;
  vertical-align: middle;
  font-size: 12px;
  min-width: 0;
  white-space: nowrap;
}

.oficina-profile-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #edf4ef;
  color: #2a3f35;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.oficina-profile-table tbody tr:hover {
  background: #f8fbf9;
}

.oficina-profile-table th:first-child,
.oficina-profile-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 #e4ece7;
}

.oficina-profile-table thead th:first-child {
  z-index: 4;
  background: #edf4ef;
}

.oficina-profile-table .empty-state {
  position: static;
  text-align: center;
}

.oficina-text-stack {
  display: grid;
  gap: 2px;
  overflow: hidden;
  text-align: left;
}

.oficina-text-stack strong,
.oficina-text-stack span,
.oficina-muted-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oficina-text-stack strong,
.oficina-strong-cell {
  color: #17322a;
  font-weight: 800;
}

.oficina-text-stack span,
.oficina-muted-cell {
  color: #63746b;
}

.oficina-number-cell {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.oficina-stock-badge {
  min-width: 54px;
  justify-content: center;
  background: #dff3e5;
  color: #176b4d;
}

.oficina-stock-badge.is-warning {
  background: #fff3cd;
  color: #775400;
}

.oficina-attention-row td:first-child {
  box-shadow: inset 3px 0 0 #e0a300, 1px 0 0 #e4ece7;
}

.oficina-tires-table th:nth-child(1),
.oficina-tires-table td:nth-child(1) {
  width: 120px;
}

.oficina-tires-table {
  width: max-content;
  min-width: 1120px;
  table-layout: auto;
}

.oficina-tires-table .oficina-text-stack {
  min-width: 180px;
  max-width: 260px;
  white-space: normal;
}

.oficina-tires-table .oficina-text-stack strong,
.oficina-tires-table .oficina-text-stack span {
  white-space: normal;
}

.oficina-tires-table th:nth-child(2),
.oficina-tires-table td:nth-child(2) {
  width: 210px;
}

.oficina-tires-table th:nth-child(4),
.oficina-tires-table td:nth-child(4) {
  width: 130px;
}

.oficina-tires-table th:nth-child(5),
.oficina-tires-table td:nth-child(5),
.oficina-tires-table th:nth-child(6),
.oficina-tires-table td:nth-child(6) {
  width: 110px;
  text-align: center;
}

.oficina-tires-table th:nth-child(8),
.oficina-tires-table td:nth-child(8),
.oficina-tires-table th:nth-child(9),
.oficina-tires-table td:nth-child(9),
.oficina-tires-table th:nth-child(10),
.oficina-tires-table td:nth-child(10) {
  width: 100px;
}

.oficina-stock-table th:nth-child(1),
.oficina-stock-table td:nth-child(1) {
  width: 260px;
}

.oficina-stock-table {
  width: max-content;
  min-width: 1080px;
  table-layout: auto;
}

.oficina-stock-table .oficina-text-stack {
  min-width: 220px;
  max-width: 300px;
  white-space: normal;
}

.oficina-stock-table .oficina-text-stack strong,
.oficina-stock-table .oficina-text-stack span {
  white-space: normal;
}

.oficina-history-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #dbe7df;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.oficina-history-item {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) 115px;
  column-gap: 16px;
  row-gap: 4px;
  align-items: start;
  min-width: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #e5eee8;
}

.oficina-history-item:last-child {
  border-bottom: 0;
}

.oficina-history-date {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding-top: 2px;
  color: #0f2f2a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.oficina-history-main {
  grid-column: 2;
  min-width: 0;
}

.oficina-history-title {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.oficina-history-title.is-empty {
  color: #64748b;
}

.oficina-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 7px;
  min-width: 0;
  margin-top: 3px;
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.25;
}

.oficina-history-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.oficina-history-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 7px;
  color: #94a3b8;
}

.oficina-history-value {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  color: #0f2f2a;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.oficina-stock-table th:nth-child(2),
.oficina-stock-table td:nth-child(2),
.oficina-stock-table th:nth-child(5),
.oficina-stock-table td:nth-child(5) {
  width: 170px;
}

.oficina-stock-table th:nth-child(3),
.oficina-stock-table td:nth-child(3),
.oficina-stock-table th:nth-child(4),
.oficina-stock-table td:nth-child(4) {
  width: 95px;
}

.oficina-stock-table th:nth-child(6),
.oficina-stock-table td:nth-child(6),
.oficina-stock-table th:nth-child(7),
.oficina-stock-table td:nth-child(7),
.oficina-stock-table th:nth-child(8),
.oficina-stock-table td:nth-child(8) {
  width: 110px;
}

.oficina-catalog-page {
  display: grid;
  gap: 14px;
}

.oficina-catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #dbe5e0;
  border-radius: 10px;
  background: #fff;
}

.oficina-catalog-header h3,
.oficina-catalog-card h4 {
  margin: 0;
  color: #17322a;
}

.oficina-catalog-header p {
  margin: 4px 0 0;
  color: #63746b;
  font-size: 13px;
}

.oficina-catalog-message {
  padding: 8px 10px;
  border-radius: 8px;
  background: #e6f5ec;
  color: #176b4d;
  font-size: 13px;
  font-weight: 800;
}

.oficina-catalog-message.is-error {
  background: #fde2e2;
  color: #8a1f1f;
}

.oficina-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.oficina-catalog-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe5e0;
  border-radius: 10px;
  background: #fff;
}

.oficina-catalog-card .action-button {
  justify-self: start;
}

.oficina-catalog-table-wrap {
  border-radius: 10px;
}

.oficina-catalog-table th,
.oficina-catalog-table td {
  font-size: 13px;
}

.oficina-review-filter-bar .oficina-main-filters {
  grid-template-columns: 86px 142px 160px 128px 128px minmax(170px, 1fr) auto auto;
}

.oficina-check-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: #415148;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.oficina-check-filter input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
}

.oficina-revisions-page,
.oficina-review-list,
.oficina-review-alert-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.oficina-section-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe5e0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(21, 35, 28, 0.05);
}

.oficina-section-hero h2 {
  margin: 0;
  color: #17322a;
  font-size: 20px;
  line-height: 1.15;
}

.oficina-section-hero p {
  margin: 3px 0 0;
  color: #63746b;
  font-size: 13px;
}

.oficina-review-primary {
  white-space: nowrap;
}

.oficina-review-kpis {
  margin: 0;
}

.oficina-review-alerts,
.oficina-review-list-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe5e0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(21, 35, 28, 0.05);
}

.oficina-review-alert {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1.3fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe5e0;
  border-left: 4px solid #176b4d;
  border-radius: 8px;
  background: #fdfefe;
}

.oficina-review-alert.is-danger {
  border-left-color: #c24141;
}

.oficina-review-alert.is-warning {
  border-left-color: #d39500;
}

.oficina-review-alert.is-info {
  border-left-color: #2c74b8;
}

.oficina-review-alert-main,
.oficina-review-row-main > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.oficina-review-alert-main strong,
.oficina-review-row-main strong {
  color: #17322a;
  font-size: 13px;
  line-height: 1.2;
}

.oficina-review-alert-main span,
.oficina-review-row-main span {
  color: #2a3f35;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.oficina-review-alert-main small {
  color: #63746b;
  font-size: 11px;
  font-weight: 700;
}

.oficina-review-alert-meta,
.oficina-review-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
  color: #63746b;
  font-size: 12px;
  line-height: 1.25;
}

.oficina-review-alert-meta span,
.oficina-review-row-meta span {
  overflow-wrap: anywhere;
}

.oficina-review-alert-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.oficina-review-alert-actions .action-button {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.oficina-review-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe5e0;
  border-radius: 8px;
  background: #fff;
}

.oficina-review-row.is-inactive {
  opacity: 0.68;
}

.oficina-review-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.oficina-review-cost {
  color: #17322a;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.oficina-review-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.oficina-review-row-actions .link-button {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #176b4d;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.oficina-review-row-actions .link-button:hover {
  text-decoration: underline;
}

.oficina-status-badge.is-muted {
  background: #edf2f0;
  color: #64746c;
}

.oficina-review-form-card {
  width: min(920px, calc(100vw - 32px));
}

.oficina-review-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.oficina-review-form-grid textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border: 1px solid #d4ded8;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

@media (max-width: 1180px) {
  .oficina-main-filters {
    grid-template-columns: 126px 126px 82px 128px 112px minmax(130px, 1fr) auto;
    gap: 6px;
  }

  .oficina-review-filter-bar .oficina-main-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .oficina-filter-actions button,
  .oficina-filter-actions .action-button {
    min-width: 66px;
    padding-inline: 10px;
  }
}

@media (max-width: 980px) {
  .oficina-main-filters,
  .oficina-advanced-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .oficina-catalog-grid {
    grid-template-columns: 1fr;
  }

  .oficina-filter-search {
    grid-column: 1 / -1;
  }

  .oficina-review-alert {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .oficina-review-alert-actions {
    justify-items: start;
  }

  .oficina-review-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .oficina-filter-actions {
    justify-content: start;
  }

  .oficina-results-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .oficina-profile-table {
    min-width: 980px;
  }

  .oficina-tires-table {
    min-width: 1120px;
  }

  .oficina-stock-table {
    min-width: 1080px;
  }

}

@media (max-width: 760px) {
  .oficina-history-item {
    grid-template-columns: 1fr auto;
    column-gap: 10px;
    row-gap: 6px;
  }

  .oficina-history-date {
    grid-column: 1;
    grid-row: 1;
  }

  .oficina-history-value {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .oficina-history-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .finance-main:has(.oficina-page) {
    padding-top: 12px;
  }

  .oficina-page-header h1 {
    font-size: 22px;
  }

  .oficina-main-filters,
  .oficina-advanced-grid {
    grid-template-columns: 1fr;
  }

  .oficina-review-filter-bar .oficina-main-filters,
  .oficina-review-form-grid {
    grid-template-columns: 1fr;
  }

  .oficina-filter-actions {
    grid-template-columns: 1fr 1fr;
  }

  .oficina-section-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .oficina-review-row-main {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .oficina-filter-actions button,
  .oficina-filter-actions .action-button {
    width: 100%;
  }

  .oficina-result-totals {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .oficina-result-totals span {
    padding-left: 0;
    border-left: 0;
  }

  .oficina-catalog-header {
    display: grid;
  }

  .oficina-profile-card {
    padding: 10px;
  }

  .oficina-profile-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

/* Fluxo de Caixa - layout compacto e responsivo */
body.fluxo-caixa-active .fin-header {
  display: none;
}

body.fluxo-caixa-active .finance-main,
body.fluxo-caixa-active .fin-content,
body.fluxo-caixa-active .main-content {
  padding: 12px 16px 18px;
}

body.fluxo-caixa-active .finance-main,
body.fluxo-caixa-active .fin-content,
body.fluxo-caixa-active .main-content,
body.fluxo-caixa-active .fluxo-page,
body.fluxo-caixa-active .fluxo-page * {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

body.fluxo-caixa-active,
body.fluxo-caixa-active .finance-layout,
body.fluxo-caixa-active .finance-main,
body.fluxo-caixa-active .fin-content,
body.fluxo-caixa-active .main-content,
body.fluxo-caixa-active .fluxo-page {
  overflow-x: hidden;
}

.fluxo-page {
  width: 100%;
  gap: 12px;
}

.fluxo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.fluxo-header-copy,
.fluxo-header-side {
  min-width: 0;
}

.fluxo-header h3 {
  margin: 0 0 2px;
  font-size: 1.28rem;
  line-height: 1.15;
}

.fluxo-header .note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.3;
}

.fluxo-header-side {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.fluxo-subnav {
  gap: 6px;
}

.fluxo-subnav-link {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.8rem;
}

.fluxo-filter-card.panel-card {
  padding: 14px 16px;
  overflow: hidden;
}

.fluxo-filters {
  display: grid;
  gap: 8px;
  margin: 0;
}

.filters-grid.fluxo-filters-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: end;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.filters-grid.fluxo-filters-grid > *,
.filters-grid.fluxo-filters-grid .filter-field {
  min-width: 0;
  max-width: 100%;
}

.filters-grid.fluxo-filters-grid .filter-field {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.2;
}

.filters-grid.fluxo-filters-grid input,
.filters-grid.fluxo-filters-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 0.82rem;
}

.fluxo-filter-actions {
  justify-content: flex-end;
  align-items: end;
  margin: 0;
}

.fluxo-filter-actions .action-button,
.fluxo-filter-actions button,
.fluxo-filter-actions a {
  width: auto;
  min-width: 118px;
  max-width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 5px 11px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.fluxo-status-row {
  justify-content: flex-end;
  gap: 6px;
}

.fluxo-data-badge {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 0.64rem;
}

.fluxo-data-note {
  font-size: 0.76rem;
}

.cards-grid.wide.fluxo-cards,
.metric-grid.fluxo-cards,
.fluxo-page .cards-grid.wide.fluxo-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.cards-grid.wide.fluxo-cards .metric-card {
  display: grid;
  align-content: start;
  gap: 5px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 104px;
  padding: 11px 12px;
  border-radius: 12px;
}

.cards-grid.wide.fluxo-cards .metric-card span {
  font-size: 0.68rem;
  line-height: 1.2;
}

.cards-grid.wide.fluxo-cards .metric-card strong {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.12;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.fluxo-card .card-meta,
.cards-grid.wide.fluxo-cards .metric-card p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.28;
}

.fluxo-card[data-card-id="total_entradas"] strong,
.fluxo-card[data-card-id="saldo_final"] strong,
.fluxo-card-positive strong,
.is-positive-text {
  color: #1f7a50;
}

.fluxo-card[data-card-id="total_saidas"] strong,
.fluxo-card[data-card-id="geracao_liquida"].fluxo-card-negative strong,
.fluxo-card-negative strong,
.is-negative-text {
  color: #9f3434;
}

.fluxo-hero-grid,
.fluxo-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.fluxo-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fluxo-page .panel-card {
  padding: 14px 16px;
  overflow: hidden;
}

.fluxo-page .section-header {
  margin-bottom: 8px;
}

.fluxo-page .section-header h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.2;
}

.fluxo-chart-area {
  min-height: 218px;
}

.fluxo-chart-svg {
  height: 178px;
}

.fluxo-chart-legend {
  gap: 8px;
  margin-top: 5px;
  font-size: 0.7rem;
}

.fluxo-alert-list,
.fluxo-bars,
.fluxo-aging-list {
  gap: 8px;
}

.fluxo-alert {
  padding: 9px 10px;
  border-radius: 10px;
}

.fluxo-alert strong {
  margin-bottom: 2px;
  font-size: 0.84rem;
}

.fluxo-alert p,
.fluxo-bar-head span,
.fluxo-aging-row span,
.fluxo-aging-meta span {
  font-size: 0.76rem;
  line-height: 1.3;
}

.fluxo-bar-row,
.fluxo-aging-row {
  gap: 5px;
}

.fluxo-mini-cards {
  gap: 8px;
  margin-bottom: 10px;
}

.fluxo-mini-cards .metric-card {
  min-height: 78px;
  padding: 9px 10px;
}

.fluxo-mini-cards .metric-card strong {
  font-size: 1rem;
}

.fluxo-page .dre-table-wrapper,
.fluxo-table-wrapper,
.fluxo-table-scroll,
.fluxo-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 310px;
}

.fluxo-table,
.fluxo-projection-table {
  width: max-content;
  min-width: 100%;
}

.fluxo-table th,
.fluxo-table td,
.fluxo-projection-table th,
.fluxo-projection-table td {
  padding: 7px 9px;
  white-space: nowrap;
}

.fluxo-table-toolbar {
  gap: 8px;
  margin-bottom: 8px;
}

.fluxo-table-toolbar .table-toolbar-filters {
  flex: 1 1 360px;
}

.fluxo-table-toolbar input,
.fluxo-table-toolbar select {
  height: 32px;
  min-height: 32px;
  font-size: 0.8rem;
}

.fluxo-quick-filters {
  gap: 5px;
}

.fluxo-quick-filters button {
  padding: 5px 9px;
  font-size: 0.74rem;
}

.fluxo-pagination {
  margin-top: 7px;
}

@media (max-width: 1200px) {
  .filters-grid.fluxo-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cards-grid.wide.fluxo-cards,
  .metric-grid.fluxo-cards,
  .fluxo-page .cards-grid.wide.fluxo-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .cards-grid.wide.fluxo-cards,
  .metric-grid.fluxo-cards,
  .fluxo-page .cards-grid.wide.fluxo-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fluxo-hero-grid,
  .fluxo-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.fluxo-caixa-active .finance-main,
  body.fluxo-caixa-active .fin-content,
  body.fluxo-caixa-active .main-content {
    padding: 10px;
  }

  .filters-grid.fluxo-filters-grid,
  .cards-grid.wide.fluxo-cards,
  .metric-grid.fluxo-cards,
  .fluxo-hero-grid,
  .fluxo-two-column {
    grid-template-columns: 1fr;
  }

  .fluxo-filter-card,
  .panel-card {
    padding: 16px;
  }

  .fluxo-header {
    display: block;
  }

  .fluxo-subnav {
    overflow-x: auto;
    white-space: nowrap;
    margin-top: 12px;
    flex-wrap: nowrap;
  }

  .fluxo-header-side {
    justify-items: start;
  }

  .fluxo-status-row {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .fluxo-filter-actions .action-button,
  .fluxo-filter-actions button,
  .fluxo-filter-actions a {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .cards-grid.wide.fluxo-cards,
  .metric-grid.fluxo-cards,
  .fluxo-page .cards-grid.wide.fluxo-cards {
    grid-template-columns: 1fr;
  }

  .cards-grid.wide.fluxo-cards .metric-card strong {
    white-space: normal;
  }
}

/* Fluxo de Caixa - refinamento tipografico compacto - producao 20260721f */
body.fluxo-caixa-active {
  --font-page-title: 24px;
  --font-section-title: 16px;
  --font-card-value: 20px;
  --font-label: 11px;
  --font-body: 13px;
  --font-small: 11px;
}

body.fluxo-caixa-active .finance-main,
body.fluxo-caixa-active .fin-content,
body.fluxo-caixa-active .main-content {
  padding: 10px 14px 16px;
}

.fluxo-page {
  gap: 10px;
  font-size: var(--font-body);
  color: #1f2d27;
  line-height: 1.38;
}

.fluxo-page h1,
.fluxo-page h2,
.fluxo-page h3 {
  line-height: 1.2;
}

.fluxo-header h3 {
  font-size: var(--font-page-title);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 2px;
}

.fluxo-header .note,
.fluxo-page .note,
.fluxo-page .section-description,
.fluxo-data-note,
.fluxo-pagination {
  color: #66736c;
  font-size: var(--font-small);
  line-height: 1.35;
}

.fluxo-header-side {
  gap: 6px;
}

.fluxo-subnav-link {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.fluxo-filter-card.panel-card {
  padding: 10px 12px;
  border-color: #e4ebe6;
  box-shadow: 0 4px 14px rgba(21, 35, 28, 0.05);
}

.fluxo-filters {
  gap: 7px;
}

.filters-grid.fluxo-filters-grid {
  gap: 7px 9px;
}

.filters-grid.fluxo-filters-grid .filter-field {
  gap: 3px;
  color: #3f5048;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.filters-grid.fluxo-filters-grid input,
.filters-grid.fluxo-filters-grid select,
.fluxo-page input,
.fluxo-page select {
  height: 36px;
  min-height: 36px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.25;
}

.fluxo-filter-actions .action-button,
.fluxo-filter-actions button,
.fluxo-filter-actions a {
  height: 34px;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  background: #edf3ef;
  color: #28473a;
  border: 1px solid #d9e4dd;
  box-shadow: none;
}

.fluxo-data-badge {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.cards-grid.wide.fluxo-cards,
.metric-grid.fluxo-cards,
.fluxo-page .cards-grid.wide.fluxo-cards {
  gap: 8px;
}

.cards-grid.wide.fluxo-cards .metric-card {
  min-height: 88px;
  padding: 14px;
  gap: 4px;
  border-color: #e4ebe6;
  box-shadow: 0 4px 16px rgba(21, 35, 28, 0.055);
}

.cards-grid.wide.fluxo-cards .metric-card span {
  color: #66736c;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.22;
  text-transform: uppercase;
}

.cards-grid.wide.fluxo-cards .metric-card strong {
  font-size: var(--font-card-value);
  font-weight: 700;
  line-height: 1.12;
}

.fluxo-card .card-meta,
.cards-grid.wide.fluxo-cards .metric-card p {
  color: #748078;
  font-size: 11px;
  line-height: 1.32;
}

.fluxo-card:not([data-card-id="geracao_liquida"]):not([data-card-id="saldo_final"]):not([data-card-id="recebiveis_vencidos"]) strong {
  color: #26362f;
}

.fluxo-card[data-card-id="geracao_liquida"],
.fluxo-card[data-card-id="saldo_final"],
.fluxo-card[data-card-id="recebiveis_vencidos"],
.fluxo-card-critical {
  border-color: #d7e4dc;
  box-shadow: 0 6px 18px rgba(21, 35, 28, 0.07);
}

.fluxo-card[data-card-id="total_entradas"] {
  border-top: 3px solid rgba(31, 122, 80, 0.35);
}

.fluxo-card[data-card-id="total_saidas"] {
  border-top: 3px solid rgba(159, 52, 52, 0.3);
}

.fluxo-card[data-card-id="geracao_liquida"].fluxo-card-negative,
.fluxo-card[data-card-id="recebiveis_vencidos"].fluxo-card-negative {
  border-color: rgba(159, 52, 52, 0.28);
}

.fluxo-card[data-card-id="geracao_liquida"].fluxo-card-positive,
.fluxo-card[data-card-id="saldo_final"] {
  border-color: rgba(31, 122, 80, 0.28);
}

.fluxo-hero-grid,
.fluxo-two-column {
  gap: 10px;
}

.fluxo-page .panel-card {
  padding: 12px 14px;
  border-color: #e4ebe6;
  box-shadow: 0 4px 16px rgba(21, 35, 28, 0.055);
}

.fluxo-page .section-header {
  margin-bottom: 6px;
}

.fluxo-page .section-header h3 {
  color: #1f2d27;
  font-size: var(--font-section-title);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.fluxo-chart-area {
  min-height: 198px;
}

.fluxo-chart-svg {
  height: 162px;
}

.fluxo-chart-svg text {
  font-size: 10px;
}

.fluxo-chart-legend {
  gap: 7px 10px;
  margin-top: 4px;
  color: #66736c;
  font-size: 11px;
  line-height: 1.25;
}

.fluxo-alert-list,
.fluxo-bars,
.fluxo-aging-list {
  gap: 6px;
}

.fluxo-alert {
  padding: 8px 10px;
  border-radius: 9px;
  box-shadow: none;
}

.fluxo-alert strong {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.fluxo-alert p,
.fluxo-bar-head span,
.fluxo-aging-row span,
.fluxo-aging-meta span,
.fluxo-projection-table td small {
  font-size: 11px;
  line-height: 1.35;
}

.fluxo-alert-critico {
  background: #fff7f7;
  border-left-color: #9f3434;
}

.fluxo-alert-atencao {
  background: #fffaf0;
  border-left-color: #c58f2a;
}

.fluxo-alert-informacao {
  background: #f5fbf7;
  border-left-color: #1f7a50;
}

.fluxo-bar-row,
.fluxo-aging-row {
  gap: 4px;
}

.fluxo-bar-head strong,
.fluxo-aging-meta strong {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.fluxo-bar-track {
  height: 7px;
}

.fluxo-mini-cards {
  gap: 7px;
  margin-bottom: 8px;
}

.fluxo-mini-cards .metric-card {
  min-height: 68px;
  padding: 9px 10px;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(21, 35, 28, 0.045);
}

.fluxo-mini-cards .metric-card span {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.fluxo-mini-cards .metric-card strong {
  font-size: 16px;
  font-weight: 700;
}

.fluxo-page .dre-table-wrapper,
.fluxo-table-wrapper,
.fluxo-table-scroll,
.fluxo-table-wrap {
  max-height: 292px;
}

.fluxo-table th,
.fluxo-projection-table th {
  padding: 6px 8px;
  color: #53635b;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.25;
  text-transform: uppercase;
}

.fluxo-table td,
.fluxo-projection-table td {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.fluxo-table-toolbar {
  gap: 7px;
  margin-bottom: 7px;
}

.fluxo-table-toolbar input,
.fluxo-table-toolbar select {
  height: 34px;
  min-height: 34px;
  font-size: 12px;
}

.fluxo-quick-filters {
  gap: 5px;
}

.fluxo-quick-filters button {
  padding: 5px 8px;
  border-color: #dbe5df;
  font-size: 11px;
  font-weight: 650;
}

.fluxo-pill,
.status-badge {
  min-height: 20px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}

.fluxo-pill.is-positive,
.status-badge.status-success {
  background: rgba(31, 122, 80, 0.12);
  color: #1f7a50;
}

.fluxo-pill.is-negative,
.status-badge.status-error {
  background: rgba(159, 52, 52, 0.12);
  color: #9f3434;
}

.status-badge.status-pending,
.fluxo-pill.is-attention {
  background: rgba(197, 143, 42, 0.14);
  color: #8a641b;
}

.fluxo-pill.is-neutral,
.status-badge.status-neutral {
  background: #edf2ef;
  color: #53665b;
}

.fluxo-line-projected {
  stroke: #c58f2a;
  stroke-dasharray: 7 6;
}

.fluxo-line-real {
  stroke: #1f513f;
}

.fluxo-pagination {
  margin-top: 6px;
}

@media (max-width: 1366px) and (max-height: 780px) {
  body.fluxo-caixa-active .finance-main,
  body.fluxo-caixa-active .fin-content,
  body.fluxo-caixa-active .main-content {
    padding: 8px 12px 14px;
  }

  .fluxo-page {
    gap: 8px;
  }

  .fluxo-header h3 {
    font-size: 22px;
  }

  .cards-grid.wide.fluxo-cards .metric-card {
    min-height: 82px;
    padding: 12px;
  }

  .fluxo-chart-area {
    min-height: 182px;
  }

  .fluxo-chart-svg {
    height: 148px;
  }

  .fluxo-page .panel-card {
    padding: 10px 12px;
  }
}

@media (max-width: 760px) {
  .fluxo-header h3 {
    font-size: 22px;
  }

  .fluxo-filter-card,
  .panel-card {
    padding: 12px;
  }
}

/* Clientes - refinamento executivo do resumo e filtros rapidos */
.clientes-page .summary-grid,
.clientes-page .clientes-kpi-grid.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.clientes-page .summary-card.metric-card.kpi-card {
  min-height: 112px;
  height: 112px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(12, 61, 53, 0.08);
  box-shadow: 0 4px 14px rgba(20, 45, 38, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.clientes-page .summary-card .summary-card-value,
.clientes-page .summary-card .kpi-value {
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  overflow-wrap: normal;
}

.clientes-page .quick-filters.panel-card {
  min-height: 112px;
  padding: 14px 18px;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .clientes-page .summary-grid,
  .clientes-page .clientes-kpi-grid.summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clientes-page .summary-card .summary-card-value,
  .clientes-page .summary-card .kpi-value {
    font-size: 23px;
  }
}

@media (max-width: 700px) {
  .clientes-page .summary-grid,
  .clientes-page .clientes-kpi-grid.summary-grid {
    grid-template-columns: 1fr;
  }

  .clientes-page .summary-card.metric-card.kpi-card {
    min-height: 100px;
    height: 100px;
  }

  .clientes-page .summary-card .summary-card-value,
  .clientes-page .summary-card .kpi-value {
    font-size: 20px;
  }
}

.sac-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sac-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, auto) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
}

.sac-header h3 {
  margin: 0;
  font-size: 1.35rem;
  color: #102033;
}

.sac-header p,
.sac-note {
  margin: 4px 0 0;
  color: #5b6472;
  font-size: 0.84rem;
}

.sac-header-meta {
  display: grid;
  gap: 4px;
  color: #354052;
  font-size: 0.78rem;
}

.sac-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.sac-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
}

.sac-filters label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
}

.sac-filters input,
.sac-filters select {
  min-width: 0;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 8px;
  color: #0f172a;
  background: #fff;
  font-size: 0.82rem;
}

.sac-filters .sac-check {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
}

.sac-filters .sac-check input {
  width: 16px;
  height: 16px;
}

.sac-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
}

.sac-card {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid #d7dde5;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #ffffff;
}

.sac-card span {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
}

.sac-card strong {
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1.1;
}

.sac-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}

.sac-chart-panel,
.sac-table-section {
  padding: 12px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
}

.sac-chart-panel h4,
.sac-table-section h4 {
  margin: 0 0 8px;
  color: #1f2937;
  font-size: 0.95rem;
}

.sac-chart-panel canvas {
  width: 100%;
  display: block;
}

.sac-table-wrap {
  overflow: auto;
}

.sac-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.sac-table th,
.sac-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}

.sac-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.sac-critical-table tr.is-danger td {
  background: #fff1f2;
}

.sac-critical-table tr.is-warn td {
  background: #fffbeb;
}

.sac-critical-table tr.is-ok td {
  background: #f0fdf4;
}

.sac-critical-table tr.is-bot td {
  background: #eff6ff;
}

.sac-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.sac-modal[hidden] {
  display: none;
}

.sac-modal-dialog {
  width: min(980px, 96vw);
  max-height: 88vh;
  overflow: auto;
  position: relative;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.sac-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.sac-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin: 12px 0;
  font-size: 0.82rem;
}

.sac-detail-grid span {
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
}

.sac-timeline {
  display: grid;
  gap: 8px;
}

.sac-message {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #64748b;
  border-radius: 8px;
}

.sac-message.is-client,
.sac-message.is-customer,
.sac-message.is-contact {
  border-left-color: #b45309;
}

.sac-message.is-agent,
.sac-message.is-human,
.sac-message.is-attendant {
  border-left-color: #0f766e;
}

.sac-message.is-bot {
  border-left-color: #2563eb;
}

.sac-message div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #475569;
  font-size: 0.75rem;
}

.sac-message p {
  margin: 6px 0 0;
  color: #111827;
  white-space: pre-wrap;
}

.sac-events {
  color: #475569;
  font-size: 0.8rem;
}

@media (max-width: 1180px) {
  .sac-header {
    grid-template-columns: 1fr;
  }

  .sac-actions {
    justify-content: flex-start;
  }

  .sac-filters {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .sac-cards {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .sac-filters,
  .sac-chart-grid,
  .sac-detail-grid {
    grid-template-columns: 1fr;
  }

  .sac-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sac-card strong {
    font-size: 1rem;
  }
}

/* Redespacho - ajuste final para notebook */
body.redespacho-page-active .finance-main,
body.redespacho-page-active .main-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.redespacho-page-active .redespacho-page,
body.redespacho-page-active .redespacho-filters,
body.redespacho-page-active .redespacho-table-card,
body.redespacho-page-active .redespacho-info-state {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.redespacho-page-active .redespacho-page {
  overflow-x: hidden;
}

body.redespacho-page-active .redespacho-kpi,
body.redespacho-page-active .redespacho-filters-grid > *,
body.redespacho-page-active .redespacho-table-card {
  min-width: 0;
}

body.redespacho-page-active .redespacho-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.redespacho-page-active .redespacho-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

body.redespacho-page-active .redespacho-table {
  width: 100%;
}

@media (max-width: 1440px) and (max-height: 900px) {
  body.redespacho-page-active .fin-header {
    display: none;
  }

  body.redespacho-page-active .redespacho-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.redespacho-page-active .filters-grid.redespacho-filters-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
  }

  body.redespacho-page-active .redespacho-filter-actions {
    justify-content: flex-end;
    margin-top: 8px;
  }

  body.redespacho-page-active .redespacho-filter-actions .action-button {
    flex: 0 0 auto;
    max-width: 170px;
  }

  body.redespacho-page-active .redespacho-table th,
  body.redespacho-page-active .redespacho-table td {
    min-width: 78px;
    padding: 7px 8px;
  }

  body.redespacho-page-active .redespacho-table th:first-child,
  body.redespacho-page-active .redespacho-table td:first-child {
    min-width: 94px;
    max-width: 112px;
  }

  body.redespacho-page-active .redespacho-table th:nth-child(5),
  body.redespacho-page-active .redespacho-table td:nth-child(5) {
    min-width: 150px;
    max-width: 190px;
  }

  body.redespacho-page-active .redespacho-table th:nth-child(11),
  body.redespacho-page-active .redespacho-table td:nth-child(11) {
    min-width: 132px;
    max-width: 160px;
  }

  body.redespacho-page-active .redespacho-table th:nth-child(6),
  body.redespacho-page-active .redespacho-table td:nth-child(6),
  body.redespacho-page-active .redespacho-table th:nth-child(7),
  body.redespacho-page-active .redespacho-table td:nth-child(7),
  body.redespacho-page-active .redespacho-table th:nth-child(8),
  body.redespacho-page-active .redespacho-table td:nth-child(8),
  body.redespacho-page-active .redespacho-table th:nth-child(9),
  body.redespacho-page-active .redespacho-table td:nth-child(9) {
    display: none;
  }
}

@media (max-width: 1368px) and (max-height: 780px) {
  body.redespacho-page-active .finance-main {
    padding: 14px 12px;
  }

  body.redespacho-page-active .redespacho-header h3 {
    font-size: 1.05rem;
  }

  body.redespacho-page-active .redespacho-subtitle {
    font-size: 0.78rem;
  }

  body.redespacho-page-active .redespacho-kpi {
    min-height: 54px;
    padding: 8px 10px;
  }

  body.redespacho-page-active .redespacho-filters.panel-card,
  body.redespacho-page-active .redespacho-table-card.panel-card,
  body.redespacho-page-active .redespacho-info-state.panel-card {
    padding: 9px;
  }

  body.redespacho-page-active .filters-grid.redespacho-filters-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

body.redespacho-page-active .redespacho-filters input,
  body.redespacho-page-active .redespacho-filters select {
    min-height: 28px;
    font-size: 0.72rem;
  }
}

/* Redespacho - layout responsivo definitivo */
body.redespacho-page-active {
  overflow-x: hidden;
}

body.redespacho-page-active .fin-header {
  display: none;
}

body.redespacho-page-active .finance-layout,
body.redespacho-page-active .finance-main,
body.redespacho-page-active .main-content,
body.redespacho-page-active .redespacho-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.redespacho-page-active .finance-main,
body.redespacho-page-active .main-content,
body.redespacho-page-active .redespacho-page {
  overflow-x: clip;
}

body.redespacho-page-active .redespacho-page {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
}

body.redespacho-page-active .redespacho-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

body.redespacho-page-active .redespacho-header > div {
  min-width: 0;
}

body.redespacho-page-active .redespacho-header h3 {
  margin: 0 0 3px;
  font-size: 1.24rem;
  line-height: 1.16;
}

body.redespacho-page-active .redespacho-subtitle {
  max-width: 820px;
  font-size: 0.84rem;
  line-height: 1.28;
}

body.redespacho-page-active .redespacho-import-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 8px;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-export-form {
  margin: 0;
  flex: 0 0 auto;
}

body.redespacho-page-active .redespacho-inline-form {
  margin: 0;
}

body.redespacho-page-active .redespacho-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

body.redespacho-page-active .redespacho-row-muted {
  opacity: 0.58;
}

body.redespacho-page-active .redespacho-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  min-width: 0;
}

body.redespacho-page-active .redespacho-kpi {
  min-width: 0;
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 10px;
}

body.redespacho-page-active .redespacho-kpi .kpi-label {
  font-size: 0.76rem;
  line-height: 1.2;
}

body.redespacho-page-active .redespacho-kpi .kpi-value {
  margin-top: 5px;
  font-size: 1.2rem;
  line-height: 1.1;
}

body.redespacho-page-active .redespacho-filters.panel-card,
body.redespacho-page-active .redespacho-table-card.panel-card,
body.redespacho-page-active .redespacho-info-state.panel-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  border-radius: 10px;
  padding: 10px;
}

body.redespacho-page-active .filters-grid.redespacho-filters-grid {
  display: grid;
  grid-template-columns:
    minmax(125px, 0.8fr)
    minmax(125px, 0.8fr)
    minmax(130px, 0.8fr)
    minmax(170px, 1.2fr)
    minmax(130px, 0.8fr)
    minmax(140px, 0.8fr)
    minmax(176px, auto);
  gap: 8px;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.redespacho-page-active .redespacho-filters-grid > *,
body.redespacho-page-active .redespacho-filters .filter-field {
  min-width: 0;
}

body.redespacho-page-active .redespacho-filters .filter-field {
  display: grid;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
}

body.redespacho-page-active .redespacho-filters input,
body.redespacho-page-active .redespacho-filters select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
}

body.redespacho-page-active .redespacho-filter-actions {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(108px, auto);
  gap: 8px;
  align-self: end;
  justify-content: end;
  margin: 0;
  min-width: 0;
}

body.redespacho-page-active .redespacho-filter-actions .action-button {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-info-state {
  display: grid;
  grid-template-columns: 22px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  background: #f8fbf9;
  color: #17322a;
}

body.redespacho-page-active .redespacho-info-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e5efe9;
  color: #214b3d;
  font-size: 0.76rem;
  font-weight: 800;
}

body.redespacho-page-active .redespacho-info-state strong,
body.redespacho-page-active .redespacho-info-state p {
  margin: 0;
}

body.redespacho-page-active .redespacho-info-state strong {
  white-space: nowrap;
  font-size: 0.86rem;
}

body.redespacho-page-active .redespacho-info-state p {
  min-width: 0;
  overflow: hidden;
  color: #53665b;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-section-header {
  align-items: center;
  margin-bottom: 8px;
}

body.redespacho-page-active .redespacho-section-header h4 {
  font-size: 0.96rem;
}

body.redespacho-page-active .redespacho-table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 10px;
  contain: inline-size;
}

body.redespacho-page-active .redespacho-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  font-size: 0.78rem;
}

body.redespacho-page-active .redespacho-table th,
body.redespacho-page-active .redespacho-table td,
body.redespacho-page-active .redespacho-table th:first-child,
body.redespacho-page-active .redespacho-table td:first-child {
  display: table-cell;
  min-width: 0;
  max-width: none;
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

body.redespacho-page-active .redespacho-table th:nth-child(n),
body.redespacho-page-active .redespacho-table td:nth-child(n) {
  display: table-cell;
}

body.redespacho-page-active .redespacho-table th:nth-child(1),
body.redespacho-page-active .redespacho-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 128px;
  background: #dfece6;
}

body.redespacho-page-active .redespacho-table td:nth-child(1) {
  background: #fff;
}

body.redespacho-page-active .redespacho-table th:nth-child(2),
body.redespacho-page-active .redespacho-table td:nth-child(2) {
  position: sticky;
  left: 128px;
  z-index: 3;
  width: 112px;
  background: #dfece6;
}

body.redespacho-page-active .redespacho-table td:nth-child(2) {
  background: #fff;
}

body.redespacho-page-active .redespacho-table th:nth-child(3),
body.redespacho-page-active .redespacho-table td:nth-child(3) {
  width: 96px;
}

body.redespacho-page-active .redespacho-table th:nth-child(4),
body.redespacho-page-active .redespacho-table td:nth-child(4) {
  width: 86px;
}

body.redespacho-page-active .redespacho-table th:nth-child(5),
body.redespacho-page-active .redespacho-table td:nth-child(5) {
  width: 112px;
}

body.redespacho-page-active .redespacho-table th:nth-child(6),
body.redespacho-page-active .redespacho-table td:nth-child(6) {
  width: 122px;
}

body.redespacho-page-active .redespacho-table th:nth-child(7),
body.redespacho-page-active .redespacho-table td:nth-child(7) {
  width: 150px;
}

body.redespacho-page-active .redespacho-table th:nth-child(8),
body.redespacho-page-active .redespacho-table td:nth-child(8) {
  width: 52px;
}

body.redespacho-page-active .redespacho-table th:nth-child(9),
body.redespacho-page-active .redespacho-table td:nth-child(9) {
  width: 76px;
}

body.redespacho-page-active .redespacho-table th:nth-child(10),
body.redespacho-page-active .redespacho-table td:nth-child(10) {
  width: 76px;
}

body.redespacho-page-active .redespacho-table th:nth-child(11),
body.redespacho-page-active .redespacho-table td:nth-child(11) {
  width: 100px;
}

body.redespacho-page-active .redespacho-table th:nth-child(12),
body.redespacho-page-active .redespacho-table td:nth-child(12) {
  width: 82px;
}

body.redespacho-page-active .cell-truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-status {
  max-width: 100%;
  min-height: 22px;
  padding: 3px 7px;
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
}

body.redespacho-page-active .redespacho-detail-button {
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 0.72rem;
}

body.redespacho-page-active .redespacho-pagination {
  margin-top: 8px;
}

@media (max-width: 1440px) {
  body.redespacho-page-active .redespacho-page {
    gap: 9px;
  }

  body.redespacho-page-active .redespacho-kpi {
    min-height: 75px;
    padding: 11px 12px;
  }
}

@media (max-width: 1180px) {
  body.redespacho-page-active .redespacho-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.redespacho-page-active .filters-grid.redespacho-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.redespacho-page-active .redespacho-filter-actions {
    grid-column: auto;
    justify-content: start;
  }
}

@media (max-width: 760px) {
  body.redespacho-page-active .finance-main,
  body.redespacho-page-active .main-content {
    overflow-x: hidden;
  }

  body.redespacho-page-active .redespacho-header {
    align-items: stretch;
    flex-direction: column;
  }

  body.redespacho-page-active .redespacho-import-button {
    width: 100%;
    justify-content: center;
  }

  body.redespacho-page-active .redespacho-kpis,
  body.redespacho-page-active .filters-grid.redespacho-filters-grid {
    grid-template-columns: 1fr;
  }

  body.redespacho-page-active .redespacho-filter-actions {
    grid-template-columns: 1fr 1fr;
  }

  body.redespacho-page-active .redespacho-info-state {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
  }

  body.redespacho-page-active .redespacho-info-state p {
    grid-column: 2;
    white-space: normal;
  }

  body.redespacho-page-active .redespacho-table {
    min-width: 1180px;
  }

  body.redespacho-page-active .redespacho-pagination {
    align-items: stretch;
    flex-wrap: wrap;
  }
}

/* Redespacho - overrides finais da conferência financeira */
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table {
  min-width: 1540px;
}

body.redespacho-page-active .redespacho-table.redespacho-conferencia-table th:nth-child(7),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table td:nth-child(7),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table th:nth-child(8),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table td:nth-child(8) {
  width: 190px;
}

body.redespacho-page-active .redespacho-table.redespacho-conferencia-table th:nth-child(9),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table td:nth-child(9),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table th:nth-child(10),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table td:nth-child(10),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table th:nth-child(11),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table td:nth-child(11) {
  width: 124px;
  text-align: right;
}

body.redespacho-page-active .redespacho-table.redespacho-conferencia-table th:nth-child(13),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table td:nth-child(13) {
  width: 118px;
}

body.redespacho-page-active .redespacho-table.redespacho-conferencia-table th:nth-child(14),
body.redespacho-page-active .redespacho-table.redespacho-conferencia-table td:nth-child(14) {
  width: 180px;
}

/* Redespacho - conferencia compacta por excecao */
body.redespacho-page-active .redespacho-conferencia-page {
  gap: 10px;
}

body.redespacho-page-active .redespacho-conference-header {
  margin-bottom: 2px;
  padding-bottom: 0;
}

body.redespacho-page-active .redespacho-conference-header h3 {
  margin-bottom: 2px;
  font-size: 1.28rem;
}

body.redespacho-page-active .redespacho-conference-header .redespacho-subtitle {
  font-size: 0.82rem;
}

body.redespacho-page-active .redespacho-link-action {
  align-items: center;
  color: #51615b;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 34px;
  padding: 0 4px;
  text-decoration: none;
}

body.redespacho-page-active .redespacho-link-action:hover,
body.redespacho-page-active .redespacho-link-action:focus-visible {
  color: #0f5c3a;
  outline: none;
  text-decoration: underline;
}

body.redespacho-page-active .redespacho-summary-strip {
  background: #fff;
  border: 1px solid #dfe9e3;
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
}

body.redespacho-page-active .redespacho-summary-strip article {
  border-left: 1px solid #e8efe9;
  min-width: 0;
  padding: 8px 10px;
}

body.redespacho-page-active .redespacho-summary-strip article:first-child {
  border-left: 0;
}

body.redespacho-page-active .redespacho-summary-strip span {
  color: #66756f;
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-summary-strip strong {
  color: #17322a;
  display: block;
  font-size: 0.95rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-summary-strip .is-warning {
  background: #fff7df;
}

body.redespacho-page-active .redespacho-summary-strip .is-warning strong {
  color: #945308;
}

body.redespacho-page-active .is-positive strong,
body.redespacho-page-active .redespacho-result-cell.is-positive {
  color: #14623f;
}

body.redespacho-page-active .is-negative strong,
body.redespacho-page-active .redespacho-result-cell.is-negative {
  color: #a53b1f;
}

body.redespacho-page-active .redespacho-status-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 1px;
}

body.redespacho-page-active .redespacho-status-tabs a {
  align-items: center;
  background: #f7faf8;
  border: 1px solid #dfe9e3;
  border-radius: 999px;
  color: #33443d;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 6px;
  min-height: 31px;
  padding: 5px 10px;
  text-decoration: none;
}

body.redespacho-page-active .redespacho-status-tabs a span {
  background: #e8efe9;
  border-radius: 999px;
  color: #17322a;
  font-size: 0.72rem;
  min-width: 22px;
  padding: 1px 6px;
  text-align: center;
}

body.redespacho-page-active .redespacho-status-tabs a.is-active,
body.redespacho-page-active .redespacho-status-tabs a:focus-visible {
  background: #17322a;
  border-color: #17322a;
  color: #fff;
  outline: none;
}

body.redespacho-page-active .redespacho-status-tabs a.is-active span,
body.redespacho-page-active .redespacho-status-tabs a:focus-visible span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

body.redespacho-page-active .redespacho-conference-filters.panel-card {
  padding: 6px 8px;
}

body.redespacho-page-active .redespacho-filter-mainline,
body.redespacho-page-active .redespacho-more-filter-panel {
  align-items: end;
  display: grid;
  gap: 6px;
  grid-template-columns: 132px 132px minmax(150px, 1fr) minmax(170px, 1.2fr) 128px auto auto;
}

body.redespacho-page-active .redespacho-more-filter-panel {
  border-top: 1px solid #e8efe9;
  grid-template-columns: repeat(2, minmax(150px, 220px));
  margin-top: 6px;
  padding-top: 6px;
}

body.redespacho-page-active .redespacho-more-filter-panel[hidden] {
  display: none;
}

body.redespacho-page-active .redespacho-conference-filters .filter-field {
  font-size: 0.7rem;
  gap: 2px;
}

body.redespacho-page-active .redespacho-conference-filters input,
body.redespacho-page-active .redespacho-conference-filters select {
  min-height: 30px;
  padding: 4px 8px;
}

body.redespacho-page-active .redespacho-more-filters {
  min-height: 30px;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

body.redespacho-page-active .redespacho-filter-chips:empty {
  display: none;
}

body.redespacho-page-active .redespacho-filter-chips button {
  appearance: none;
  background: #eef4f0;
  border: 1px solid #dce8e1;
  border-radius: 999px;
  color: #33443d;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 750;
  font: inherit;
  padding: 2px 7px;
}

body.redespacho-page-active .redespacho-filter-chips button:hover {
  background: #e3eee7;
  border-color: #c8d8cf;
}

body.redespacho-page-active .redespacho-filter-chips button span {
  font-weight: 850;
  margin-left: 2px;
}

body.redespacho-page-active .redespacho-conference-table-card.panel-card {
  padding: 7px 10px;
}

body.redespacho-page-active .redespacho-conference-table-wrapper {
  max-height: calc(100vh - 285px);
  overflow: auto;
}

body.redespacho-page-active .redespacho-table.redespacho-exception-table {
  min-width: 1120px;
  table-layout: fixed;
}

body.redespacho-page-active .redespacho-exception-table th,
body.redespacho-page-active .redespacho-exception-table td {
  font-size: 0.78rem;
  padding: 5px 8px;
  vertical-align: middle;
}

body.redespacho-page-active .redespacho-exception-table thead th {
  background: #f6faf7;
  position: sticky;
  top: 0;
  z-index: 5;
}

body.redespacho-page-active .redespacho-exception-table .redespacho-col-select,
body.redespacho-page-active .redespacho-exception-table .redespacho-col-doc {
  background: inherit;
  position: sticky;
  z-index: 4;
}

body.redespacho-page-active .redespacho-exception-table thead .redespacho-col-select,
body.redespacho-page-active .redespacho-exception-table thead .redespacho-col-doc {
  background: #f6faf7;
  z-index: 7;
}

body.redespacho-page-active .redespacho-exception-table .redespacho-col-select {
  left: 0;
  width: 52px;
}

body.redespacho-page-active .redespacho-exception-table .redespacho-col-doc {
  left: 52px;
  width: 170px;
}

body.redespacho-page-active .redespacho-exception-table th:nth-child(3),
body.redespacho-page-active .redespacho-exception-table td:nth-child(3) {
  width: 108px;
}

body.redespacho-page-active .redespacho-exception-table th:nth-child(4),
body.redespacho-page-active .redespacho-exception-table td:nth-child(4) {
  width: 126px;
}

body.redespacho-page-active .redespacho-exception-table th:nth-child(5),
body.redespacho-page-active .redespacho-exception-table td:nth-child(5),
body.redespacho-page-active .redespacho-exception-table th:nth-child(6),
body.redespacho-page-active .redespacho-exception-table td:nth-child(6) {
  width: 160px;
}

body.redespacho-page-active .redespacho-exception-table th:nth-child(7),
body.redespacho-page-active .redespacho-exception-table td:nth-child(7),
body.redespacho-page-active .redespacho-exception-table th:nth-child(8),
body.redespacho-page-active .redespacho-exception-table td:nth-child(8) {
  width: 148px;
}

body.redespacho-page-active .redespacho-exception-table th:nth-child(9),
body.redespacho-page-active .redespacho-exception-table td:nth-child(9) {
  width: 118px;
}

body.redespacho-page-active .redespacho-conference-row {
  cursor: pointer;
}

body.redespacho-page-active .redespacho-conference-row:hover td,
body.redespacho-page-active .redespacho-conference-row:focus-visible td {
  background: #f7fbf8;
}

body.redespacho-page-active .redespacho-conference-row:focus-visible {
  outline: 2px solid #2f7b5a;
  outline-offset: -2px;
}

body.redespacho-page-active .redespacho-conference-row.is-divergente td {
  background: #fff7f4;
}

body.redespacho-page-active .redespacho-conference-row.is-sem-base td {
  background: #fff9e8;
}

body.redespacho-page-active .redespacho-conference-row.is-muted {
  color: #78847f;
  opacity: 0.74;
}

body.redespacho-page-active .redespacho-doc-cell,
body.redespacho-page-active .redespacho-money-stack,
body.redespacho-page-active .redespacho-result-cell {
  display: grid;
  gap: 2px;
  line-height: 1.22;
  min-width: 0;
}

body.redespacho-page-active .redespacho-doc-cell strong,
body.redespacho-page-active .redespacho-doc-cell span,
body.redespacho-page-active .redespacho-money-stack span,
body.redespacho-page-active .redespacho-result-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-doc-cell span,
body.redespacho-page-active .redespacho-money-stack span,
body.redespacho-page-active .redespacho-result-cell span {
  color: #66756f;
  font-size: 0.72rem;
}

body.redespacho-page-active .redespacho-route-cell {
  align-items: center;
  display: flex;
  gap: 5px;
  font-weight: 800;
}

body.redespacho-page-active .redespacho-route-cell .redespacho-editable-unit {
  min-height: 0;
  padding: 0;
}

body.redespacho-page-active .redespacho-detail-row td {
  background: #fbfdfb;
  padding: 0;
  white-space: normal;
}

body.redespacho-page-active .redespacho-detail-panel {
  border-top: 1px solid #e4eee7;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  padding: 12px 14px;
  white-space: normal;
}

body.redespacho-page-active .finance-layout:not(.is-sidebar-collapsed) .redespacho-detail-panel {
  width: calc(100vw - var(--sidebar-width, 210px) - 56px);
}

body.redespacho-page-active .finance-layout.is-sidebar-collapsed .redespacho-detail-panel {
  width: calc(100vw - var(--sidebar-collapsed-width, 64px) - 56px);
}

body.redespacho-page-active .redespacho-detail-panel section {
  min-width: 0;
}

body.redespacho-page-active .redespacho-detail-panel h5 {
  color: #17322a;
  font-size: 0.72rem;
  letter-spacing: 0;
  margin: 0 0 7px;
  text-transform: uppercase;
}

body.redespacho-page-active .redespacho-detail-panel dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

body.redespacho-page-active .redespacho-detail-panel dl div {
  min-width: 0;
}

body.redespacho-page-active .redespacho-detail-panel dt {
  color: #68776f;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 2px;
  text-transform: uppercase;
}

body.redespacho-page-active .redespacho-detail-panel dd {
  color: #44544e;
  display: block;
  font-size: 0.79rem;
  line-height: 1.38;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

body.redespacho-page-active .redespacho-detail-panel .is-wide {
  grid-column: 1 / -1;
}

body.redespacho-page-active .redespacho-bulk-bar {
  align-items: center;
  background: #17322a;
  border-radius: 12px;
  bottom: 18px;
  box-shadow: 0 12px 28px rgba(23, 50, 42, 0.22);
  color: #fff;
  display: flex;
  gap: 8px;
  left: 50%;
  padding: 8px 10px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 50;
}

body.redespacho-page-active .redespacho-bulk-bar[hidden] {
  display: none;
}

body.redespacho-page-active .redespacho-bulk-bar span {
  font-size: 0.82rem;
  font-weight: 800;
  margin-right: 4px;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-bulk-bar .action-button {
  min-height: 30px;
  padding: 5px 9px;
}

body.redespacho-page-active .redespacho-report-row {
  cursor: pointer;
}

body.redespacho-page-active .redespacho-report-filter-note {
  align-items: center;
  background: #eef4f0;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  color: #253a32;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 6px 0 8px;
  padding: 6px 8px;
}

body.redespacho-page-active .redespacho-report-filter-note[hidden] {
  display: none;
}

body.redespacho-page-active .redespacho-report-filter-note span {
  font-size: 0.78rem;
  font-weight: 750;
}

body.redespacho-page-active .redespacho-report-filter-note .action-button {
  min-height: 28px;
  padding: 4px 8px;
}

body.redespacho-page-active .redespacho-report-row:hover td,
body.redespacho-page-active .redespacho-report-row:focus-visible td {
  background: #f7fbf8;
}

body.redespacho-page-active .redespacho-report-name {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: text;
  display: block;
  font: inherit;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.redespacho-page-active .redespacho-report-name:focus-visible {
  outline: 2px solid #2f7b5a;
  outline-offset: 2px;
}

body.redespacho-page-active .redespacho-report-detail-row td {
  background: #fbfdfb;
  padding: 0;
  white-space: normal;
}

body.redespacho-page-active .redespacho-report-detail {
  border-top: 1px solid #e4eee7;
  padding: 10px 12px;
}

body.redespacho-page-active .redespacho-report-detail strong {
  color: #17322a;
  display: block;
  font-size: 0.72rem;
  margin-bottom: 5px;
  text-transform: uppercase;
}

body.redespacho-page-active .redespacho-report-detail p {
  color: #44544e;
  font-size: 0.79rem;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 1180px) {
  body.redespacho-page-active .redespacho-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.redespacho-page-active .redespacho-filter-mainline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.redespacho-page-active .redespacho-conference-table-wrapper {
    max-height: calc(100vh - 330px);
  }

  body.redespacho-page-active .redespacho-detail-panel {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  body.redespacho-page-active .redespacho-summary-strip,
  body.redespacho-page-active .redespacho-filter-mainline,
  body.redespacho-page-active .redespacho-more-filter-panel {
    grid-template-columns: 1fr;
  }

  body.redespacho-page-active .redespacho-col-emissao,
  body.redespacho-page-active .redespacho-col-cliente,
  body.redespacho-page-active .redespacho-col-parceiro {
    display: none;
  }

  body.redespacho-page-active .redespacho-table.redespacho-exception-table {
    min-width: 780px;
  }

  body.redespacho-page-active .redespacho-detail-panel {
    grid-template-columns: 1fr;
    width: calc(100vw - 24px);
  }

  body.redespacho-page-active .redespacho-bulk-bar {
    align-items: stretch;
    flex-direction: column;
    left: 12px;
    right: 12px;
    transform: none;
  }
}
