/* Fusion+ Executive Polish V3
   Visual direction: calm executive console, low-noise surfaces and strong hierarchy. */
:root {
  --fx-bg: #06101a;
  --fx-sidebar: #07111c;
  --fx-surface: #0a1623;
  --fx-surface-raised: #0d1a29;
  --fx-surface-hover: #112033;
  --fx-line: #22344a;
  --fx-line-soft: rgba(127, 151, 184, .16);
  --fx-text: #f6f8fc;
  --fx-muted: #9aa9bd;
  --fx-dim: #718198;
  --fx-pink: #ed2d86;
  --fx-pink-soft: rgba(237, 45, 134, .13);
  --fx-green: #55d68f;
  --fx-red: #ff6169;
  --fx-blue: #5c9def;
  --fx-amber: #f0aa24;
  --fx-radius: 9px;
}

html,
html body {
  color: var(--fx-text) !important;
  background: var(--fx-bg) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body::before,
body::after,
.shell::before {
  display: none !important;
}

body .shell {
  display: grid !important;
  grid-template-columns: 238px minmax(0, 1fr) !important;
  min-height: 100vh !important;
  background: var(--fx-bg) !important;
}

body .shell > aside {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  height: 100vh !important;
  padding: 18px 10px !important;
  overflow-y: auto !important;
  border-right: 1px solid var(--fx-line) !important;
  background: linear-gradient(180deg, #07121e 0%, #06101a 100%) !important;
  box-shadow: none !important;
}

body .shell > main {
  min-width: 0 !important;
  max-width: none !important;
  margin-left: 0 !important;
  padding: 0 24px 30px !important;
  background: transparent !important;
}

body .brand {
  min-height: 70px !important;
  margin: 0 0 8px !important;
  padding: 8px 12px 17px !important;
  border-bottom: 1px solid var(--fx-line-soft) !important;
}

body .brand-mark,
body .brand-mark.has-logo,
body #brandMark {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
  border: 1px solid var(--fx-pink) !important;
  border-radius: 10px !important;
  background: var(--fx-pink-soft) !important;
  box-shadow: none !important;
}

body .brand-mark span,
body #brandMark > span {
  color: #ff5fa6 !important;
  font-size: 15px !important;
}

body .brand-text strong,
body #brandName {
  color: var(--fx-text) !important;
  font-size: 21px !important;
  letter-spacing: -.025em !important;
}

body .brand-text span,
body .nav-title {
  display: none !important;
}

body .nav-btn {
  position: relative !important;
  min-height: 48px !important;
  margin: 2px 0 !important;
  padding: 0 13px !important;
  gap: 12px !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #aeb9ca !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

body .nav-btn:hover {
  border-color: var(--fx-line-soft) !important;
  background: rgba(255, 255, 255, .025) !important;
  color: var(--fx-text) !important;
}

body .nav-btn.active,
body .nav-btn.is-active,
body .nav-btn[aria-current="page"] {
  border-color: rgba(237, 45, 134, .24) !important;
  background: linear-gradient(90deg, rgba(237, 45, 134, .17), rgba(237, 45, 134, .055)) !important;
  color: #ff609f !important;
}

body .nav-btn.active::after,
body .nav-btn.is-active::after,
body .nav-btn[aria-current="page"]::after {
  content: "" !important;
  position: absolute !important;
  inset: 7px auto 7px -10px !important;
  width: 3px !important;
  border-radius: 0 3px 3px 0 !important;
  background: var(--fx-pink) !important;
  box-shadow: none !important;
}

body .nav-icon,
body .nav-icon svg {
  width: 20px !important;
  height: 20px !important;
  color: currentColor !important;
  stroke: currentColor !important;
}

body .sidebar-toggle {
  width: 28px !important;
  height: 28px !important;
  right: -14px !important;
  top: 22px !important;
  border: 1px solid var(--fx-line) !important;
  border-radius: 7px !important;
  background: var(--fx-surface-raised) !important;
  color: var(--fx-muted) !important;
  box-shadow: none !important;
}

body .topbar {
  display: flex !important;
  min-height: 0 !important;
  margin: 0 -24px 16px !important;
  padding: 26px 24px 0 !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 18px !important;
  border: 0 !important;
  background: var(--fx-bg) !important;
  box-shadow: none !important;
}

body .topbar h1 {
  margin: 0 !important;
  color: var(--fx-text) !important;
  font-size: clamp(25px, 2.15vw, 31px) !important;
  font-weight: 780 !important;
  letter-spacing: -.035em !important;
}

body .topbar-subtitle {
  margin-top: 5px !important;
  color: var(--fx-muted) !important;
  font-size: 13px !important;
}

body .topbar .toolbar {
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 46px !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
}

body .topbar .toolbar-status,
body .topbar .dashboard-period-controls,
body .topbar .toolbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body .topbar .dashboard-period-controls {
  justify-content: flex-end !important;
}

body .topbar .toolbar-status .sync-btn,
body .topbar .toolbar-status .pending-payable-btn,
body .topbar .toolbar .parent-period-button,
body .topbar .toolbar .dashboard-period-controls .reseller-scope-filter,
body .topbar .toolbar-actions .icon-btn {
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 1px solid var(--fx-line) !important;
  border-radius: 8px !important;
  background: var(--fx-surface) !important;
  color: #c9d1de !important;
  box-shadow: none !important;
  font-size: 12px !important;
}

body .topbar .toolbar-status .sync-btn:hover,
body .topbar .toolbar-status .pending-payable-btn:hover,
body .topbar .toolbar .parent-period-button:hover,
body .topbar .toolbar .dashboard-period-controls .reseller-scope-filter:hover,
body .topbar .toolbar-actions .icon-btn:hover {
  border-color: #35506e !important;
  background: var(--fx-surface-hover) !important;
}

body .topbar .toolbar-status .sync-dot {
  width: 9px !important;
  height: 9px !important;
  background: var(--fx-green) !important;
  box-shadow: none !important;
}

body .topbar .toolbar-status .pending-payable-btn strong {
  color: #ff579f !important;
}

body .topbar .toolbar .period-quick {
  display: flex !important;
  min-width: 0 !important;
  height: 46px !important;
  padding: 3px !important;
  gap: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--fx-line) !important;
  border-radius: 8px !important;
  background: var(--fx-surface) !important;
}

