@media screen and (min-width: 900px) {
  .dashboard-shell {
    zoom: 0.75;
    min-height: 133.333vh;
  }

  .dashboard-shell .sidebar {
    min-height: 133.333vh;
  }
}
:root {
  font-family: Inter, system-ui, Arial, sans-serif;
  --insight-blue-900: #0a2f63;
  --insight-blue-800: #0d3f84;
  --insight-blue-700: #1254aa;
  --insight-blue-600: #1d67c2;
  --insight-surface: #ffffff;
  --insight-bg: #eff4fb;
  --insight-bg-soft: #f7faff;
  --insight-border: #d8e2f1;
  --insight-border-strong: #b8cae4;
  --insight-text: #0f172a;
  --insight-text-soft: #475569;
  --insight-dark: #0b1220;
  --insight-danger-bg: #fef2f2;
  --insight-danger-text: #b91c1c;
  --insight-danger-border: #fecaca;
}

.financeiro-filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(180px, 1fr) 145px 145px 130px 130px 110px;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1rem;
}

.financeiro-filters label,
.financeiro-filters button,
.financeiro-page .inline-form label,
.financeiro-page .inline-form button {
  margin-bottom: 0;
}

.financeiro-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.finance-kpi {
  border: 0;
  color: #fff;
  min-height: 104px;
  overflow: hidden;
  position: relative;
}