body .topbar .toolbar .period-quick .seg {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 13px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #b1bdcd !important;
  font-size: 12px !important;
  font-weight: 680 !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

body .topbar .toolbar .period-quick .seg.active,
body .topbar .toolbar .period-quick .seg[aria-pressed="true"] {
  background: linear-gradient(180deg, #f13f91, #d91f73) !important;
  color: #fff !important;
}

body .topbar .toolbar .dashboard-period-controls .reseller-scope-filter {
  width: clamp(178px, 16vw, 225px) !important;
  min-width: 178px !important;
}

body .topbar .toolbar-actions .icon-btn {
  width: 46px !important;
  padding: 0 !important;
  font-size: 20px !important;
}

body .local-server-warning,
body .footer-note {
  display: none !important;
}

body .view {
  min-width: 0 !important;
  animation: none !important;
}

body .panel,
body .kpi,
body .reconciliation-card,
body .closing-card,
body .daily-closing-card,
body .finance-summary-card,
body .pending-center-card,
body .audit-summary-card {
  border-color: var(--fx-line) !important;
  border-radius: var(--fx-radius) !important;
  background: var(--fx-surface) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body .panel:hover,
body .kpi:hover {
  transform: none !important;
  box-shadow: none !important;
}

body .panel-header,
body .panel-head,
body .finance-ledger-head {
  min-height: 58px !important;
  padding: 14px 18px !important;
  border-color: var(--fx-line-soft) !important;
  background: transparent !important;
}

body .panel-title,
body .panel-head h2,
body .finance-ledger-title {
  color: var(--fx-text) !important;
  font-size: 15px !important;
  font-weight: 720 !important;
  letter-spacing: -.01em !important;
  text-transform: none !important;
}

body .panel-note,
body .muted {
  color: var(--fx-muted) !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}

body .panel-body {
  padding: 18px !important;
}

body .kpi-grid,
body .finance-summary-grid,
body .reconciliation-grid,
body .closing-grid,
body .daily-closing-grid {
  gap: 10px !important;
}

body .kpi {
  min-height: 112px !important;
  padding: 16px !important;
}

body .kpi .name,
body .finance-summary-label,
body .reconciliation-card span,
body .closing-card span,
body .daily-closing-card span {
  color: #aab6c7 !important;
  font-size: 10px !important;
  font-weight: 760 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase !important;
}

body .kpi .metric,
body .finance-summary-value,
body .reconciliation-card strong,
body .closing-card strong,
body .daily-closing-card strong {
  color: var(--fx-text) !important;
  font-variant-numeric: tabular-nums !important;
}

body .kpi-icon,
body .finance-summary-icon {
  border: 1px solid currentColor !important;
  border-radius: 9px !important;
  background: rgba(92, 157, 239, .09) !important;
  box-shadow: none !important;
}

body .control,
body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body select,
body textarea {
  min-height: 40px !important;
  border: 1px solid var(--fx-line) !important;
  border-radius: 7px !important;
  background: #091522 !important;
  color: var(--fx-text) !important;
  box-shadow: none !important;
}

body input:focus,
body select:focus,
body textarea:focus {
  outline: 2px solid rgba(237, 45, 134, .24) !important;
  outline-offset: 1px !important;
  border-color: rgba(237, 45, 134, .62) !important;
}

body button,
body .action-btn,
body button.primary {
  border-radius: 7px !important;
  box-shadow: none !important;
}

body .action-btn,
body button.primary {
  min-height: 40px !important;
  border: 1px solid var(--fx-line) !important;
  background: #0d1a29 !important;
  color: #d2d9e4 !important;
}

body .action-btn:hover,
body button.primary:hover {
  border-color: #35506e !important;
  background: var(--fx-surface-hover) !important;
}

body .action-btn.approved,
body button.primary,
body .auth-submit {
  border-color: #e12a7f !important;
  background: linear-gradient(180deg, #ef398d, #d71f73) !important;
  color: #fff !important;
}

body .badge,
body .status,
body .movement-status-action,
body .movement-approved-pill {
  border-radius: 999px !important;
  box-shadow: none !important;
}

body .table-scroll,
body .table-wrap {
  border-color: var(--fx-line-soft) !important;
  background: transparent !important;
}

body table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  color: #dbe1ea !important;
}

body thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  height: 42px !important;
  padding: 10px 12px !important;
  border-color: var(--fx-line-soft) !important;
  background: #0c1927 !important;
  color: #8998ad !important;
  font-size: 10px !important;
  font-weight: 760 !important;
  letter-spacing: .045em !important;
  text-transform: uppercase !important;
}

body tbody td {
  min-height: 46px !important;
  padding: 12px !important;
  border-color: var(--fx-line-soft) !important;
  background: transparent !important;
  color: #cbd4e0 !important;
  font-size: 12px !important;
}

body tbody tr:hover td {
  background: rgba(92, 157, 239, .035) !important;
}

body .clients-pagination {
  min-height: 56px !important;
  padding: 10px 14px !important;
  border-top: 1px solid var(--fx-line-soft) !important;
  color: var(--fx-muted) !important;
  background: #08131f !important;
}

/* Dashboard: match the selected executive concept. */
body .shell main #operacao.view.active {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}

body .shell main #operacao.view.active > * {
  grid-column: 1 !important;
  grid-row: auto !important;
}

body #operacao > .dashboard-surface {
  order: 1 !important;
  overflow: hidden !important;
  border: 1px solid var(--fx-line) !important;
  background: var(--fx-surface) !important;
}

body #operacao > .dashboard-surface > .panel-header {
  display: none !important;
}

body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid {
  display: grid !important;
  grid-template-columns: 1.08fr 1.05fr 1.08fr .86fr .86fr !important;
  gap: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi,
body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(n) {
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  grid-template-rows: auto auto 1fr !important;
  min-height: 168px !important;
  padding: 26px 16px !important;
  column-gap: 14px !important;
  border: 0 !important;
  border-right: 1px solid var(--fx-line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(4),
body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(6),
body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(8),
body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(9) {
  display: none !important;
}

body .shell main #operacao.view.active .dashboard-grid .kpi::before,
body .shell main #operacao.view.active .dashboard-grid .kpi::after {
  display: none !important;
}

body .shell main #operacao.view.active .dashboard-grid .kpi-head {
  display: contents !important;
}

body .shell main #operacao.view.active .dashboard-grid .kpi-icon {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  width: 42px !important;
  height: 42px !important;
  align-self: start !important;
}

body .shell main #operacao.view.active .dashboard-grid .name {
  grid-column: 2 !important;
  grid-row: 1 !important;
  max-width: 122px !important;
  color: #b4becc !important;
  font-size: 10px !important;
  line-height: 1.45 !important;
}

body .shell main #operacao.view.active .dashboard-grid .metric {
  grid-column: 2 !important;
  grid-row: 2 !important;
  margin: 10px 0 0 !important;
  color: var(--fx-text) !important;
  font-size: clamp(19px, 1.45vw, 26px) !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
}

body .shell main #operacao.view.active .dashboard-grid .delta {
  grid-column: 2 !important;
  grid-row: 3 !important;
  align-self: end !important;
  margin: 12px 0 0 !important;
  color: var(--fx-muted) !important;
  font-size: 10px !important;
  line-height: 1.45 !important;
}

body .shell main #operacao.view.active .dashboard-grid .kpi:nth-child(1) .metric { color: var(--fx-green) !important; }
body .shell main #operacao.view.active .dashboard-grid .kpi:nth-child(2) .metric,
body .shell main #operacao.view.active .dashboard-grid .kpi:nth-child(3) .metric { color: var(--fx-red) !important; }

body #operacao > .dashboard-insights {
  order: 2 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .9fr) !important;
  gap: 12px !important;
}

body #operacao > .dashboard-insights > .panel {
  min-height: 430px !important;
  margin: 0 !important;
  overflow: hidden !important;
}

@media (min-width: 1121px) {
  body .shell main #operacao.view.active > .dashboard-insights {
    height: 485px !important;
    min-height: 485px !important;
  }

  body .shell main #operacao.view.active > .dashboard-insights > .panel {
    height: 485px !important;
    min-height: 485px !important;
  }
}

body #operacao .dashboard-finance-chart {
  min-height: 358px !important;
  padding: 14px 18px 18px !important;
}

body #operacao .dashboard-chart-summary {
  overflow: hidden !important;
  border: 1px solid var(--fx-line) !important;
  border-radius: 7px !important;
  background: #081522 !important;
}

body #operacao .dashboard-chart-stat {
  border-color: var(--fx-line-soft) !important;
  background: transparent !important;
}

body #operacao .dashboard-chart-shell {
  min-height: 218px !important;
}

body .shell main #operacao.view.active > .dashboard-command-center {
  order: 3 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  min-height: 114px !important;
  margin: 0 !important;
  padding: 43px 0 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--fx-line) !important;
  border-radius: var(--fx-radius) !important;
  background: var(--fx-surface) !important;
}

body .shell main #operacao.view.active > .dashboard-command-center::before {
  content: "Resumo e ações" !important;
  position: absolute !important;
  inset: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  height: 43px !important;
  padding: 0 17px !important;
  border-bottom: 1px solid var(--fx-line-soft) !important;
  color: var(--fx-text) !important;
  font-size: 14px !important;
  font-weight: 720 !important;
}