.finance-kpi::after {
  content: "";
  position: absolute;
  width: 88px;
  height: 88px;
  right: -18px;
  top: -20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.finance-kpi span {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  font-size: 0.86rem;
}

.finance-kpi strong {
  color: #fff;
  font-size: clamp(1.15rem, 1.6vw, 1.65rem);
  margin-top: 0.5rem;
}

.finance-kpi.dark { background: linear-gradient(135deg, #050a14 0%, #09234b 100%); }
.finance-kpi.success { background: linear-gradient(135deg, #0d7a3f 0%, #19a05a 100%); }
.finance-kpi.danger { background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%); }
.finance-kpi.warn { background: linear-gradient(135deg, #6b4c00 0%, #d19700 100%); }
.finance-kpi.info { background: linear-gradient(135deg, #0b56b3 0%, #123d78 100%); }

.finance-dashboard-card.saldo-anterior span,
.finance-dashboard-card.saldo-anterior strong {
  color: #020617;
}

.finance-dashboard {
  display: grid;
  gap: 1rem;
}

.finance-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.finance-dashboard-card {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #050a14 0%, #09234b 100%);
}

.finance-dashboard-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -32px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.finance-dashboard-card span {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-dashboard-card strong {
  display: block;
  margin-top: 0.45rem;
  color: #fff;
  font-size: clamp(1.15rem, 1.6vw, 1.7rem);
}

.finance-dashboard-card small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0.3rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
}

.finance-dashboard-card.success { background: linear-gradient(135deg, #0d7a3f 0%, #19a05a 100%); }
.finance-dashboard-card.danger { background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%); }
.finance-dashboard-card.warn { background: linear-gradient(135deg, #6b4c00 0%, #d19700 100%); }
.finance-dashboard-card.info { background: linear-gradient(135deg, #0b56b3 0%, #123d78 100%); }

.finance-dashboard-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
  gap: 1rem;
  align-items: stretch;
}

.cartao-config-panels {
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
}

.cartao-dashboard-panels {
  grid-template-columns: minmax(360px, 1.25fr) minmax(300px, 0.75fr);
}

.cartao-dashboard-list {
  display: grid;
  gap: 0.65rem;
}

.cartao-dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--insight-border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(11, 86, 179, 0.08), rgba(248, 250, 252, 0.95));
}

.cartao-dashboard-row strong {
  color: var(--insight-text);
  font-size: 0.95rem;
}

.cartao-dashboard-row small {
  display: block;
  margin-top: 0.2rem;
  color: var(--insight-text-soft);
  font-weight: 700;
}

.cartao-dashboard-value {
  min-width: 118px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #06111f;
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.cartao-dashboard-empty {
  padding: 0.85rem;
  border: 1px dashed var(--insight-border);
  border-radius: 12px;
  color: var(--insight-text-soft);
  font-weight: 800;
}

.cartao-sales-report {
  display: grid;
  gap: 0.9rem;
}

.cartao-report-totals {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.cartao-report-totals .finance-dashboard-card {
  min-height: 96px;
  padding: 0.9rem;
}

.cartao-sales-report-table tbody tr {
  transition: background 0.18s ease, transform 0.18s ease;
}

.cartao-sales-report-table tbody tr:hover {
  background: rgba(11, 86, 179, 0.05);
}

.cartao-sales-report-table td strong {
  color: var(--insight-blue-900);
}

.cartao-sales-report-table tfoot th {
  background: #06111f;
  color: #fff;
  font-size: 0.9rem;
}

.cartao-sales-report-table tfoot th:first-child {
  border-radius: 0 0 0 12px;
}

.cartao-sales-report-table tfoot th:last-child {
  border-radius: 0 0 12px 0;
}



.financeiro-page .table-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.finance-table-scrollbar {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 14px;
  margin: 0.15rem 0 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.95), rgba(245, 249, 255, 0.65));
  border-radius: 999px;
}

.finance-table-scrollbar div {
  height: 1px;
}

.cartao-recebiveis-table .cartao-recebivel-actions {
  display: grid;
  grid-template-columns: minmax(96px, 1fr);
  gap: 0.35rem;
}

.cartao-recebiveis-table .cartao-recebivel-actions .inline-form {
  display: block;
  margin: 0;
}

.cartao-recebiveis-table .cartao-recebivel-actions .button {
  width: 100%;
}

@media (max-width: 760px) {
  .finance-table-scrollbar {
    display: none;
  }
}

.cartao-recebiveis-table {
  overflow-x: auto;
}

.cartao-recebiveis-table .pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.2rem 0 0.45rem;
  font-size: 0.86rem;
}

.cartao-recebiveis-table .pagination .button {
  min-height: 30px;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
}

.cartao-recebiveis-table table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  font-size: 0.78rem;
}

.cartao-recebiveis-table th,
.cartao-recebiveis-table td {
  padding: 0.48rem 0.42rem;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
}

.cartao-recebiveis-table th {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.cartao-recebiveis-table td small {
  font-size: 0.7rem;
  line-height: 1.35;
}

.cartao-recebiveis-table td:nth-child(1) { width: 8%; }
.cartao-recebiveis-table td:nth-child(2) { width: 10%; }
.cartao-recebiveis-table td:nth-child(3) { width: 7.5%; }
.cartao-recebiveis-table td:nth-child(4) { width: 10%; }
.cartao-recebiveis-table td:nth-child(5) { width: 4.5%; }
.cartao-recebiveis-table td:nth-child(6) { width: 7%; }
.cartao-recebiveis-table td:nth-child(7) { width: 7%; }
.cartao-recebiveis-table td:nth-child(8) { width: 7.5%; }
.cartao-recebiveis-table td:nth-child(9) { width: 8%; }
.cartao-recebiveis-table td:nth-child(10) { width: 8%; }
.cartao-recebiveis-table td:nth-child(11) { width: 22.5%; }

.cartao-recebiveis-table .badge {
  padding: 0.32rem 0.55rem;
  font-size: 0.7rem;
  white-space: nowrap;
}

.cartao-recebiveis-table .inline-form {
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.cartao-recebiveis-table .inline-form:last-child {
  margin-bottom: 0;
}

.cartao-recebiveis-table .inline-form input,
.cartao-recebiveis-table .inline-form select {
  min-height: 30px;
  padding: 0.34rem 0.45rem;
  font-size: 0.78rem;
}

.cartao-recebiveis-table .inline-form .button {
  min-height: 30px;
  padding: 0.34rem 0.5rem;
  font-size: 0.74rem;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .cartao-recebiveis-table table {
    font-size: 0.72rem;
  }

  .cartao-recebiveis-table th,
  .cartao-recebiveis-table td {
    padding: 0.42rem 0.34rem;
  }
}

.finance-inner-tabs {
  margin-top: -0.25rem;
  margin-bottom: 0.25rem;
}

.cartao-taxa-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: end;
}

.cartao-taxa-form > label {
  min-width: 0;
}

.cartao-taxa-form .cartao-bandeiras-box,
.cartao-taxa-form .cartao-prazo-presets,
.cartao-taxa-form .form-actions {
  grid-column: 1 / -1;
}

.cartao-autorizadora-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0.85rem;
}

.cartao-conta-filter {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(320px, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.cartao-conta-filter label {
  margin-bottom: 0;
}

.cartao-conta-filter .search-inline {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
}

.cartao-conta-filter .search-inline .button {
  min-height: 42px;
}

.cartao-autorizadora-card {
  grid-template-columns: 1fr;
  align-items: stretch;
  min-height: 176px;
  padding: 1rem;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.cartao-autorizadora-card > div {
  display: grid;
  gap: 0.35rem;
}

.cartao-autorizadora-card strong {
  color: var(--insight-blue-900);
  font-size: 1.18rem;
}

.cartao-autorizadora-card select,
.cartao-autorizadora-card button {
  width: 100%;
}

.cartao-loja-pill {
  display: inline-block;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(18, 84, 170, 0.18);
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--insight-blue-900);
  font-weight: 800;
}

.cartao-prazo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.cartao-prazo-presets strong {
  color: var(--insight-blue-900);
  font-size: 0.86rem;
}

.cartao-prazo-presets span {
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(18, 84, 170, 0.18);
  border-radius: 999px;
  background: #eef6ff;
  color: var(--insight-blue-900);
  font-size: 0.82rem;
  font-weight: 850;
}

.finance-chart-card,
.finance-balance-card {
  display: grid;
  gap: 0.8rem;
}

.finance-card-section {
  display: grid;
  gap: 0.75rem;
}

.finance-list-stack {
  display: grid;
  gap: 0.7rem;
}

.finance-row-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
  gap: 0.7rem;
  align-items: end;
  padding: 0.85rem;
  border: 1px solid var(--insight-border);
  border-radius: 8px;
  background: var(--insight-bg-soft);
}

.finance-row-form.cartao-autorizadora-card {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.finance-row-form strong,
.finance-row-form small {
  display: block;
}

.finance-row-form small {
  color: var(--insight-text-soft);
  margin-top: 0.2rem;
}

.finance-section-head.compact {
  margin-bottom: 0.6rem;
}

.finance-section-head.compact p {
  margin: 0.2rem 0 0;
  color: var(--insight-text-soft);
  font-size: 0.84rem;
}

.finance-section-head.compact h4 {
  margin: 0;
}

.cartao-bandeiras-box {
  padding: 0.85rem;
  border: 1px solid var(--insight-border);
  border-radius: 8px;
  background: var(--insight-bg-soft);
}

.cartao-bandeiras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.65rem;
  max-height: 390px;
  overflow: auto;
  padding-right: 0.25rem;
}

.cartao-bandeira-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  min-height: 58px;
  padding: 0.65rem;
  border: 1px solid var(--insight-border-strong);
  border-radius: 8px;
  background: #fff;
  margin: 0;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cartao-bandeira-card:hover {
  border-color: var(--insight-blue-600);
  box-shadow: 0 10px 22px rgba(18, 84, 170, 0.12);
  transform: translateY(-1px);
}

.cartao-bandeira-card:has(input:checked) {
  border-color: var(--insight-blue-600);
  background: #eaf2ff;
  box-shadow: inset 0 0 0 1px rgba(18, 84, 170, 0.16);
}

.cartao-bandeira-card input {
  width: 18px;
  height: 18px;
}

.cartao-bandeira-card span,
.cartao-bandeira-card small {
  grid-column: 2;
}

.cartao-bandeira-card span {
  font-weight: 900;
}

.cartao-bandeira-card small {
  color: var(--insight-text-soft);
  margin-top: -0.25rem;
}

.cartao-empty-bandeiras {
  margin: 0.75rem 0 0;
  color: var(--insight-text-soft);
  font-weight: 800;
}

@media (max-width: 980px) {
  .cartao-taxa-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .cartao-taxa-form,
  .cartao-autorizadora-grid {
    grid-template-columns: 1fr;
  }
}

.finance-chart-card h3,
.finance-balance-card h3 {
  margin: 0;
}

.finance-bar-row {
  display: grid;
  gap: 0.35rem;
}

.finance-bar-row > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--insight-text);
}

.finance-bar-row > div span {
  color: var(--insight-text-soft);
  font-weight: 800;
}

.finance-bar-row i {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf8;
}

.finance-bar-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.finance-bar-row .bar-success { background: linear-gradient(90deg, #16a34a, #22c55e); }
.finance-bar-row .bar-danger { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.finance-bar-row .bar-warn { background: linear-gradient(90deg, #b7791f, #facc15); }

.finance-balance-card {
  align-content: start;
}

.finance-balance-card p {
  margin: 0;
  color: var(--insight-text-soft);
}

.finance-balance-card div {
  padding: 0.85rem;
  border-radius: 8px;
  background: #f3f7ff;
}

.finance-balance-card div span {
  display: block;
  color: var(--insight-text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-balance-card div strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--insight-blue-800);
  font-size: 1.25rem;
}

.financeiro-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  align-items: start;
}

.financeiro-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.financeiro-page .inline-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(140px, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.financeiro-page .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0.25rem 0.58rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

.financeiro-page .badge.success {
  background: #dcfce7;
  color: #166534;
}

.financeiro-page .badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.financeiro-page .badge.warn {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 980px) {
  .financeiro-filters,
  .financeiro-kpis,
  .finance-dashboard-panels,
  .financeiro-grid,
  .financeiro-config {
    grid-template-columns: 1fr;
  }

  .financeiro-page .inline-form {
    grid-template-columns: 1fr;
  }
}

.financeiro-page .bank-card > strong {
  color: #fff;
}

.financeiro-page .finance-kpi strong,
.financeiro-page .finance-kpi span {
  color: #fff;
}

.financeiro-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.financeiro-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--insight-border);
  border-radius: 8px;
  background: #fff;
  color: var(--insight-text);
  font-weight: 800;
}

.financeiro-tabs a.is-active {
  color: #fff;
  border-color: var(--insight-blue-700);
  background: linear-gradient(135deg, #050a14 0%, #09234b 55%, var(--insight-blue-800) 100%);
}

.finance-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0.25rem 0.85rem;
  margin-bottom: 0.35rem;
}

.finance-section-head h3 {
  margin: 0;
}

.financeiro-page .table-wrap {
  padding: 1rem;
}

.financeiro-page .table-wrap table {
  margin-top: 0.35rem;
}

.finance-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 0.7rem 0;
  color: var(--insight-text-soft);
  font-weight: 700;
}

.finance-pager strong {
  color: var(--insight-text);
}

.finance-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.bank-card {
  display: grid;
  gap: 0.85rem;
  border-color: #b8d2f7;
}

.bank-card > div:first-child span {
  color: var(--insight-text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bank-card h3 {
  margin: 0.18rem 0;
}

.bank-card > strong {
  display: block;
  padding: 0.85rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #050a14 0%, #123d78 100%);
  color: #fff;
  font-size: 1.45rem;
}

.bank-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.bank-card-stats span {
  padding: 0.55rem;
  border-radius: 8px;
  background: var(--insight-bg-soft);
  color: var(--insight-text-soft);
  font-size: 0.78rem;
}

.bank-card-stats b {
  display: block;
  margin-top: 0.2rem;
  color: var(--insight-text);
}

.add-bank-card {
  border-style: dashed;
}

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

.finance-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 10, 23, 0.62);
}

.finance-modal-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: min(86vh, 840px);
  overflow: auto;
  padding: 1rem;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(3, 10, 23, 0.32);
}

.finance-modal-panel.compact {
  width: min(680px, 100%);
}

.finance-modal-close {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: var(--insight-dark);
}

.finance-person-search {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr) 120px;
  gap: 0.7rem;
  align-items: end;
  margin-bottom: 0.8rem;
}

.finance-person-search label,
.finance-person-search button {
  margin-bottom: 0;
}

.finance-person-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.finance-person-results button {
  display: grid;
  justify-items: start;
  min-height: 58px;
  padding: 0.65rem;
  border: 1px solid var(--insight-border);
  background: var(--insight-bg-soft);
  color: var(--insight-text);
}

.finance-person-results button small {
  color: var(--insight-text-soft);
}

@media (max-width: 760px) {
  .finance-section-head,
  .finance-person-search,
  .finance-row-form,
  .cartao-conta-filter,
  .cartao-conta-filter .search-inline {
    grid-template-columns: 1fr;
    display: grid;
  }

  .bank-card-stats {
    grid-template-columns: 1fr;
  }
}

.secret-input-row {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.secret-input-row .secret-toggle {
  min-width: 78px;
  padding-inline: 12px;
  white-space: nowrap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--insight-bg);
  color: var(--insight-text);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.auth-page,
.dashboard-shell { min-height: 100vh; }

.auth-page {
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: linear-gradient(130deg, #050a14, #101828 45%, var(--insight-blue-800));
}

.login-card {
  width: min(420px, 100%);
  background: var(--insight-surface);
  border-radius: 14px;
  padding: 1.6rem;
  border: 1px solid var(--insight-border);
  box-shadow: 0 18px 40px rgba(6, 14, 30, 0.4);
}

.login-logo {
  display: block;
  width: min(300px, 76%);
  max-height: 120px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 0.85rem;
}

.login-card p {
  margin: 0 0 1rem;
  color: var(--insight-text-soft);
  text-align: center;
}

.card,
.section-page,
.summary-card,
.table-wrap {
  background: var(--insight-surface);
  border-radius: 14px;
  border: 1px solid var(--insight-border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.card { padding: 1rem; }

label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--insight-text);
}

input, select {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 0.3rem;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--insight-border-strong);
  border-radius: 10px;
  background: var(--insight-bg-soft);
  color: var(--insight-text);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--insight-blue-600);
  box-shadow: 0 0 0 3px rgba(29, 103, 194, 0.15);
}

input[readonly] {
  color: var(--insight-text-soft);
  background: #eef4fb;
}

button,
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  background: var(--insight-blue-700);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover,
.button:hover { filter: brightness(1.06); }

.button.dark,
.topbar-actions button { background: var(--insight-dark); }

.button.brasilapi-button {
  background: linear-gradient(135deg, #050a14 0%, var(--insight-dark) 58%, var(--insight-blue-900) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 18px rgba(5, 10, 20, 0.22);
}

.button.brasilapi-button:hover {
  filter: none;
  background: linear-gradient(135deg, #000000 0%, #071325 52%, var(--insight-blue-800) 100%);
}

.alert,
.erro {
  background: var(--insight-danger-bg);
  color: var(--insight-danger-text);
  border: 1px solid var(--insight-danger-border);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 1.1rem;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--insight-bg);
}

.sidebar {
  background: linear-gradient(180deg, #080d18 0%, #0e2446 44%, #0a2f63 100%);
  color: #dbeafe;
  padding: 1.4rem 1rem 1rem;
  border-right: 1px solid rgba(172, 196, 228, 0.22);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  min-height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.55rem;
}

.sidebar-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 10px;
  padding: 4px;
}

.sidebar-brand strong {
  display: block;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.sidebar-brand p {
  margin: 0;
  font-size: 0.82rem;
  color: #bfdbfe;
}

.sidebar-menu {
  display: grid;
  gap: 0.9rem;
}

.menu-group {
  display: grid;
  gap: 0.35rem;
}

.menu-group-title {
  margin: 0;
  padding: 0 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: rgba(219, 234, 254, 0.72);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  border-radius: 10px;
  text-align: left;
  background: transparent;
  color: #eff6ff;
  padding: 0.65rem 0.7rem;
  border: 1px solid transparent;
  font-weight: 600;
  position: relative;
}

.menu-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.58);
  flex: 0 0 auto;
}

.menu-item:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(147, 197, 253, 0.2);
}

.menu-item.is-active {
  background: linear-gradient(90deg, rgba(29, 103, 194, 0.66), rgba(18, 84, 170, 0.42));
  border-color: rgba(191, 219, 254, 0.48);
  color: #ffffff;
}

.menu-item.is-active::before {
  background: #ffffff;
}

.dashboard-content {
  padding: 1rem;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--insight-surface);
  border: 1px solid var(--insight-border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--insight-text);
}

.topbar p {
  margin: 0.1rem 0 0;
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

.topbar-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--insight-surface);
  border: 1px solid var(--insight-border);
  object-fit: contain;
  padding: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-actions span {
  font-size: 0.85rem;
  color: #334155;
}

.topbar-actions .button { margin-top: 0; }

.menu-toggle {
  display: none;
  margin: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--insight-dark);
  padding: 8px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: #ffffff;
  border-radius: 4px;
}

.sidebar-overlay { display: none; }

.section-page {
  padding: 1rem;
}

.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.section-header p {
  margin: 0.25rem 0 0;
  color: var(--insight-text-soft);
}

.summary-grid,
.content-grid,
.shortcut-grid {
  display: grid;
  gap: 1rem;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

.summary-card {
  padding: 1rem;
}

.summary-card h3 {
  font-size: 0.95rem;
  margin: 0;
  color: #334155;
}

.summary-card strong {
  display: block;
  margin-top: 0.4rem;
  font-size: 1.5rem;
  color: var(--insight-text);
}

.shortcut-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 1rem;
}

.shortcut-card {
  background: var(--insight-bg-soft);
  border: 1px solid var(--insight-border);
  border-radius: 12px;
  padding: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.shortcut-card:hover {
  transform: translateY(-1px);
  border-color: #b7ccec;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.09);
}

.shortcut-card h3 {
  margin: 0;
  font-size: 0.96rem;
}

.shortcut-card p {
  margin: 0.35rem 0 0.8rem;
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

.shortcut-card a {
  display: inline-block;
  color: var(--insight-blue-700);
  font-weight: 700;
}

.module-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

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

.module-option-card {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-height: 116px;
  padding: 0.9rem 0.75rem;
  background: var(--insight-bg-soft);
  border: 1px solid var(--insight-border);
  border-radius: 12px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.module-option-card:hover {
  transform: translateY(-1px);
  border-color: #b7ccec;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.09);
}

.module-option-card.is-active {
  border-color: rgba(18, 84, 170, 0.52);
  background: #edf4ff;
}

.module-option-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--insight-dark);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.module-option-symbol {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-block;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--insight-blue-700), var(--insight-dark));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.module-option-symbol::before,
.module-option-symbol::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.option-icon-product-add::before {
  left: 11px;
  top: 9px;
  width: 18px;
  height: 22px;
  border: 2px solid #ffffff;
  border-radius: 4px;
}

.option-icon-product-add::after {
  right: 7px;
  bottom: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    linear-gradient(#ffffff, #ffffff) center / 10px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) center / 2px 10px no-repeat,
    var(--insight-blue-600);
}

.option-icon-departments::before {
  left: 10px;
  top: 9px;
  width: 22px;
  height: 24px;
  border-left: 4px solid #ffffff;
  border-right: 4px solid #ffffff;
}

.option-icon-departments::after {
  left: 8px;
  top: 15px;
  width: 26px;
  height: 3px;
  background: #ffffff;
  box-shadow: 0 8px 0 #ffffff;
}

.option-icon-sections::before {
  left: 11px;
  top: 10px;
  width: 20px;
  height: 5px;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: 0 9px 0 #ffffff, 0 18px 0 #ffffff;
}

.option-icon-sections::after {
  right: 9px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--insight-blue-600);
  box-shadow: 0 9px 0 var(--insight-blue-600), 0 18px 0 var(--insight-blue-600);
}

.option-icon-associated::before {
  left: 10px;
  top: 12px;
  width: 22px;
  height: 18px;
  border-top: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: skewY(-22deg);
}

.option-icon-associated::after {
  left: 8px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 18px 8px 0 #ffffff, 0 20px 0 #ffffff, 18px 28px 0 #ffffff;
}

.option-icon-tags::before {
  left: 11px;
  top: 12px;
  width: 21px;
  height: 16px;
  border-radius: 4px 4px 4px 8px;
  background: #ffffff;
  transform: rotate(-28deg);
}

.option-icon-tags::after {
  right: 13px;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--insight-blue-700);
}

.option-icon-basket-add::before {
  left: 9px;
  top: 15px;
  width: 24px;
  height: 17px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-radius: 3px 3px 7px 7px;
  background:
    linear-gradient(#ffffff, #ffffff) 6px 4px / 2px 9px no-repeat,
    linear-gradient(#ffffff, #ffffff) 13px 4px / 2px 9px no-repeat;
}

.option-icon-basket-add::after {
  right: 6px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    linear-gradient(#ffffff, #ffffff) center / 10px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) center / 2px 10px no-repeat,
    var(--insight-blue-600);
}

.option-icon-store::before {
  left: 9px;
  top: 16px;
  width: 24px;
  height: 18px;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: inset 6px 0 0 rgba(18, 84, 170, 0.35), inset -6px 0 0 rgba(18, 84, 170, 0.35);
}

.option-icon-store::after {
  left: 7px;
  top: 9px;
  width: 28px;
  height: 9px;
  border-radius: 6px 6px 2px 2px;
  background: #ffffff;
}

.option-icon-settings::before {
  left: 9px;
  top: 9px;
  width: 24px;
  height: 24px;
  border: 6px solid #ffffff;
  border-radius: 50%;
  box-shadow:
    0 -11px 0 -7px #ffffff,
    0 11px 0 -7px #ffffff,
    11px 0 0 -7px #ffffff,
    -11px 0 0 -7px #ffffff,
    8px 8px 0 -7px #ffffff,
    -8px 8px 0 -7px #ffffff,
    8px -8px 0 -7px #ffffff,
    -8px -8px 0 -7px #ffffff;
}

.option-icon-settings::after {
  left: 18px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.option-icon-tax-adjust::before {
  left: 10px;
  top: 8px;
  width: 22px;
  height: 26px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  background:
    linear-gradient(#ffffff, #ffffff) 5px 8px / 12px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) 5px 14px / 12px 2px no-repeat;
}

.option-icon-tax-adjust::after {
  right: 6px;
  bottom: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    linear-gradient(#ffffff, #ffffff) center / 10px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) center / 2px 10px no-repeat,
    var(--insight-blue-600);
  transform: rotate(45deg);
}

.option-icon-imendes::before {
  left: 8px;
  top: 10px;
  width: 26px;
  height: 22px;
  border: 2px solid #ffffff;
  border-radius: 6px;
}

.option-icon-imendes::after {
  left: 13px;
  top: 16px;
  width: 16px;
  height: 10px;
  color: #ffffff;
  content: "im";
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.option-icon-sync-pdv::before {
  left: 8px;
  top: 9px;
  width: 26px;
  height: 24px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  background:
    linear-gradient(#ffffff, #ffffff) center 17px / 12px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) center 21px / 20px 2px no-repeat;
}

.option-icon-sync-pdv::after {
  left: 13px;
  top: 13px;
  width: 16px;
  height: 10px;
  border: 2px solid #ffffff;
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-18deg);
}

.option-icon-scale::before {
  left: 9px;
  top: 9px;
  width: 24px;
  height: 22px;
  border: 2px solid #ffffff;
  border-radius: 7px 7px 4px 4px;
  background:
    radial-gradient(circle at 50% 38%, transparent 0 5px, #ffffff 6px 7px, transparent 8px),
    linear-gradient(#ffffff, #ffffff) center 23px / 16px 2px no-repeat;
}

.option-icon-scale::after {
  left: 20px;
  top: 17px;
  width: 10px;
  height: 2px;
  background: #ffffff;
  transform: rotate(-38deg);
  transform-origin: left center;
}

.option-icon-terminal::before {
  left: 14px;
  top: 7px;
  width: 14px;
  height: 28px;
  border: 2px solid #ffffff;
  border-radius: 5px;
  background:
    linear-gradient(#ffffff, #ffffff) center 6px / 7px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) center 20px / 8px 2px no-repeat;
}

.option-icon-terminal::after {
  left: 5px;
  top: 14px;
  width: 32px;
  height: 16px;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #ffffff;
  border-radius: 50%;
}

.option-icon-client-add::before {
  left: 12px;
  top: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 17px 0 4px #ffffff;
}

.option-icon-client-add::after {
  right: 7px;
  bottom: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 9px 2px no-repeat,
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 2px 9px no-repeat,
    #ffffff;
}

.option-icon-convenio::before {
  left: 9px;
  top: 10px;
  width: 24px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 5px;
}

.option-icon-convenio::after {
  left: 13px;
  top: 17px;
  width: 16px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 7px 0 #ffffff;
}

.option-icon-reports::before {
  left: 11px;
  top: 8px;
  width: 20px;
  height: 25px;
  border: 2px solid #ffffff;
  border-radius: 4px;
}

.option-icon-reports::after {
  left: 16px;
  bottom: 10px;
  width: 3px;
  height: 8px;
  background: #ffffff;
  box-shadow: 6px -5px 0 #ffffff, 12px -1px 0 #ffffff;
}

.option-icon-user-add::before {
  left: 12px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 16px 0 5px #ffffff;
}

.option-icon-user-add::after {
  right: 7px;
  bottom: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 9px 2px no-repeat,
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 2px 9px no-repeat,
    #ffffff;
}

.option-icon-users::before {
  left: 9px;
  top: 9px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 14px 0 0 #ffffff, 7px 17px 0 6px #ffffff;
}

.option-icon-users::after {
  left: 6px;
  bottom: 9px;
  width: 13px;
  height: 8px;
  border-radius: 8px 8px 3px 3px;
  background: #ffffff;
  box-shadow: 17px 0 0 #ffffff;
}

.option-icon-supplier-add::before,
.option-icon-suppliers::before {
  left: 9px;
  top: 12px;
  width: 24px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 5px;
}

.option-icon-supplier-add::after {
  right: 7px;
  bottom: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 9px 2px no-repeat,
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 2px 9px no-repeat,
    #ffffff;
}

.option-icon-suppliers::after {
  left: 13px;
  top: 18px;
  width: 16px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 6px 0 #ffffff;
}

.option-icon-carrier-add::before,
.option-icon-carrier::before {
  left: 7px;
  top: 17px;
  width: 25px;
  height: 12px;
  border-radius: 3px;
  background: #ffffff;
}

.option-icon-carrier-add::after {
  right: 7px;
  bottom: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 9px 2px no-repeat,
    linear-gradient(var(--insight-blue-700), var(--insight-blue-700)) center / 2px 9px no-repeat,
    #ffffff;
}

.option-icon-carrier::after {
  left: 11px;
  bottom: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--insight-blue-700);
  box-shadow: 17px 0 0 var(--insight-blue-700), 5px -13px 0 4px #ffffff;
}

.module-option-card strong {
  font-size: 1rem;
  color: var(--insight-text);
}

.imendes-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.imendes-option-grid > form {
  display: contents;
}

.imendes-option-grid .module-option-card {
  width: 100%;
  color: var(--insight-text);
  cursor: pointer;
}

.imendes-option-grid .module-option-card > span:not(.module-option-symbol) {
  color: var(--insight-text-soft);
  font-size: 0.86rem;
  line-height: 1.35;
}
.xml-store-link,
.xml-link-panel {
  border-color: #7aa8e8;
  background: #f5f9ff;
}

.xml-totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.xml-totals-grid .summary-card {
  min-height: 88px;
}

.xml-totals-grid .summary-card strong {
  font-size: 1.15rem;
}

.xml-payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.xml-payment-grid > fieldset {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.xml-payment-grid .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.xml-payment-grid .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.xml-payment-grid .form-grid > * {
  min-width: 0;
}

.xml-final-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.xml-link-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(140px, 0.7fr) repeat(2, auto) auto;
  align-items: end;
  gap: 0.65rem;
}

.xml-link-modal .modal-card {
  width: min(1100px, 100%);
}

.xml-product-results {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.xml-product-result {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(560px, 2fr);
  align-items: center;
  gap: 1rem;
}

.xml-product-result > div {
  display: grid;
  gap: 0.2rem;
}

.xml-linked-edit-form {
  margin-top: 1rem;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--insight-text-soft);
  font-size: 0.85rem;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--insight-border);
}

.row-warning {
  background: #fff8e8;
}

.text-danger {
  color: #b42318;
}

.dashboard-block { margin-bottom: 0.75rem; }

.dashboard-block-header h3 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-block-header p {
  margin: 0.25rem 0 0;
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

.dashboard-chart-card { margin-top: 1rem; }

.dashboard-chart-header h3 { margin: 0; }

.dashboard-chart-header p {
  margin: 0.3rem 0 1rem;
  color: var(--insight-text-soft);
}

.dashboard-chart {
  display: grid;
  gap: 0.85rem;
}

.dashboard-bar-row {
  display: grid;
  gap: 0.4rem;
}

.dashboard-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  color: #1e293b;
}

.dashboard-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #d6e3f8;
  overflow: hidden;
}

.dashboard-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--insight-blue-700), var(--insight-blue-600));
}

.dashboard-sales-summary .summary-card {
  min-height: 112px;
}

.dashboard-kpi-card {
  position: relative;
  overflow: hidden;
  border-color: #c5d7f0;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
}

.dashboard-kpi-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(18, 84, 170, 0.12);
}

.dashboard-kpi-primary {
  background: linear-gradient(135deg, #06101f 0%, #123f78 100%);
  border-color: #123f78;
  color: #fff;
}

.dashboard-kpi-primary h3,
.dashboard-kpi-primary strong,
.dashboard-kpi-primary span {
  color: #fff;
}

.dashboard-kpi-primary span {
  opacity: 0.95;
  font-weight: 700;
}

.dashboard-kpi-card span {
  display: block;
  margin-top: 0.35rem;
  color: var(--insight-text-soft);
  font-size: 0.86rem;
}

.dashboard-kpi-card.dashboard-kpi-primary span {
  color: #fff;
  opacity: 0.95;
  font-weight: 700;
}

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-panel-large {
  grid-row: span 2;
}

.dashboard-ranking-chart,
.dashboard-payment-list,
.dashboard-cancel-list {
  display: grid;
  gap: 0.75rem;
}

.dashboard-rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--insight-border);
  border-radius: 8px;
  background: #f8fbff;
}

.dashboard-rank-info {
  min-width: 0;
}

.dashboard-rank-info strong,
.dashboard-cancel-row strong {
  display: block;
  color: var(--insight-dark);
}

.dashboard-rank-info span,
.dashboard-cancel-row span {
  display: block;
  margin-top: 0.2rem;
  color: var(--insight-text-soft);
  font-size: 0.82rem;
}

.dashboard-rank-value {
  color: var(--insight-blue-800);
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-rank-track,
.dashboard-mini-track {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  background: #dce8f8;
  overflow: hidden;
}

.dashboard-rank-track span,
.dashboard-mini-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a2a55, #1d67c2);
}

.dashboard-donut-wrap {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 1rem;
  align-items: center;
}

.dashboard-donut {
  width: 138px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--insight-surface) 0 47%, transparent 48%),
    conic-gradient(#0a2a55 0 var(--p1), #1d67c2 var(--p1) calc(var(--p1) + var(--p2)), #8fb5e8 0 100%);
  border: 1px solid #c5d7f0;
  box-shadow: inset 0 0 0 12px rgba(255,255,255,0.3);
}

.dashboard-payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
}

.dashboard-payment-row span {
  font-weight: 700;
  color: var(--insight-dark);
}

.dashboard-payment-row strong {
  color: var(--insight-blue-800);
  white-space: nowrap;
}

.dashboard-mini-track {
  height: 8px;
}

.dashboard-mini-track.is-danger span {
  background: linear-gradient(90deg, #6b1222, #d94b61);
}

.dashboard-cancel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem 0.75rem;
  padding: 0.75rem;
  border: 1px solid #f1c7cf;
  border-radius: 8px;
  background: #fff7f8;
}

.dashboard-empty-good {
  padding: 1rem;
  border: 1px solid #bde7cf;
  border-radius: 8px;
  background: #f1fff6;
  color: #176338;
  font-weight: 800;
}

.toolbar {
  display: grid;
  grid-template-columns: 190px minmax(180px, 1fr) 120px;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.toolbar label {
  margin-bottom: 0;
}

.toolbar button {
  width: 100%;
  min-height: 42px;
  margin-top: 0;
  margin-bottom: 0;
}

.promotions-search-toolbar {
  grid-template-columns: minmax(260px, 1fr) 150px;
}

.table-wrap {
  overflow: auto;
}

.fechamento-card-grid {
  display: grid;
  gap: 1rem;
}

.fechamento-card {
  border: 1px solid var(--insight-border);
  border-left: 5px solid #64748b;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.fechamento-card.is-closed { border-left-color: #0f7a45; }
.fechamento-card.is-over { border-left-color: #1d67c2; }
.fechamento-card.is-missing { border-left-color: #c2410c; }

.fechamento-card-header,
.fechamento-card-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: center;
  padding: 1rem;
}

.fechamento-card-header {
  background: #eef5ff;
  border-bottom: 1px solid var(--insight-border);
}

.fechamento-card-header strong,
.fechamento-card-footer strong {
  display: block;
  color: var(--insight-text);
}

.fechamento-card-header span,
.fechamento-card-footer span {
  color: var(--insight-text-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.fechamento-status {
  justify-self: end;
  min-width: 150px;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  text-align: right;
  background: #fff;
  border: 1px solid var(--insight-border);
}

.fechamento-card.is-closed .fechamento-status {
  background: #ecfdf3;
  border-color: #86efac;
}

.fechamento-card.is-over .fechamento-status {
  background: #eff6ff;
  border-color: #93c5fd;
}

.fechamento-card.is-missing .fechamento-status {
  background: #fff7ed;
  border-color: #fdba74;
}

.fechamento-card table {
  min-width: 0;
}

.fechamento-card-footer {
  border-top: 1px solid var(--insight-border);
  background: #f8fbff;
}

.transform-report-wrap {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.transform-report-card table {
  min-width: 640px;
}

.transform-report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.transform-report-items {
  min-width: 0;
  overflow: auto;
}

.transform-report-items h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--insight-text);
}

.transform-report-note {
  margin: 1rem 1rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--insight-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--insight-text-soft);
  font-weight: 700;
}

.transform-report-card .fechamento-card-footer {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th, td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--insight-border);
  text-align: left;
  font-size: 0.9rem;
}

th {
  color: #334155;
  background: var(--insight-bg-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover { background: var(--insight-bg-soft); }

.button.small {
  min-height: 32px;
  margin-top: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

.button.ghost {
  background: var(--insight-bg-soft);
  color: var(--insight-text);
  border: 1px solid var(--insight-border-strong);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.button.danger {
  background: var(--insight-danger-bg);
  color: var(--insight-danger-text);
  border: 1px solid var(--insight-danger-border);
}

.page-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.page-actions {
  margin-bottom: 1rem;
}

.row-actions {
  min-width: 170px;
}

.table-input {
  width: 92px;
  min-height: 32px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--insight-border-strong);
  border-radius: 8px;
  font: inherit;
}

.form-note {
  margin: 0.8rem 0 0;
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

.convenio-summary {
  margin-top: 1rem;
}

.convenio-client-panel {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--insight-border);
  border-radius: 14px;
  background: var(--insight-surface);
  box-shadow: 0 12px 28px rgba(8, 18, 35, 0.06);
}

.convenio-client-panel h3 {
  margin: 0.2rem 0;
  color: var(--insight-blue-900);
}

.convenio-client-panel p {
  margin: 0;
  color: var(--insight-text-soft);
}

.convenio-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
}

.cesta-open-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(18, 84, 170, 0.35);
  border-left: 5px solid var(--insight-blue-700);
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fbff 0%, #edf4ff 100%);
  box-shadow: 0 14px 30px rgba(8, 18, 35, 0.08);
}

.cesta-open-main h3 {
  margin: 0.2rem 0;
  color: var(--insight-blue-900);
  font-size: 1.25rem;
}

.cesta-open-main p {
  margin: 0;
  color: var(--insight-text-soft);
}

.cesta-open-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 0.7rem;
}

.cesta-open-metrics article {
  padding: 0.75rem;
  border: 1px solid var(--insight-border);
  border-radius: 12px;
  background: #ffffff;
}

.cesta-open-metrics span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--insight-text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.cesta-open-metrics strong {
  color: var(--insight-dark);
  font-size: 1.15rem;
}

.cesta-open-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.cesta-workspace {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--insight-border);
  border-radius: 14px;
  background: var(--insight-surface);
}

.convenio-actions-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
  margin-bottom: 1rem;
}

.action-dialog {
  width: min(680px, calc(100vw - 2rem));
  border: 1px solid var(--insight-border);
  border-radius: 14px;
  padding: 1rem;
  background: var(--insight-surface);
  box-shadow: 0 24px 70px rgba(8, 18, 35, 0.25);
}

.action-dialog::backdrop {
  background: rgba(8, 18, 35, 0.42);
}

.dialog-close {
  min-height: 34px;
  margin-top: 0;
  padding: 0.35rem 0.7rem;
  background: var(--insight-bg-soft);
  color: var(--insight-text);
  border: 1px solid var(--insight-border-strong);
}

.report-toolbar {
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 0.8fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) 120px;
}

.report-print-page {
  background: #ffffff;
}

.report-page {
  padding: 1.5rem;
}

.coupon-report-list {
  display: grid;
  gap: 1rem;
}

.coupon-report-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.coupon-report-header {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.1fr minmax(160px, 0.8fr);
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: #f3f7ff;
  border-bottom: 1px solid var(--border-color);
}

.coupon-report-header div {
  min-width: 0;
}

.coupon-report-header span {
  display: block;
  color: var(--muted-color);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.coupon-report-header strong,
.coupon-report-header small {
  display: block;
  overflow-wrap: anywhere;
}

.coupon-report-header strong {
  margin-top: 0.18rem;
  color: var(--ink-color);
  font-size: 0.98rem;
}

.coupon-report-header small {
  margin-top: 0.15rem;
  color: var(--muted-color);
  font-weight: 700;
}

.coupon-report-total {
  text-align: right;
}

.coupon-report-items {
  margin: 0;
  border: 0;
}

.coupon-report-items thead th {
  background: #f8fafc;
}

@media (max-width: 760px) {
  .coupon-report-header {
    grid-template-columns: 1fr;
  }

  .coupon-report-total {
    text-align: left;
  }
}

@media (max-width: 960px) {
  .report-page .report-table,
  .report-page .table-wrap,
  .cartao-sales-report.table-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .report-page .report-table > table,
  .report-page .table-wrap > table,
  .report-page .table-wrap table,
  .coupon-report-items,
  .cartao-sales-report-table {
    display: table !important;
    width: max-content !important;
    min-width: 900px !important;
    max-width: none !important;
    table-layout: auto !important;
  }

  .report-page .report-table th,
  .report-page .report-table td,
  .report-page .table-wrap th,
  .report-page .table-wrap td,
  .coupon-report-items th,
  .coupon-report-items td,
  .cartao-sales-report-table th,
  .cartao-sales-report-table td {
    display: table-cell !important;
    white-space: nowrap;
  }
}
@media print {
  .report-print-page {
    color: #000000;
  }

  .report-page {
    padding: 0;
  }

  .report-page .summary-card,
  .report-page .table-wrap {
    box-shadow: none;
    border: 1px solid #d1d5db;
  }

  .report-page table {
    min-width: 0;
  }

  .coupon-report-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

.product-form {
  display: grid;
  gap: 1rem;
}

.copy-product-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px minmax(220px, 1fr) 130px;
  gap: 0.85rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid var(--insight-border);
  border-radius: 12px;
  background: var(--insight-bg-soft);
}

.copy-product-panel h3,
.copy-product-panel p {
  margin: 0;
}

.copy-product-panel h3 {
  color: var(--insight-blue-900);
  font-size: 1rem;
}

.copy-product-panel p {
  margin-top: 0.25rem;
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

.copy-product-panel label,
.copy-product-panel button {
  margin-bottom: 0;
}

.promotion-product-search {
  grid-template-columns: minmax(180px, 0.7fr) minmax(300px, 1.3fr) minmax(180px, 0.65fr);
}

.promotion-product-search .form-grid-action,
.promotion-product-search .form-grid-action .button {
  width: 100%;
}

.copy-product-results[hidden] { display: none; }

.copy-product-table table {
  min-width: 680px;
}

.copy-product-table .button {
  white-space: nowrap;
}

.form-section {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--insight-border);
  border-radius: 12px;
  background: var(--insight-bg-soft);
}

.form-section legend {
  padding: 0 0.45rem;
  color: var(--insight-blue-900);
  font-weight: 800;
}

.promotion-clubs-panel {
  display: grid;
  gap: 1rem;
}

.promotion-clubs-setting,
.promotion-clubs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.promotion-clubs-setting > div,
.promotion-clubs-toolbar > div,
.promotion-club-info {
  display: grid;
  gap: 0.25rem;
}

.promotion-clubs-setting small,
.promotion-clubs-toolbar small,
.promotion-club-info small {
  color: var(--insight-text-soft);
}

.promotion-clubs-setting select {
  width: 9rem;
  flex: 0 0 9rem;
}

.promotion-clubs-content {
  display: grid;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--insight-border);
}

.promotion-clubs-content[hidden] {
  display: none;
}

.promotion-clubs-check-all {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: auto;
  cursor: pointer;
  font-weight: 700;
}

.promotion-clubs-check-all input,
.promotion-club-card input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
}

.promotion-clubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
}

.promotion-club-card {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-height: 4.6rem;
  padding: 0.85rem;
  border: 1px solid var(--insight-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.promotion-club-card > input {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.promotion-club-check {
  display: none;
}

.promotion-club-info {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.promotion-club-card:hover {
  border-color: var(--insight-blue-600);
}

.promotion-club-card.is-selected {
  border-color: var(--insight-blue-600);
  background: #eaf3ff;
  box-shadow: 0 0 0 1px rgba(20, 92, 176, 0.12);
}

.promotion-club-info strong,
.promotion-club-info small {
  overflow-wrap: anywhere;
}

.promotion-clubs-empty {
  margin: 0;
  padding: 1rem;
  color: var(--insight-text-soft);
}

.client-clubs-panel {
  margin-top: 1rem;
}

.client-clubs-search {
  display: grid;
  gap: 0.4rem;
  max-width: 34rem;
}

.client-clubs-panel .promotion-clubs-grid {
  padding-top: 0.15rem;
}

@media (max-width: 720px) {
  .promotion-clubs-setting,
  .promotion-clubs-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .promotion-clubs-setting select {
    width: 100%;
    flex-basis: auto;
  }

  .promotion-clubs-grid {
    grid-template-columns: 1fr;
  }
}

.form-subsection {
  margin-top: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--insight-border);
}

.form-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-subsection h3 {
  margin: 0;
  color: var(--insight-blue-900);
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.featured-field {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--insight-blue-900);
}

.featured-field input {
  border-color: rgba(18, 84, 170, 0.45);
  background: #eaf2ff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(18, 84, 170, 0.08);
}

.featured-field input:focus {
  border-color: var(--insight-blue-600);
  box-shadow: 0 0 0 3px rgba(29, 103, 194, 0.18);
}

.featured-field-wide {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .featured-field-wide {
    grid-column: auto;
  }
}

.form-grid-action {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.form-grid-action::before {
  content: "";
  display: block;
  min-height: 1.2rem;
}

.form-grid-action .button {
  width: 100%;
  margin-top: 0;
  min-height: 42px;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.form-actions .button,
.form-actions button {
  margin-top: 0;
}

.store-participants-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(18, 84, 170, 0.18);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--insight-blue-900);
  font-weight: 700;
}

.store-participants-toolbar > span {
  color: var(--insight-text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.store-check-all,
.store-participant-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.store-check-all {
  align-items: center;
  cursor: pointer;
}

.store-check-all input,
.store-participant-card input {
  width: 18px;
  height: 18px;
  margin-top: 0.1rem;
  accent-color: var(--insight-blue-700);
}

.store-participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.store-participant-card {
  min-height: 74px;
  padding: 0.85rem;
  border: 1px solid var(--insight-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.store-participant-card strong {
  display: block;
  color: var(--insight-blue-950);
  line-height: 1.35;
}

.store-participant-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--insight-text-soft);
  font-weight: 700;
}

.store-participant-card.is-selected {
  border-color: rgba(29, 103, 194, 0.55);
  background: #eef5ff;
  box-shadow: 0 10px 22px rgba(18, 84, 170, 0.08);
}

.linked-products-grid {
  margin-top: -0.25rem;
}

.linked-products-grid table {
  min-width: 620px;
}

.store-stock-section {
  display: grid;
  gap: 0.85rem;
}

.store-stock-section .form-subsection-header {
  margin-bottom: 0;
}

.store-stock-section .form-subsection-header p {
  margin: 0.2rem 0 0;
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

.store-stock-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.store-stock-total {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(18, 84, 170, 0.22);
  border-radius: 8px;
  background: #eef5ff;
  color: var(--insight-blue-800);
  font-weight: 800;
  white-space: nowrap;
}

.store-stock-table th,
.store-stock-table td {
  vertical-align: middle;
}

.store-stock-table input {
  width: 132px;
  min-width: 112px;
  margin: 0;
}

.alert.success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.pnfe-pending-alert {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--insight-danger-border);
  border-left: 6px solid #dc2626;
  border-radius: 8px;
  background: linear-gradient(90deg, #fef2f2, #fff7f7);
  color: #7f1d1d;
}

.pnfe-pending-alert span {
  font-weight: 900;
}

.pnfe-pending-alert strong {
  min-width: 44px;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  text-align: center;
}

.pnfe-pending-alert small {
  color: #991b1b;
  font-weight: 700;
}

.metric-grid,
.info-grid,
.totals-grid {
  display: grid;
  gap: 0.85rem;
}

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

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

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

.metric-card,
.info-grid > div,
.totals-grid > span {
  border: 1px solid var(--insight-border);
  border-radius: 8px;
  background: var(--insight-bg-soft);
  padding: 0.9rem;
}

.metric-card {
  color: var(--insight-text);
  text-decoration: none;
}

.metric-card:hover,
.metric-card.is-active {
  border-color: var(--insight-blue-600);
  background: #eaf2ff;
}

.metric-card span,
.info-grid span,
.totals-grid span {
  display: block;
  color: var(--insight-text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong,
.info-grid strong,
.totals-grid strong {
  display: block;
  color: var(--insight-text);
  font-size: 1.1rem;
  margin-top: 0.18rem;
}

.info-grid small {
  display: block;
  color: var(--insight-text-soft);
  margin-top: 0.2rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 0.65rem;
  background: #dbeafe;
  color: var(--insight-blue-900);
  font-weight: 900;
  font-size: 0.78rem;
}

.is-selected-row {
  background: #edf5ff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(7, 13, 25, 0.64);
}

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

body.modal-open { overflow: hidden; }

.modal-card {
  width: min(900px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  background: var(--insight-surface);
  border: 1px solid var(--insight-border);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(3, 7, 18, 0.42);
  padding: 1rem;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header h2 {
  color: var(--insight-blue-900);
  font-size: 1.2rem;
}

.modal-header p {
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

.entry-tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0 0.75rem;
  border-bottom: 1px solid var(--insight-border);
}

.entry-tab-button {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--insight-text-soft);
  font-weight: 800;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.entry-tab-button.is-active {
  background: var(--insight-surface);
  border-color: var(--insight-border);
  color: var(--insight-blue-900);
  box-shadow: 0 -8px 22px rgba(17, 85, 177, 0.08);
}

.entry-tab-panel[hidden] {
  display: none;
}

.sync-progress-card {
  border: 1px solid var(--insight-border);
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  border-radius: 8px;
  padding: 18px;
  margin-top: 16px;
  box-shadow: var(--insight-shadow-soft);
}

.sync-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: var(--insight-text);
}

.sync-progress-head strong,
.sync-progress-head span {
  display: block;
}

.sync-progress-head strong {
  color: var(--insight-blue-900);
  font-size: 1rem;
}

.sync-progress-head span {
  color: var(--insight-text-soft);
  font-size: 0.9rem;
}

#sync-percent {
  color: var(--insight-blue-900);
  font-weight: 800;
  font-size: 1.15rem;
}

.sync-progress-track {
  height: 12px;
  background: #dbeafe;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 12px;
}

.sync-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--insight-blue-700), var(--insight-blue-900));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.sync-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  color: var(--insight-text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.config-password-card {
  width: min(420px, 100%);
  border-radius: 10px;
}

.config-password-card label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--insight-text);
}

.config-password-card input {
  letter-spacing: 0;
}

.config-password-error {
  margin: 0.85rem 0 0;
}

.calculadora-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.calculadora-results div {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border: 1px solid var(--insight-border);
  border-radius: 10px;
  background: var(--insight-bg-soft);
}

.calculadora-results span,
.calculadora-results small {
  color: var(--insight-text-soft);
}

.calculadora-results strong {
  color: var(--insight-blue-900);
  font-size: 1.3rem;
}

.calculadora-results em {
  color: var(--insight-text);
  font-style: normal;
  font-weight: 700;
}

.placeholder-card {
  border: 1px dashed var(--insight-border-strong);
  border-radius: 12px;
  background: var(--insight-bg-soft);
  min-height: 220px;
  padding: 1.2rem;
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.placeholder-card h3,
.placeholder-card p { margin: 0; }

.placeholder-card p { color: var(--insight-text-soft); }

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

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

  .dashboard-panel-large {
    grid-row: auto;
  }

  .dashboard-donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    width: min(280px, 82vw);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
    z-index: 30;
    transition: transform 0.2s ease;
  }

  .sidebar-menu {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
  }

  .sidebar.is-open { transform: translateX(0); }

  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }

  body.menu-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    margin: 0;
    border: none;
    background: rgba(7, 13, 25, 0.5);
    z-index: 20;
    border-radius: 0;
    padding: 0;
  }

  .menu-toggle { display: inline-block; }
  .dashboard-content { padding: 0.8rem; }
}

@media (max-width: 640px) {
  .xml-payment-grid {
    grid-template-columns: 1fr;
  }

  .xml-payment-grid .form-grid {
    grid-template-columns: 1fr;
  }

  .xml-product-result,
  .xml-link-form {
    grid-template-columns: 1fr;
  }

  .xml-final-actions {
    position: sticky;
    bottom: 0;
    z-index: 15;
    flex-direction: column;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #d6e1f2;
  }

  .xml-final-actions .button {
    width: 100%;
  }

  .section-page:has(.module-option-primary ~ .module-option-sub) .module-option-primary:has(.module-option-card.is-active) .module-option-card:not(.is-active) {
    display: none;
  }

  .section-page:has(.module-option-primary ~ .module-option-sub) .module-option-primary:has(.module-option-card.is-active) {
    grid-template-columns: 1fr;
  }

  .module-option-sub:has(.module-option-card.is-active) .module-option-card:not(.is-active) {
    display: none;
  }

  .module-option-sub:has(.module-option-card.is-active) {
    grid-template-columns: 1fr;
  }

  .copy-product-panel { grid-template-columns: 1fr; }
  .login-card { padding: 1.25rem; }
  .login-logo { width: min(240px, 82%); max-height: 92px; }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .content-grid,
  .toolbar { grid-template-columns: 1fr; }

  .table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .table-wrap table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 0.8rem;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tbody tr {
    background: var(--insight-surface);
    border: 1px solid var(--insight-border);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    padding: 0.7rem;
  }

  .table-wrap tbody tr:hover {
    background: var(--insight-surface);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(95px, 38%) minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    padding: 0.62rem 0.15rem;
    word-break: break-word;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
    grid-template-columns: 1fr;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--insight-text-soft);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .table-wrap td:empty {
    display: none;
  }

  .table-wrap td[data-label="Acoes"],
  .table-wrap td[data-label="AÃ§Ãµes"] {
    grid-template-columns: 1fr;
  }

  .table-wrap td[data-label="Acoes"]::before,
  .table-wrap td[data-label="AÃ§Ãµes"]::before {
    margin-bottom: 0.15rem;
  }

  .table-wrap .button.small,
  .table-wrap .button {
    width: 100%;
    justify-content: center;
  }

  .transform-report-columns,
  .transform-report-card .fechamento-card-header,
  .transform-report-card .fechamento-card-footer {
    grid-template-columns: 1fr;
  }

  .transform-report-card table {
    min-width: 0;
  }

  .table-wrap form.inline-form,
  .table-wrap .inline-form {
    display: block !important;
    width: 100%;
    margin-top: 0.45rem;
  }

  .cesta-open-panel,
  .cesta-open-metrics {
    grid-template-columns: 1fr;
  }

  .cesta-open-actions {
    justify-content: flex-start;
  }

  .section-page { padding: 0.85rem; }
}




@media (max-width: 960px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .dashboard-content {
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar,
  .section-page,
  .report-page,
  .financeiro-page,
  .cartao-sales-report,
  .coupon-report-card,
  .fechamento-card,
  .transform-report-card {
    max-width: 100%;
    min-width: 0;
  }

  .module-option-grid,
  .module-option-grid.compact,
  .summary-grid,
  .content-grid,
  .shortcut-grid,
  .dashboard-analytics-grid,
  .cartao-report-totals,
  .coupon-report-header,
  .fechamento-card-header,
  .fechamento-card-footer,
  .transform-report-columns,
  .xml-totals-grid,
  .nfe-summary-grid,
  .finance-dashboard-grid,
  .finance-card-grid,
  .cartao-config-grid,
  .cartao-overview-grid {
    grid-template-columns: 1fr !important;
  }

  .module-option-card,
  .summary-card,
  .shortcut-card,
  .finance-dashboard-card,
  .coupon-report-card,
  .fechamento-card,
  .transform-report-card {
    min-width: 0;
  }

  .toolbar,
  .report-toolbar,
  .form-grid,
  .copy-product-panel,
  .action-row,
  .search-row,
  .search-inline,
  .filter-row,
  .filters-row,
  .report-filters,
  .cartao-filter-grid,
  .cartao-tax-form,
  .finance-filter-grid,
  .finance-form-grid,
  .nfe-form-grid,
  .xml-link-form,
  .xml-product-result,
  .xml-payment-grid,
  .xml-payment-grid .form-grid {
    grid-template-columns: 1fr !important;
    align-items: stretch;
  }

  .action-row,
  .form-actions,
  .topbar-actions,
  .pagination,
  .report-toolbar {
    flex-wrap: wrap;
  }

  label,
  input,
  select,
  textarea,
  button,
  .button {
    max-width: 100%;
  }

  .button,
  button,
  .toolbar button,
  .report-toolbar button,
  .action-row .button,
  .form-actions .button,
  .form-actions button {
    width: 100%;
    justify-content: center;
  }

  .pagination {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .pagination span {
    width: 100%;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 640px) {
  .dashboard-content {
    padding: 0.65rem;
  }

  .topbar {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .topbar-left {
    width: 100%;
    min-width: 0;
  }

  .topbar-left h1,
  .section-header h2,
  .section-page h2 {
    font-size: 1.08rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .topbar-left p,
  .section-header p,
  .section-page p {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .section-page,
  .report-page {
    padding: 0.75rem;
    border-radius: 10px;
    overflow: hidden;
  }

  .module-option-grid,
  .module-option-grid.compact,
  .module-option-primary,
  .module-option-sub {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
  }

  .module-option-card {
    min-height: auto;
    padding: 0.85rem;
  }

  .summary-grid {
    gap: 0.65rem;
  }

  .summary-card {
    padding: 0.8rem;
  }

  .summary-card strong {
    font-size: 1.22rem;
    overflow-wrap: anywhere;
  }

  .toolbar,
  .report-toolbar,
  .form-grid,
  .content-grid,
  .shortcut-grid,
  .copy-product-panel {
    gap: 0.65rem;
  }

  .table-wrap {
    overflow: visible !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    width: 100%;
  }

  .table-wrap table,
  .coupon-report-items,
  .cartao-sales-report-table {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tbody tr {
    background: var(--insight-surface);
    border: 1px solid var(--insight-border);
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    margin-bottom: 0.75rem;
    padding: 0.68rem;
  }

  .table-wrap tbody tr:hover {
    background: var(--insight-surface);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    padding: 0.55rem 0.1rem;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
    grid-template-columns: 1fr;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--insight-text-soft);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .table-wrap td:not([data-label]),
  .table-wrap td[data-label=""] {
    grid-template-columns: 1fr;
  }

  .table-wrap td:not([data-label])::before,
  .table-wrap td[data-label=""]::before {
    display: none;
  }

  .table-wrap td:empty {
    display: none;
  }

  .table-wrap td[data-label="Acoes"],
  .table-wrap td[data-label="AÃ§Ãµes"],
  .table-wrap td[data-label="AÃƒÂ§ÃƒÂµes"] {
    grid-template-columns: 1fr;
  }

  .table-wrap td[data-label="Acoes"]::before,
  .table-wrap td[data-label="AÃ§Ãµes"]::before,
  .table-wrap td[data-label="AÃƒÂ§ÃƒÂµes"]::before {
    margin-bottom: 0.15rem;
  }

  .table-wrap .button.small,
  .table-wrap .button,
  .table-wrap button,
  .table-wrap input,
  .table-wrap select {
    width: 100%;
  }

  .coupon-report-card {
    border-radius: 10px;
  }

  .coupon-report-header {
    grid-template-columns: 1fr !important;
    padding: 0.75rem;
  }

  .coupon-report-total {
    text-align: left;
  }

  .fechamento-status {
    justify-self: stretch;
    min-width: 0;
    text-align: left;
  }
}

@media (max-width: 960px) {
  .report-page .table-wrap,
  .cartao-sales-report.table-wrap,
  .coupon-report-card {
    overflow: visible !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    width: 100%;
  }

  .report-page .table-wrap table,
  .report-page .table-wrap thead,
  .report-page .table-wrap tbody,
  .report-page .table-wrap tfoot,
  .report-page .table-wrap tr,
  .report-page .table-wrap td,
  .report-page .table-wrap tfoot th,
  .coupon-report-items,
  .coupon-report-items thead,
  .coupon-report-items tbody,
  .coupon-report-items tfoot,
  .coupon-report-items tr,
  .coupon-report-items td,
  .coupon-report-items tfoot th,
  .cartao-sales-report-table,
  .cartao-sales-report-table thead,
  .cartao-sales-report-table tbody,
  .cartao-sales-report-table tfoot,
  .cartao-sales-report-table tr,
  .cartao-sales-report-table td,
  .cartao-sales-report-table tfoot th {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }

  .report-page .table-wrap thead,
  .report-page .report-table thead,
  .coupon-report-items thead,
  .cartao-sales-report-table thead {
    display: none;
  }

  .report-page .table-wrap table,
  .report-page .report-table table,
  .coupon-report-items,
  .cartao-sales-report-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto !important;
  }

  .report-page .table-wrap tbody tr,
  .report-page .table-wrap tfoot tr,
  .coupon-report-items tbody tr,
  .coupon-report-items tfoot tr,
  .cartao-sales-report-table tbody tr,
  .cartao-sales-report-table tfoot tr {
    display: block;
    margin: 0 0 0.8rem;
    padding: 0.75rem;
    border: 1px solid var(--insight-border);
    border-radius: 12px;
    background: var(--insight-surface);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  }

  .report-page .table-wrap tbody tr:hover,
  .coupon-report-items tbody tr:hover,
  .cartao-sales-report-table tbody tr:hover {
    background: var(--insight-surface);
  }

  .report-page .table-wrap td,
  .coupon-report-items td,
  .cartao-sales-report-table td {
    display: grid;
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    padding: 0.55rem 0.1rem;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
  }

  .report-page .table-wrap td:last-child,
  .coupon-report-items td:last-child,
  .cartao-sales-report-table td:last-child {
    border-bottom: 0;
    grid-template-columns: 1fr;
  }

  .report-page .table-wrap td::before,
  .report-page .report-table td::before,
  .coupon-report-items td::before,
  .cartao-sales-report-table td::before {
    content: attr(data-label);
    color: var(--insight-text-soft);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .report-page .table-wrap td:not([data-label])::before,
  .report-page .table-wrap td[data-label=""]::before,
  .coupon-report-items td:not([data-label])::before,
  .coupon-report-items td[data-label=""]::before,
  .cartao-sales-report-table td:not([data-label])::before,
  .cartao-sales-report-table td[data-label=""]::before {
    display: none;
  }

  .report-page .table-wrap td:not([data-label]),
  .report-page .table-wrap td[data-label=""],
  .coupon-report-items td:not([data-label]),
  .coupon-report-items td[data-label=""],
  .cartao-sales-report-table td:not([data-label]),
  .cartao-sales-report-table td[data-label=""] {
    grid-template-columns: 1fr;
  }

  .report-page .table-wrap td:empty,
  .coupon-report-items td:empty,
  .cartao-sales-report-table td:empty {
    display: none;
  }

  .report-page .table-wrap .button,
  .report-page .table-wrap button,
  .report-page .report-table .button,
  .report-page .report-table button,
  .report-page .table-wrap input,
  .report-page .table-wrap select,
  .cartao-sales-report-table .button,
  .cartao-sales-report-table button,
  .cartao-sales-report-table input,
  .cartao-sales-report-table select {
    width: 100%;
  }
}


@media (max-width: 960px) {
  .report-page .table-wrap,
  .report-page .report-table,
  .cartao-sales-report.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    background: var(--insight-surface);
    border: 1px solid var(--insight-border);
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    padding: 0.25rem;
  }

  .report-page .table-wrap table,
  .report-page .report-table table,
  .coupon-report-items,
  .cartao-sales-report-table {
    display: table !important;
    width: max-content !important;
    min-width: 760px !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
  }

  .report-page .table-wrap thead,
  .report-page .report-table thead,
  .coupon-report-items thead,
  .cartao-sales-report-table thead {
    display: table-header-group !important;
  }

  .report-page .table-wrap tbody,
  .report-page .report-table tbody,
  .coupon-report-items tbody,
  .cartao-sales-report-table tbody {
    display: table-row-group !important;
  }

  .report-page .table-wrap tfoot,
  .report-page .report-table tfoot,
  .coupon-report-items tfoot,
  .cartao-sales-report-table tfoot {
    display: table-footer-group !important;
  }

  .report-page .table-wrap tr,
  .report-page .report-table tr,
  .coupon-report-items tr,
  .cartao-sales-report-table tr {
    display: table-row !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .report-page .table-wrap th,
  .report-page .table-wrap td,
  .report-page .report-table th,
  .report-page .report-table td,
  .coupon-report-items th,
  .coupon-report-items td,
  .cartao-sales-report-table th,
  .cartao-sales-report-table td,
  .cartao-sales-report-table tfoot th {
    display: table-cell !important;
    width: auto !important;
    min-width: 110px !important;
    max-width: 240px;
    border-bottom: 1px solid var(--insight-border) !important;
    padding: 0.62rem 0.7rem !important;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }

  .report-page .table-wrap th,
  .report-page .report-table th,
  .coupon-report-items th,
  .cartao-sales-report-table th {
    white-space: nowrap;
  }

  .report-page .table-wrap td::before,
  .report-page .report-table td::before,
  .coupon-report-items td::before,
  .cartao-sales-report-table td::before {
    content: none !important;
    display: none !important;
  }

  .report-page .table-wrap .button,
  .report-page .table-wrap button,
  .report-page .report-table .button,
  .report-page .report-table button,
  .cartao-sales-report-table .button,
  .cartao-sales-report-table button {
    width: auto;
    min-width: 92px;
    white-space: nowrap;
  }
}

@media (max-width: 960px) {
  .report-page .report-table,
  .report-page .table-wrap,
  .cartao-sales-report.table-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .report-page .report-table > table,
  .report-page .table-wrap > table,
  .report-page .table-wrap table,
  .coupon-report-items,
  .cartao-sales-report-table {
    display: table !important;
    width: max-content !important;
    min-width: 900px !important;
    max-width: none !important;
    table-layout: auto !important;
  }

  .report-page .report-table th,
  .report-page .report-table td,
  .report-page .table-wrap th,
  .report-page .table-wrap td,
  .coupon-report-items th,
  .coupon-report-items td,
  .cartao-sales-report-table th,
  .cartao-sales-report-table td {
    display: table-cell !important;
    white-space: nowrap;
  }
}
/* Insight reports mobile scroll normalizer */
@media (max-width: 960px) {
  .section-page.report-page,
  .report-page {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .report-page .report-table,
  .report-page .table-wrap,
  .cartao-sales-report.table-wrap,
  .coupon-report-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .coupon-report-card {
    background: #ffffff !important;
    border: 1px solid var(--insight-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
  }

  .coupon-report-header {
    display: grid !important;
    grid-template-columns: minmax(180px, 1.1fr) minmax(220px, 1.35fr) minmax(160px, 1fr) minmax(180px, 0.9fr) !important;
    width: 920px !important;
    min-width: 920px !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .report-page .report-table > table,
  .report-page .table-wrap > table,
  .report-page .table-wrap table,
  .coupon-report-items,
  .cartao-sales-report-table {
    display: table !important;
    width: max-content !important;
    min-width: 920px !important;
    max-width: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
  }

  .report-page .report-table thead,
  .report-page .table-wrap thead,
  .coupon-report-items thead,
  .cartao-sales-report-table thead {
    display: table-header-group !important;
  }

  .report-page .report-table tbody,
  .report-page .table-wrap tbody,
  .coupon-report-items tbody,
  .cartao-sales-report-table tbody {
    display: table-row-group !important;
  }

  .report-page .report-table tfoot,
  .report-page .table-wrap tfoot,
  .coupon-report-items tfoot,
  .cartao-sales-report-table tfoot {
    display: table-footer-group !important;
  }

  .report-page .report-table tr,
  .report-page .table-wrap tr,
  .coupon-report-items tr,
  .cartao-sales-report-table tr {
    display: table-row !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .report-page .report-table th,
  .report-page .report-table td,
  .report-page .table-wrap th,
  .report-page .table-wrap td,
  .coupon-report-items th,
  .coupon-report-items td,
  .cartao-sales-report-table th,
  .cartao-sales-report-table td,
  .cartao-sales-report-table tfoot th {
    display: table-cell !important;
    width: auto !important;
    min-width: 105px !important;
    max-width: 260px;
    padding: 0.56rem 0.65rem !important;
    border-bottom: 1px solid var(--insight-border) !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    vertical-align: middle !important;
  }

  .report-page .report-table td::before,
  .report-page .table-wrap td::before,
  .coupon-report-items td::before,
  .cartao-sales-report-table td::before {
    content: none !important;
    display: none !important;
  }

  .report-page .report-table .button,
  .report-page .table-wrap .button,
  .report-page .report-table button,
  .report-page .table-wrap button,
  .cartao-sales-report-table .button,
  .cartao-sales-report-table button {
    width: auto !important;
    min-width: 90px;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .coupon-report-header,
  .report-page .report-table > table,
  .report-page .table-wrap > table,
  .report-page .table-wrap table,
  .coupon-report-items,
  .cartao-sales-report-table {
    width: 860px !important;
    min-width: 860px !important;
    max-width: none !important;
  }
}
/* End Insight reports mobile scroll normalizer */
/* Insight mobile sidebar safe space */
@media (max-width: 960px) {
  .sidebar {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto !important;
    padding-bottom: calc(7rem + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom: calc(7rem + env(safe-area-inset-bottom));
  }

  .sidebar-menu {
    padding-bottom: calc(8rem + env(safe-area-inset-bottom)) !important;
  }
}
/* End Insight mobile sidebar safe space */
/* Insight card reconciliation mobile scroll */
@media (max-width: 960px) {
  .financeiro-page .cartao-recebiveis-table,
  .financeiro-page .cartao-sales-report,
  .financeiro-page .cartao-report-summary,
  .financeiro-page .table-wrap.cartao-recebiveis-table,
  .financeiro-page .table-wrap.cartao-sales-report {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .financeiro-page .cartao-recebiveis-table > table,
  .financeiro-page .cartao-sales-report > table,
  .financeiro-page .cartao-report-summary > table,
  .financeiro-page .cartao-sales-report-table {
    display: table !important;
    width: max-content !important;
    max-width: none !important;
    min-width: 1080px !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
  }

  .financeiro-page .cartao-recebiveis-table > table {
    min-width: 1180px !important;
  }

  .financeiro-page .cartao-recebiveis-table thead,
  .financeiro-page .cartao-sales-report-table thead {
    display: table-header-group !important;
  }

  .financeiro-page .cartao-recebiveis-table tbody,
  .financeiro-page .cartao-sales-report-table tbody {
    display: table-row-group !important;
  }

  .financeiro-page .cartao-recebiveis-table tfoot,
  .financeiro-page .cartao-sales-report-table tfoot {
    display: table-footer-group !important;
  }

  .financeiro-page .cartao-recebiveis-table tr,
  .financeiro-page .cartao-sales-report-table tr {
    display: table-row !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .financeiro-page .cartao-recebiveis-table th,
  .financeiro-page .cartao-recebiveis-table td,
  .financeiro-page .cartao-sales-report-table th,
  .financeiro-page .cartao-sales-report-table td,
  .financeiro-page .cartao-sales-report-table tfoot th {
    display: table-cell !important;
    width: auto !important;
    min-width: 98px !important;
    max-width: 250px;
    padding: 0.52rem 0.56rem !important;
    border-bottom: 1px solid var(--insight-border) !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    vertical-align: middle !important;
  }

  .financeiro-page .cartao-recebiveis-table td::before,
  .financeiro-page .cartao-sales-report-table td::before {
    content: none !important;
    display: none !important;
  }

  .financeiro-page .cartao-recebiveis-table td:nth-child(11),
  .financeiro-page .cartao-recebiveis-table th:nth-child(11) {
    min-width: 128px !important;
    max-width: 150px;
  }

  .financeiro-page .cartao-recebivel-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.35rem !important;
    min-width: 108px;
  }

  .financeiro-page .cartao-recebiveis-table .inline-form,
  .financeiro-page .cartao-recebiveis-table .inline-form:last-child {
    display: block !important;
    margin: 0 !important;
  }

  .financeiro-page .cartao-recebiveis-table .button,
  .financeiro-page .cartao-recebiveis-table button,
  .financeiro-page .cartao-sales-report-table .button,
  .financeiro-page .cartao-sales-report-table button {
    width: 100% !important;
    min-width: 96px;
    white-space: nowrap;
  }

  .financeiro-page .finance-table-scrollbar {
    display: block !important;
  }
}

@media (max-width: 640px) {
  .financeiro-page .cartao-recebiveis-table > table {
    min-width: 1120px !important;
  }

  .financeiro-page .cartao-sales-report > table,
  .financeiro-page .cartao-report-summary > table,
  .financeiro-page .cartao-sales-report-table {
    min-width: 980px !important;
  }

  .financeiro-page .cartao-recebiveis-table th,
  .financeiro-page .cartao-recebiveis-table td,
  .financeiro-page .cartao-sales-report-table th,
  .financeiro-page .cartao-sales-report-table td,
  .financeiro-page .cartao-sales-report-table tfoot th {
    min-width: 88px !important;
    padding: 0.48rem 0.5rem !important;
    font-size: 0.76rem;
  }
}
/* End Insight card reconciliation mobile scroll */
@media print {
  @page { size: A4; margin: 10mm; }
  .no-print,
  .sidebar,
  .mobile-topbar,
  .sidebar-overlay {
    display: none !important;
  }
  .dashboard-shell,
  .main-content,
  .section-page.report-page {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .cartao-sales-report.report-page {
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .cartao-sales-report.report-page .cartao-report-totals {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
  }

  .cartao-sales-report.report-page .finance-dashboard-card {
    min-height: 72px;
    padding: 0.55rem;
    color: #000;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1;
  }

  .cartao-sales-report.report-page .finance-dashboard-card::after {
    display: none;
  }

  .cartao-sales-report.report-page .finance-dashboard-card span,
  .cartao-sales-report.report-page .finance-dashboard-card strong,
  .cartao-sales-report.report-page .finance-dashboard-card small {
    color: #000 !important;
  }

  .cartao-sales-report.report-page table {
    min-width: 0 !important;
    width: 100%;
    font-size: 0.72rem;
  }

  .cartao-sales-report.report-page th,
  .cartao-sales-report.report-page td {
    padding: 0.35rem;
  }
}


.cce-actions {
  justify-content: flex-start;
  margin-bottom: 0.75rem;
}

.cce-modal-card {
  width: min(760px, calc(100vw - 2rem));
}

.cce-legal-note {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--insight-blue-700);
  border-radius: 8px;
  background: #eff6ff;
  color: #0f172a;
}

.cce-legal-note strong {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--insight-blue-900);
}

.cce-legal-note p {
  margin: 0 0 0.45rem;
  line-height: 1.45;
}

.cce-legal-note p:last-child {
  margin-bottom: 0;
  font-weight: 700;
}

.cce-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.cce-form .cce-textarea-field,
.cce-form .form-actions {
  grid-column: 1 / -1;
}

.cce-form textarea[name="correcao"] {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  line-height: 1.45;
}

.cce-form .form-actions {
  justify-content: flex-end;
  margin-top: 0.2rem;
}

/* Impressao de etiquetas */
.checkbox-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin: 10px 0 16px;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #bfd2ee;
    border-radius: 8px;
    background: #f4f8ff;
    cursor: pointer;
}

.checkbox-card input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
}

.checkbox-card span {
    display: grid;
    gap: 4px;
}

.checkbox-card small,
.muted {
    color: #53657c;
}

.compact-input {
    max-width: 90px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.etiqueta-config-grid {
    margin-top: 12px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.check-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.toolbar-actions.no-margin { margin-top: 0; }


.imendes-product-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--insight-border);
  border-radius: 8px;
  background: #f4f8ff;
}

.imendes-product-panel h3,
.imendes-product-panel p {
  margin: 0;
}

.imendes-product-panel h3 {
  color: var(--insight-blue-900);
  font-size: 1rem;
}

.imendes-product-panel p {
  margin-top: 0.25rem;
  color: var(--insight-text-soft);
}

.imendes-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.imendes-product-panel .alert,
.imendes-product-result {
  grid-column: 1 / -1;
}

.imendes-return-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #bcd2f5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--insight-text);
}

.imendes-return-card strong {
  color: var(--insight-blue-900);
}

@media (max-width: 760px) {
  .imendes-product-panel {
    grid-template-columns: 1fr;
  }

  .imendes-product-actions {
    justify-content: stretch;
  }

  .imendes-product-actions .button,
  .imendes-product-actions button {
    width: 100%;
    justify-content: center;
  }
}
.imendes-loading-overlay {
    align-items: center;
    background: rgba(3, 10, 24, 0.58);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 9999;
}

.imendes-loading-overlay[hidden] {
    display: none;
}

.imendes-loading-card {
    background: #ffffff;
    border: 1px solid #bcd4ff;
    border-radius: 12px;
    box-shadow: 0 22px 70px rgba(5, 24, 55, 0.26);
    color: #071326;
    display: grid;
    gap: 10px;
    max-width: 460px;
    padding: 24px;
    width: min(92vw, 460px);
}

.imendes-loading-card strong {
    color: #002f87;
    font-size: 18px;
}

.imendes-loading-card span {
    color: #31415c;
}

.imendes-loading-bar {
    background: #dbe8ff;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.imendes-loading-bar span {
    animation: imendes-loading-move 1.1s infinite ease-in-out;
    background: #0b55b7;
    border-radius: inherit;
    display: block;
    height: 100%;
    width: 42%;
}

.imendes-return-selectable {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

@keyframes imendes-loading-move {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(250%); }
}
.imendes-description-card {
    width: min(980px, calc(100vw - 2rem));
}

.imendes-description-search {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 210px;
}

.imendes-description-results {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    max-height: 46vh;
    overflow: auto;
    padding-right: 4px;
}

.imendes-description-results[hidden] {
    display: none;
}

.imendes-return-selectable .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .imendes-description-search {
        grid-template-columns: 1fr;
    }

    .imendes-return-selectable {
        align-items: stretch;
        flex-direction: column;
    }
}