body .shell main #operacao.view.active > .dashboard-command-center .dashboard-command-card {
  min-height: 70px !important;
  padding: 14px 17px !important;
  border: 0 !important;
  border-right: 1px solid var(--fx-line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body .shell main #operacao.view.active > .dashboard-command-center .dashboard-command-card::before {
  display: none !important;
}

body .shell main #operacao.view.active > .dashboard-command-center .dashboard-command-card strong {
  color: var(--fx-text) !important;
  font-size: 18px !important;
}

body .shell main #operacao.view.active > .dashboard-command-center .dashboard-command-card span,
body .shell main #operacao.view.active > .dashboard-command-center .dashboard-command-card small {
  color: var(--fx-muted) !important;
}

body #operacao > .dashboard-secondary-insights {
  order: 4 !important;
  gap: 12px !important;
}

/* Form-heavy pages: restore comfortable working widths. */
body .reseller-access-layout {
  grid-template-columns: minmax(390px, .78fr) minmax(0, 1.42fr) !important;
  gap: 14px !important;
  align-items: start !important;
}

body .vault-admin-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(390px, .65fr) !important;
  gap: 14px !important;
  align-items: start !important;
}

body .reseller-access-form {
  display: grid !important;
  gap: 13px !important;
}

body .form-control-group > span,
body .setting-row strong {
  color: #c7d0dd !important;
  font-size: 11px !important;
  font-weight: 680 !important;
}

body .form-control-group textarea {
  min-height: 92px !important;
}

body .integration-config-block,
body .callout,
body .setting-row,
body .settlement-rule-card,
body .daily-closing-box {
  border-color: var(--fx-line) !important;
  border-radius: 8px !important;
  background: #081522 !important;
  box-shadow: none !important;
}

body #configuracoes > .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}

body .modal,
body .auth-gate {
  background: rgba(2, 7, 13, .82) !important;
  backdrop-filter: blur(7px) !important;
}

body .modal-card,
body .auth-panel {
  border: 1px solid var(--fx-line) !important;
  border-radius: 12px !important;
  background: var(--fx-surface-raised) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48) !important;
}

@media (max-width: 1320px) {
  body .topbar .toolbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "status actions" "filters filters" !important;
  }

  body .topbar .toolbar-status { grid-area: status !important; }
  body .topbar .dashboard-period-controls { grid-area: filters !important; justify-content: flex-start !important; }
  body .topbar .toolbar-actions { grid-area: actions !important; }
}

@media (max-width: 1120px) {
  body .reseller-access-layout,
  body .vault-admin-layout,
  body #configuracoes > .grid {
    grid-template-columns: 1fr !important;
  }

  body #operacao > .dashboard-insights {
    grid-template-columns: 1fr !important;
  }

  body #operacao > .dashboard-command-center {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  body .shell,
  body .shell.sidebar-expanded,
  body .shell.sidebar-collapsed {
    grid-template-columns: 70px minmax(0, 1fr) !important;
  }

  body .shell > aside {
    padding: 14px 7px !important;
  }

  body .brand {
    justify-content: center !important;
    padding-inline: 0 !important;
  }

  body .brand-text,
  body .nav-label {
    display: none !important;
  }

  body .nav-btn {
    justify-content: center !important;
    padding: 0 !important;
  }

  body .shell > main {
    padding-inline: 18px !important;
  }

  body .topbar {
    margin-inline: -18px !important;
    padding-inline: 18px !important;
  }

  body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(n) {
    border-bottom: 1px solid var(--fx-line-soft) !important;
  }

  body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(7) {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 700px) {
  body .shell,
  body .shell.sidebar-expanded,
  body .shell.sidebar-collapsed {
    display: block !important;
  }

  body .shell > aside {
    position: fixed !important;
    inset: auto 0 0 !important;
    display: flex !important;
    width: 100% !important;
    height: 64px !important;
    padding: 5px 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border: 0 !important;
    border-top: 1px solid var(--fx-line) !important;
  }

  body .shell > aside .brand,
  body .shell > aside .nav-title,
  body .shell > aside .sidebar-toggle {
    display: none !important;
  }

  body .shell > aside .nav-btn {
    flex: 0 0 48px !important;
    min-width: 48px !important;
    height: 52px !important;
    min-height: 52px !important;
  }

  body .shell > aside .nav-btn.active::after {
    inset: auto 12px 1px !important;
    width: auto !important;
    height: 2px !important;
  }

  body .shell > main {
    padding: 0 12px 82px !important;
  }

  body .topbar {
    margin-inline: -12px !important;
    padding: 18px 12px 0 !important;
  }

  body .topbar .toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  body .topbar .toolbar-status,
  body .topbar .dashboard-period-controls,
  body .topbar .toolbar-actions {
    width: 100% !important;
    overflow-x: auto !important;
  }

  body .topbar .dashboard-period-controls {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  body .topbar .toolbar .period-quick {
    width: 100% !important;
    overflow-x: auto !important;
  }

  body .topbar .toolbar .dashboard-period-controls .reseller-scope-filter,
  body .topbar .toolbar .parent-period-button {
    width: 100% !important;
  }

  body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid,
  body #operacao > .dashboard-command-center {
    grid-template-columns: 1fr !important;
  }

  body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid > .kpi:nth-child(7) {
    grid-column: auto !important;
  }

  body .panel-header,
  body .panel-head {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  body .panel-header .toolbar,
  body .movement-filter-bar,
  body .audit-toolbar {
    width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }
}

/* Mobile application shell v4 — structural responsive layer. */
.mobile-menu-toggle,
.mobile-nav-close,
.mobile-nav-backdrop {
  display: none;
}

@media (min-width: 769px) and (max-width: 1024px) {
  body .shell,
  body .shell.sidebar-expanded,
  body .shell.sidebar-collapsed {
    grid-template-columns: 70px minmax(0, 1fr) !important;
  }

  body .shell > aside {
    padding: 14px 7px !important;
  }

  body .shell > aside .brand {
    justify-content: center !important;
    padding-inline: 0 !important;
  }

  body .shell > aside .brand-text,
  body .shell > aside .nav-label {
    display: none !important;
  }

  body .shell > aside .nav-btn {
    justify-content: center !important;
    padding: 0 !important;
  }

  body .shell > main {
    padding-inline: 18px !important;
  }

  body .topbar {
    margin-inline: -18px !important;
    padding-inline: 18px !important;
  }

  body #operacao > .dashboard-insights,
  body .reseller-access-layout,
  body .vault-admin-layout,
  body #configuracoes > .grid {
    grid-template-columns: 1fr !important;
  }
}

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

  body.responsive-shell-v4.mobile-nav-open {
    overflow: hidden;
  }

  body.responsive-shell-v4 .shell,
  body.responsive-shell-v4 .shell.sidebar-expanded,
  body.responsive-shell-v4 .shell.sidebar-collapsed {
    display: block !important;
    min-width: 0 !important;
  }

  body.responsive-shell-v4 .shell > main {
    width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    padding: 0 12px 28px !important;
  }

  body.responsive-shell-v4 .shell > aside {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 1002 !important;
    display: flex !important;
    width: min(86vw, 300px) !important;
    height: 100dvh !important;
    padding: 16px 12px 24px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden auto !important;
    border: 0 !important;
    border-right: 1px solid var(--fx-line) !important;
    background: #07111c !important;
    box-shadow: 24px 0 70px rgba(0, 0, 0, .52) !important;
    transform: translateX(-105%);
    transition: transform .24s ease;
  }

  body.responsive-shell-v4.mobile-nav-open .shell > aside {
    transform: translateX(0);
  }

  body.responsive-shell-v4 .shell > aside .brand {
    display: flex !important;
    min-height: 60px !important;
    justify-content: flex-start !important;
    padding: 0 46px 12px 8px !important;
  }

  body.responsive-shell-v4 .shell > aside .brand-text,
  body.responsive-shell-v4 .shell > aside .nav-title,
  body.responsive-shell-v4 .shell > aside .nav-label {
    display: block !important;
  }

  body.responsive-shell-v4 .shell > aside .sidebar-toggle {
    display: none !important;
  }

  body.responsive-shell-v4 .shell > aside .nav-btn {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: auto !important;
    padding: 0 12px !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    justify-content: stretch !important;
    text-align: left !important;
  }

  body.responsive-shell-v4 .shell > aside .nav-btn.active::after {
    inset: 10px auto 10px 0 !important;
    width: 2px !important;
    height: auto !important;
  }

  .mobile-menu-toggle,
  .mobile-nav-close {
    display: inline-grid;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--fx-line);
    border-radius: 10px;
    background: #0b1826;
    color: #f4f7fb;
  }

  .mobile-menu-toggle {
    align-content: center;
    gap: 4px;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-nav-close {
    position: absolute;
    top: 14px;
    right: 12px;
    z-index: 2;
    font-size: 26px;
    line-height: 1;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1001;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(2, 7, 13, .72);
    backdrop-filter: blur(3px);
  }

  .mobile-nav-backdrop:not([hidden]) {
    display: block;
  }

  body .topbar {
    display: grid !important;
    margin: 0 -12px 16px !important;
    padding: 12px !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px 12px !important;
  }

  body .topbar > div:first-of-type {
    min-width: 0;
  }

  body .topbar h1 {
    font-size: clamp(22px, 7vw, 28px) !important;
  }

  body .topbar .toolbar {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body .topbar .toolbar-status,
  body .topbar .dashboard-period-controls,
  body .topbar .toolbar-actions {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body .topbar .toolbar-status > *,
  body .topbar .dashboard-period-controls > *,
  body .topbar .toolbar-actions > * {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
  }

  body .topbar .toolbar .period-quick {
    display: grid !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body .topbar .period-quick .seg {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid,
  body #operacao > .dashboard-insights,
  body #operacao > .dashboard-command-center,
  body .reseller-access-layout,
  body .vault-admin-layout,
  body #configuracoes > .grid {
    grid-template-columns: 1fr !important;
  }

  body .panel,
  body .card,
  body .kpi {
    min-width: 0 !important;
  }

  body .retention-row {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto !important;
  }

  body .panel-header,
  body .panel-head {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  body .panel-header .toolbar,
  body .movement-filter-bar,
  body .audit-toolbar,
  body .finance-toolbar,
  body .client-filter-bar,
  body .clients-pagination,
  body .modal-actions {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  body select,
  body textarea,
  body .control {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
  }

  body button,
  body .action-btn,
  body .icon-btn {
    min-height: 44px;
  }

  body .table-scroll,
  body .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
  }

  body .table-scroll table,
  body .table-wrap table {
    width: max-content !important;
    min-width: 720px !important;
  }

  body.responsive-shell-v4 #financeiro.view.active .panel-body.stack {
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.responsive-shell-v4 #financeiro.view.active .callout {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
  }

  body.responsive-shell-v4 #financeiro.view.active .panel-body.stack > table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
  }

  body .modal-backdrop {
    padding: 12px !important;
    align-items: center !important;
  }

  body .modal,
  body .loop-entry-modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    overflow: hidden auto !important;
  }

  body .modal-head,
  body .modal-actions,
  body .modal .panel-body {
    padding-inline: 16px !important;
  }

  body .modal-actions > * {
    width: 100% !important;
  }

  body svg,
  body canvas,
  body .dashboard-finance-chart,
  body .dashboard-chart-shell,
  body .chart-wrap {
    max-width: 100% !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  body .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid,
  body #operacao > .dashboard-command-center {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  body .auth-panel {
    width: calc(100vw - 24px) !important;
    padding: 22px 18px !important;
  }

  body .metric,
  body .kpi .metric {
    font-size: clamp(22px, 8vw, 30px) !important;
  }
}

/* Mobile premium v5 — app navigation, compact filters and touch-first density. */
.mobile-bottom-nav,
.mobile-filter-trigger,
.mobile-filter-sheet,
.mobile-sheet-backdrop {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --mobile-nav-height: 68px;
    --mobile-gutter: 12px;
    --mobile-radius: 14px;
  }

  body.mobile-premium-v5 {
    background-attachment: fixed;
  }

  body.mobile-premium-v5.mobile-nav-open,
  body.mobile-premium-v5.mobile-sheet-open {
    overflow: hidden;
    touch-action: none;
  }

  body.mobile-premium-v5 .shell > main {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 28px) !important;
  }

  body.mobile-premium-v5 .mobile-bottom-nav {
    position: fixed;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: 8px;
    z-index: 1000;
    display: grid;
    min-height: var(--mobile-nav-height);
    padding: 6px 5px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    border: 1px solid rgba(126, 151, 190, .22);
    border-radius: 18px;
    background: rgba(7, 17, 28, .94);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .035);
    backdrop-filter: blur(20px) saturate(135%);
  }

  body.mobile-premium-v5 .mobile-bottom-item {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 54px;
    padding: 5px 2px 4px;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #8290a8;
    box-shadow: none;
    transition: color .18s ease, background-color .18s ease, transform .16s ease;
    -webkit-tap-highlight-color: transparent;
  }

  body.mobile-premium-v5 .mobile-bottom-item svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  body.mobile-premium-v5 .mobile-bottom-item span {
    width: 100%;
    overflow: hidden;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-premium-v5 .mobile-bottom-item.active {
    background: linear-gradient(180deg, rgba(255, 79, 216, .14), rgba(139, 92, 246, .055));
    color: #ff72dc;
  }

  body.mobile-premium-v5 .mobile-bottom-item.active::after {
    position: absolute;
    right: 28%;
    bottom: 1px;
    left: 28%;
    height: 2px;
    border-radius: 999px;
    background: #ff4fd8;
    box-shadow: 0 0 10px rgba(255, 79, 216, .65);
    content: "";
  }

  body.mobile-premium-v5 .mobile-bottom-item:active,
  body.mobile-premium-v5 button:active,
  body.mobile-premium-v5 [role="button"]:active {
    transform: scale(.975);
  }

  body.mobile-premium-v5 .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    display: grid !important;
    margin: 0 -12px 14px !important;
    padding: 10px 12px 11px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
    border-bottom: 1px solid rgba(126, 151, 190, .14);
    background: rgba(5, 13, 22, .92) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    backdrop-filter: blur(18px) saturate(130%);
  }

  body.mobile-premium-v5 .topbar > div:first-of-type {
    grid-column: 1 !important;
  }

  body.mobile-premium-v5 .topbar h1 {
    font-size: 21px !important;
    line-height: 1.15 !important;
    letter-spacing: -.02em !important;
  }

  body.mobile-premium-v5 .topbar-subtitle {
    display: none !important;
  }

  body.mobile-premium-v5 .topbar .toolbar {
    display: grid !important;
    grid-column: 1 !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "filter actions" "status status" !important;
    gap: 8px !important;
  }

  body.mobile-premium-v5 .mobile-filter-trigger {
    grid-area: filter;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 5px 9px;
    grid-template-columns: 26px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(126, 151, 190, .22);
    border-radius: 12px;
    background: rgba(11, 24, 38, .84);
    color: #edf2fb;
    text-align: left;
    box-shadow: none;
  }

  body.mobile-premium-v5 .mobile-filter-trigger > svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #ff65d5;
    stroke-width: 1.8;
  }

  body.mobile-premium-v5 .mobile-filter-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
  }

  body.mobile-premium-v5 .mobile-filter-copy small {
    color: #7f8ca3;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.1;
    text-transform: uppercase;
  }

  body.mobile-premium-v5 .mobile-filter-copy strong {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-premium-v5 .mobile-filter-count {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff3fc8, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
  }

  body.mobile-premium-v5 .topbar .toolbar-actions {
    grid-area: actions;
    display: flex !important;
    width: auto !important;
    gap: 6px !important;
  }

  body.mobile-premium-v5 .topbar .toolbar-actions > * {
    width: 42px !important;
    min-width: 42px !important;
    min-height: 46px !important;
  }

  body.mobile-premium-v5 .topbar .toolbar-status {
    grid-area: status;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.mobile-premium-v5 .topbar .toolbar-status > * {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 7px 10px !important;
    overflow: hidden;
    font-size: 11px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-premium-v5 .mobile-nav-backdrop {
    transition: opacity .2s ease;
  }

  body.mobile-premium-v5 .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(1, 5, 10, .68);
    backdrop-filter: blur(4px);
  }

  body.mobile-premium-v5 .mobile-sheet-backdrop:not([hidden]) {
    display: block;
  }

  body.mobile-premium-v5 .mobile-filter-sheet {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1090;
    display: block;
    max-height: min(84dvh, 720px);
    padding: 7px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow: hidden auto;
    border: 1px solid rgba(126, 151, 190, .22);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, #0d1a29, #07111c);
    box-shadow: 0 -28px 70px rgba(0, 0, 0, .58);
    transform: translateY(105%);
    transition: transform .22s cubic-bezier(.2, .72, .24, 1);
    visibility: hidden;
  }

  body.mobile-premium-v5.mobile-sheet-open .mobile-filter-sheet {
    transform: translateY(0);
    visibility: visible;
  }

  body.mobile-premium-v5 .mobile-sheet-handle {
    width: 38px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: #3a4a60;
  }

  body.mobile-premium-v5 .mobile-sheet-head {
    display: flex;
    min-height: 52px;
    margin-bottom: 12px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(126, 151, 190, .14);
  }

  body.mobile-premium-v5 .mobile-sheet-head > div {
    display: grid;
    gap: 2px;
  }

  body.mobile-premium-v5 .mobile-sheet-head span {
    color: #ff65d5;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body.mobile-premium-v5 .mobile-sheet-head strong {
    font-size: 16px;
  }

  body.mobile-premium-v5 .mobile-sheet-close {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid rgba(126, 151, 190, .2);
    border-radius: 12px;
    background: #111f30;
    color: #eef2f8;
    font-size: 24px;
  }

  body.mobile-premium-v5 .mobile-sheet-body .dashboard-period-controls {
    display: grid !important;
    width: 100% !important;
    gap: 10px !important;
    grid-template-columns: 1fr !important;
  }

  body.mobile-premium-v5 .mobile-sheet-body .period-quick {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.mobile-premium-v5 .mobile-sheet-body .period-quick .seg,
  body.mobile-premium-v5 .mobile-sheet-body .parent-period-button,
  body.mobile-premium-v5 .mobile-sheet-body .reseller-scope-filter {
    width: 100% !important;
    min-height: 46px !important;
  }

  body.mobile-premium-v5 .mobile-sheet-body .parent-period-button svg {
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.mobile-premium-v5 .mobile-sheet-body .parent-period-picker {
    position: static !important;
    width: 100% !important;
    max-height: 56dvh !important;
    margin-top: 8px !important;
    overflow: auto !important;
    transform: none !important;
  }

  body.mobile-premium-v5 .view.active {
    animation: mobile-view-enter .18s ease-out both;
  }

  body.mobile-premium-v5 .panel,
  body.mobile-premium-v5 .card,
  body.mobile-premium-v5 .kpi {
    border-radius: var(--mobile-radius) !important;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .15) !important;
  }

  body.mobile-premium-v5 .panel-header,
  body.mobile-premium-v5 .panel-head {
    padding: 14px !important;
  }

  body.mobile-premium-v5 .panel-title {
    font-size: 15px !important;
  }

  body.mobile-premium-v5 .panel-note,
  body.mobile-premium-v5 .delta,
  body.mobile-premium-v5 .muted {
    font-size: 11px !important;
    line-height: 1.45 !important;
  }

  body.mobile-premium-v5 .panel-header .toolbar {
    display: flex !important;
    width: 100% !important;
    padding-bottom: 2px;
    gap: 8px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body.mobile-premium-v5 .panel-header .toolbar::-webkit-scrollbar {
    display: none;
  }

  body.mobile-premium-v5 .panel-header .toolbar > * {
    flex: 0 0 auto;
    width: auto !important;
    min-height: 42px !important;
  }

  body.mobile-premium-v5 .status,
  body.mobile-premium-v5 .badge,
  body.mobile-premium-v5 [class*="badge"] {
    border-radius: 999px !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
  }

  body.mobile-premium-v5 .finance-empty,
  body.mobile-premium-v5 .empty-state {
    min-height: 96px;
    padding: 26px 16px !important;
    align-content: center;
    border: 1px dashed rgba(126, 151, 190, .24);
    border-radius: 12px;
    background: rgba(9, 21, 34, .45);
    color: #91a0b8;
    line-height: 1.5;
    text-align: center;
  }

  body.mobile-premium-v5 .dashboard-finance-chart,
  body.mobile-premium-v5 .dashboard-chart-shell,
  body.mobile-premium-v5 .chart-wrap {
    min-height: 210px;
    contain: layout paint;
  }

  body.mobile-premium-v5 .modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  body.mobile-premium-v5 .modal-backdrop > .modal,
  body.mobile-premium-v5 .modal-backdrop > .loop-entry-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92dvh !important;
    margin: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    border-radius: 22px 22px 0 0 !important;
    animation: mobile-modal-enter .2s ease-out both;
  }

  body.mobile-premium-v5 .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    background: linear-gradient(180deg, rgba(7, 17, 28, .1), #07111c 24%);
  }
}

@media (min-width: 360px) and (max-width: 768px) {
  body.mobile-premium-v5 .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid,
  body.mobile-premium-v5 #operacao > .dashboard-command-center,
  body.mobile-premium-v5 #clientes > .kpi-grid,
  body.mobile-premium-v5 #funil > .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.mobile-premium-v5 .kpi {
    min-height: 118px !important;
    padding: 14px !important;
  }

  body.mobile-premium-v5 .kpi .metric {
    margin-top: 8px !important;
    font-size: clamp(20px, 6.3vw, 28px) !important;
  }

  body.mobile-premium-v5 .shell main #operacao.view.active > .dashboard-command-center {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.mobile-premium-v5 .shell main #operacao.view.active > .dashboard-command-center .dashboard-command-card {
    display: grid !important;
    min-height: 128px !important;
    padding: 14px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "label" "value" "note" !important;
    align-content: center !important;
    gap: 5px !important;
  }

  body.mobile-premium-v5 .shell main #operacao.view.active > .dashboard-command-center .dashboard-command-card > strong {
    justify-self: start !important;
    margin: 0 !important;
    max-width: 100% !important;
    text-align: left !important;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  body.mobile-premium-v5 table:has(> tbody#movementRows),
  body.mobile-premium-v5 table:has(> tbody#testRows),
  body.mobile-premium-v5 table:has(> tbody#clientRows),
  body.mobile-premium-v5 table:has(> tbody#approvalRows) {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.mobile-premium-v5 table:has(> tbody#movementRows) thead,
  body.mobile-premium-v5 table:has(> tbody#testRows) thead,
  body.mobile-premium-v5 table:has(> tbody#clientRows) thead,
  body.mobile-premium-v5 table:has(> tbody#approvalRows) thead {
    display: none !important;
  }

  body.mobile-premium-v5 tbody#movementRows,
  body.mobile-premium-v5 tbody#testRows,
  body.mobile-premium-v5 tbody#clientRows,
  body.mobile-premium-v5 tbody#approvalRows {
    display: grid !important;
    width: 100% !important;
    gap: 10px;
  }

  body.mobile-premium-v5 tbody#movementRows > tr,
  body.mobile-premium-v5 tbody#testRows > tr,
  body.mobile-premium-v5 tbody#clientRows > tr,
  body.mobile-premium-v5 tbody#approvalRows > tr {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 6px 12px;
    border: 1px solid rgba(126, 151, 190, .18);
    border-radius: 13px;
    background: rgba(8, 19, 31, .72);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .13);
  }

  body.mobile-premium-v5 tbody#movementRows > tr > td,
  body.mobile-premium-v5 tbody#testRows > tr > td,
  body.mobile-premium-v5 tbody#clientRows > tr > td,
  body.mobile-premium-v5 tbody#approvalRows > tr > td {
    display: grid !important;
    min-width: 0 !important;
    min-height: 38px;
    padding: 8px 0 !important;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(126, 151, 190, .11) !important;
    font-size: 12px !important;
    overflow-wrap: anywhere;
  }

  body.mobile-premium-v5 tbody#movementRows > tr > td:last-child,
  body.mobile-premium-v5 tbody#testRows > tr > td:last-child,
  body.mobile-premium-v5 tbody#clientRows > tr > td:last-child,
  body.mobile-premium-v5 tbody#approvalRows > tr > td:last-child {
    border-bottom: 0 !important;
  }

  body.mobile-premium-v5 td[data-label]::before {
    color: #7f8ca3;
    content: attr(data-label);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
  }

  body.mobile-premium-v5 tr:has(.finance-empty) {
    display: block !important;
    padding: 0 !important;
  }

  body.mobile-premium-v5 tr:has(.finance-empty) > td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body.mobile-premium-v5 .table-scroll,
  body.mobile-premium-v5 .table-wrap {
    overflow: visible !important;
  }
}

@media (max-width: 359px) {
  body.mobile-premium-v5 .mobile-bottom-item span {
    font-size: 8px;
  }

  body.mobile-premium-v5 .topbar .toolbar-status {
    grid-template-columns: 1fr !important;
  }

  body.mobile-premium-v5 .shell main #operacao.view.active > .dashboard-surface .dashboard-grid.kpi-grid,
  body.mobile-premium-v5 #clientes > .kpi-grid,
  body.mobile-premium-v5 #funil > .kpi-grid {
    grid-template-columns: 1fr !important;
  }

  body.mobile-premium-v5 .shell main #operacao.view.active > .dashboard-command-center {
    grid-template-columns: 1fr !important;
  }
}

@keyframes mobile-view-enter {
  from { opacity: .72; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes mobile-modal-enter {
  from { opacity: .7; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body.mobile-premium-v5 *,
  body.mobile-premium-v5 *::before,
  body.mobile-premium-v5 *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
