:root {
  --bg: #06111f;
  --bg-soft: #0b1730;
  --surface: rgba(10, 23, 45, 0.88);
  --surface-strong: rgba(11, 29, 56, 0.96);
  --surface-soft: rgba(18, 38, 70, 0.88);
  --line: rgba(115, 154, 222, 0.18);
  --line-strong: rgba(109, 171, 255, 0.34);
  --text: #edf4ff;
  --muted: #9db1d0;
  --primary: #24b8ff;
  --primary-2: #3478ff;
  --green: #22c55e;
  --red: #fb7185;
  --yellow: #f59e0b;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
  --glow: 0 0 0 1px rgba(67, 150, 255, 0.16), 0 10px 34px rgba(7, 17, 35, 0.46);
  --radius: 22px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(48, 120, 255, 0.2), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(36, 184, 255, 0.16), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(24, 64, 128, 0.22), transparent 32%),
    linear-gradient(135deg, #04101c 0%, #081425 48%, #0a1730 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0));
  opacity: 0.28;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

#app {
  min-height: 100vh;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(11, 29, 56, 0.96), rgba(8, 20, 38, 0.94));
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand.grande {
  margin-bottom: 26px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 12px 28px rgba(36, 184, 255, 0.3);
}

.brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: .01em;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}

.tab {
  flex: 1;
  border: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
}

.tab.ativo {
  color: #fff;
  background: linear-gradient(135deg, rgba(36, 184, 255, 0.2), rgba(52, 120, 255, 0.34));
  box-shadow: inset 0 0 0 1px rgba(102, 194, 255, 0.2);
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 13px 0 7px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 16, 31, 0.76);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input::placeholder {
  color: #7f93b6;
}

input:focus,
select:focus {
  border-color: rgba(75, 182, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(36, 184, 255, 0.12);
  background: rgba(7, 21, 40, 0.92);
}

select option {
  color: #0f172a;
}

button {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 16px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease, background .18s ease;
}

button:hover {
  opacity: 0.96;
}

button:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border-color: rgba(122, 205, 255, 0.2);
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.full {
  width: 100%;
  margin-top: 18px;
}

.erro {
  color: #ff8b9d;
  font-size: 13px;
  margin-top: 10px;
}

header {
  position: fixed;
  top: 24px;
  left: 292px;
  right: 24px;
  min-height: 78px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(7, 18, 34, 0.82);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  box-shadow: var(--glow);
  z-index: 40;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions select {
  min-width: 220px;
}

#btn-sair,
#btn-alterar-senha,
#btn-reset-senha-membro,
#btn-filtrar-despesas,
#btn-limpar-despesas,
#btn-filtrar-receitas,
#btn-limpar-receitas,
[data-close],
.modal-actions button:not(.btn-primary) {
  background: rgba(255,255,255,0.05);
  border-color: var(--line);
  color: var(--text);
}

nav {
  position: fixed;
  top: 24px;
  left: 24px;
  bottom: 24px;
  width: 244px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 96px 12px 14px;
  background: linear-gradient(180deg, rgba(9, 21, 40, 0.96), rgba(6, 16, 31, 0.94));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  z-index: 30;
}

nav::before {
  content: "Menu";
  position: absolute;
  top: 18px;
  left: 16px;
  right: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #d7e7ff;
  background: linear-gradient(135deg, rgba(36, 184, 255, 0.16), rgba(52, 120, 255, 0.12));
  border: 1px solid rgba(98, 179, 255, 0.2);
}

.nav-item {
  width: 100%;
  border-radius: 16px;
  background: transparent;
  padding: 14px 14px;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.03);
  color: #dceaff;
}

.nav-item.ativo {
  color: #fff;
  background: linear-gradient(135deg, rgba(36, 184, 255, 0.2), rgba(52, 120, 255, 0.22));
  border-color: rgba(100, 187, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(140, 210, 255, 0.08);
}

main {
  margin: 126px 24px 40px 292px;
  width: auto;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.page-title p {
  margin: 7px 0 0;
  color: var(--muted);
}

.page-title input {
  width: auto;
  min-width: 190px;
}

.section-label {
  color: #89a6d2;
  font-size: 13px;
  margin: 20px 0 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric,
.panel,
.table-wrap,
.receipt {
  background: linear-gradient(180deg, rgba(9, 23, 43, 0.92), rgba(8, 20, 38, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--glow);
}

.metric {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(36,184,255,0.18), transparent 60%);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.metric strong {
  font-size: clamp(26px, 2vw, 34px);
  letter-spacing: -0.04em;
}

.metric.entrada strong {
  color: #2fe38e;
}

.metric.saida strong {
  color: #ff7d91;
}

.metric.resultado strong {
  color: #8ad4ff;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.panel {
  padding: 20px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
}

th {
  color: #8ea6cb;
  background: rgba(255,255,255,0.02);
  font-weight: 600;
}

td {
  color: #eaf2ff;
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

.valor-positivo {
  color: #34e891;
  font-weight: 700;
}

.valor-negativo {
  color: #ff8598;
  font-weight: 700;
}

.link {
  color: #88d7ff;
  text-decoration: none;
  font-weight: 600;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.receipt {
  padding: 18px;
}

.receipt strong {
  display: block;
  margin-bottom: 6px;
}

.receipt small {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
}

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

.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline input,
.inline select,
.inline button {
  margin: 0;
}

.inline input[type=color] {
  max-width: 60px;
  min-width: 60px;
  padding: 6px;
}

.access-code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #8fd9ff;
}

.muted {
  color: var(--muted);
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 13px 0;
}

.item-row:first-child {
  margin-top: 12px;
}

.item-main strong,
.item-main small {
  display: block;
}

.item-main small {
  color: var(--muted);
  margin-top: 4px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 18, 0.7);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.modal.aberto {
  display: flex;
}

.modal-box {
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(10, 23, 43, 0.98), rgba(7, 18, 34, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-box h2 {
  margin-top: 0;
  margin-bottom: 14px;
}

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

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(8, 18, 33, 0.96);
  color: white;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(97, 170, 255, 0.2);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .2s;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.danger {
  color: #ff8397;
}

.status-dia {
  margin: 12px 0 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  border: 1px solid var(--line);
}

.status-dia.positivo {
  color: #76f0ae;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.24);
}

.status-dia.negativo {
  color: #ff9aaa;
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.2);
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.historico-panel,
.hoje-panel {
  margin-top: 18px;
}

.sem-sombra {
  box-shadow: none;
  background: transparent;
  border: 0;
}

.historico-table {
  min-width: 640px;
}

.resultado-chip {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.resultado-chip.positivo {
  background: rgba(34, 197, 94, 0.14);
  color: #6ef0a8;
}

.resultado-chip.negativo {
  background: rgba(251, 113, 133, 0.14);
  color: #ff9bad;
}

.resultado-chip.zero {
  background: rgba(148, 163, 184, 0.12);
  color: #c5d0e0;
}

.movimento {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.movimento:first-child {
  border-top: 0;
}

.movimento-info strong,
.movimento-info small {
  display: block;
}

.movimento-info small {
  color: var(--muted);
  margin-top: 3px;
}

.movimento-valor {
  font-weight: 800;
}

.movimento-valor.entrada {
  color: #34e891;
}

.movimento-valor.saida {
  color: #ff8598;
}

.filtros-lista {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filtros-lista input,
.filtros-lista button {
  min-height: 44px;
}

.filtros-lista input {
  width: auto;
  min-width: 160px;
}

.filtros-lista input:first-child {
  flex: 1;
  min-width: 240px;
}

.filtro-label {
  margin: 0;
}

.filtro-label input {
  display: block;
  margin-top: 5px;
}

.relatorio-bloco {
  margin-top: 18px;
}

.relatorio-cabecalho {
  margin-bottom: 18px;
}

.relatorio-cabecalho h2 {
  margin-bottom: 4px;
}

.relatorio-cabecalho p {
  margin-top: 0;
  color: var(--muted);
}

.acoes-tabela {
  display: flex;
  gap: 6px;
}

.btn-small {
  padding: 7px 10px;
  font-size: 12px;
}

canvas {
  max-width: 100%;
}

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .chart-grid,
  .config-grid {
    grid-template-columns: 1fr;
  }

  header {
    left: 260px;
  }

  nav {
    width: 212px;
  }

  main {
    margin-left: 260px;
  }
}

@media (max-width: 900px) {
  body::before {
    opacity: 0.18;
  }

  header {
    position: sticky;
    top: 12px;
    left: auto;
    right: auto;
    margin: 12px 12px 0;
    min-height: auto;
    border-radius: 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions > * {
    flex: 1 1 140px;
  }

  nav {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: 72px;
    min-height: 72px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    border-radius: 24px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  nav::before {
    display: none;
  }

  .nav-item {
    flex: 1 0 auto;
    min-width: 104px;
    text-align: center;
    padding: 11px 10px;
    border-radius: 14px;
    font-size: 13px;
  }

  main {
    margin: 18px 12px 104px;
  }

  .page-title {
    flex-direction: column;
    align-items: stretch;
  }

  .page-title input,
  .page-title button {
    width: 100%;
  }

  .inline > * {
    flex: 1 1 140px;
  }

  .metric strong {
    font-size: 28px;
  }

  .panel,
  .metric {
    padding: 16px;
  }

  .access-code {
    font-size: 28px;
    letter-spacing: .08em;
    word-break: break-word;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 94px;
  }
}

@media (max-width: 560px) {
  .auth-page {
    padding: 16px;
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .brand strong {
    font-size: 18px;
  }

  .page-title h1 {
    font-size: 28px;
  }

  .filtros-lista input:first-child,
  .filtros-lista input {
    min-width: 100%;
  }

  th,
  td {
    padding: 12px 10px;
    font-size: 13px;
  }

  .modal-box {
    padding: 20px 16px;
    border-radius: 20px;
  }
}

@media print {
  body {
    background: white;
    color: #111827;
  }

  body::before,
  header,
  nav,
  .no-print,
  #btn-imprimir-relatorio,
  .toast {
    display: none !important;
  }

  main {
    width: 100%;
    margin: 0;
  }

  .page {
    display: none !important;
  }

  #page-relatorio {
    display: block !important;
  }

  .panel,
  .metric,
  .table-wrap {
    box-shadow: none;
    background: #fff;
    border: 1px solid #dbe0e8;
    color: #111827;
  }

  th,
  td {
    color: #111827;
    border-color: #e5e7eb;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================================
   FLUXO V502 — DARK CYAN PREMIUM
   ========================================================= */

.sidebar-brand {
  position: fixed;
  top: 36px;
  left: 42px;
  width: 190px;
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.sidebar-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(24, 185, 255, .28));
}

.sidebar-brand strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.03em;
}

.sidebar-brand span {
  display: block;
  margin-top: 6px;
  color: #7e9dc7;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

header {
  left: 292px !important;
  min-height: 76px !important;
  background: linear-gradient(180deg, rgba(5, 17, 32, .94), rgba(7, 20, 38, .9)) !important;
  border-color: rgba(56, 151, 255, .18) !important;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.header-user-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #24d5ff;
  box-shadow: 0 0 18px rgba(36, 213, 255, .9);
}

.header-user strong,
.header-user small {
  display: block;
}

.header-user strong {
  font-size: 14px;
}

.header-user small {
  margin-top: 3px;
  color: #748eaf;
  font-size: 11px;
}

nav {
  padding-top: 112px !important;
  background:
    radial-gradient(circle at 40% 0%, rgba(22, 114, 204, .14), transparent 28%),
    linear-gradient(180deg, rgba(6, 18, 34, .98), rgba(5, 15, 29, .97)) !important;
  border-color: rgba(54, 140, 225, .16) !important;
}

nav::after {
  content: "MULTIEMPRESA  •  SEGURO  •  ONLINE";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  color: #496889;
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: .18em;
}

.nav-item {
  position: relative;
  padding-left: 42px !important;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.nav-item::before {
  position: absolute;
  left: 14px;
  width: 18px;
  text-align: center;
  color: #56cfff;
  opacity: .9;
}

.nav-item[data-page="dashboard"]::before { content: "⌂"; }
.nav-item[data-page="despesas"]::before { content: "↓"; }
.nav-item[data-page="receitas"]::before { content: "↑"; }
.nav-item[data-page="comprovantes"]::before { content: "▣"; }
.nav-item[data-page="relatorio"]::before { content: "▥"; }
.nav-item[data-page="config"]::before { content: "⚙"; }

.nav-item.ativo {
  background:
    linear-gradient(90deg, rgba(24, 160, 255, .22), rgba(27, 88, 166, .14)) !important;
  border-color: rgba(65, 178, 255, .25) !important;
  box-shadow: inset 3px 0 0 #27c8ff, 0 8px 28px rgba(0, 98, 190, .14) !important;
}

main {
  margin-top: 124px !important;
}

.page-title h1 {
  font-size: 30px !important;
  font-weight: 760;
}

.section-label {
  color: #6b8fba !important;
  letter-spacing: .18em !important;
  font-weight: 700;
}

.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.metric {
  min-height: 112px;
  padding: 18px 18px 20px !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 92% 86%, rgba(25, 163, 255, .18), transparent 28%),
    linear-gradient(145deg, rgba(6, 23, 43, .98), rgba(9, 29, 54, .94)) !important;
  border-color: rgba(45, 134, 221, .22) !important;
}

.metric::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #39cbff;
  box-shadow: 0 0 14px rgba(57, 203, 255, .75);
}

.metric span {
  padding-left: 16px;
  color: #8ca5c7 !important;
}

.metric strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(25px, 2vw, 33px) !important;
}

.metric.entrada::before { background:#1fe38c; box-shadow:0 0 14px rgba(31,227,140,.65); }
.metric.saida::before { background:#ff657b; box-shadow:0 0 14px rgba(255,101,123,.65); }
.metric.resultado::before { background:#44c8ff; }

.panel,
.table-wrap,
.receipt {
  border-radius: 18px !important;
  border-color: rgba(55, 136, 221, .18) !important;
  background:
    linear-gradient(180deg, rgba(7, 23, 44, .97), rgba(8, 22, 41, .97)) !important;
}

.panel {
  padding: 16px !important;
}

.chart-grid {
  grid-template-columns: minmax(0, 1.75fr) minmax(290px, .85fr) !important;
}

.chart-grid .panel {
  min-height: 330px;
}

.chart-grid canvas {
  max-height: 270px;
}

.status-dia {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 14px !important;
}

.historico-panel,
.hoje-panel {
  margin-top: 14px !important;
}

.historico-panel table {
  min-width: 620px;
}

.hoje-panel {
  max-height: 440px;
  overflow: auto;
}

.movimento {
  padding: 10px 0 !important;
}

.table-wrap,
.panel {
  box-shadow: 0 12px 44px rgba(0, 0, 0, .22) !important;
}

/* visual dos gráficos sobre fundo escuro */
canvas {
  filter: saturate(1.1) contrast(1.02);
}

/* mobile no estilo app */
@media (max-width: 900px) {
  .sidebar-brand {
    position: static;
    width: auto;
    margin-right: auto;
    pointer-events: auto;
  }

  .sidebar-logo {
    width: 42px;
    height: 42px;
  }

  .sidebar-brand strong { font-size: 20px; }
  .sidebar-brand span { display: none; }

  header {
    left: auto !important;
    right: auto !important;
    top: 8px !important;
    margin: 8px 10px 0 !important;
    padding: 12px !important;
  }

  .header-user {
    display: none;
  }

  .header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr auto auto auto;
  }

  .header-actions select {
    min-width: 0 !important;
  }

  #btn-empresa,
  #btn-alterar-senha,
  #btn-sair {
    white-space: nowrap;
    padding-inline: 11px;
  }

  main {
    margin: 18px 10px 98px !important;
  }

  nav {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    height: 72px !important;
    padding: 8px !important;
    border-radius: 22px !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(72px, 1fr));
    overflow-x: auto !important;
  }

  nav::after { display:none; }

  .nav-item {
    min-width: 72px !important;
    min-height: 54px;
    padding: 28px 6px 6px !important;
    justify-content: center;
    font-size: 10px !important;
    text-align: center !important;
  }

  .nav-item::before {
    left: 50% !important;
    top: 7px;
    transform: translateX(-50%);
    font-size: 18px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .metric {
    min-height: 108px;
    padding: 14px !important;
  }

  .metric span {
    font-size: 10px !important;
  }

  .metric strong {
    font-size: 20px !important;
    margin-top: 14px;
  }

  .chart-grid {
    grid-template-columns: 1fr !important;
  }

  .page-title h1 {
    font-size: 26px !important;
  }
}

@media (max-width: 620px) {
  .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  #empresa-select {
    grid-column: 1 / -1;
  }

  .cards {
    grid-template-columns: 1fr 1fr !important;
  }

  .metric strong {
    font-size: 18px !important;
  }

  .page-title p {
    font-size: 13px;
  }

  .chart-grid .panel {
    min-height: 280px;
  }

  .chart-grid canvas {
    max-height: 220px;
  }
}

.brand-app-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(36, 184, 255, .22);
}

/* =========================================================
   FLUXO V504 — FINAL LAYOUT OVERRIDES
   Corrige sobreposição, fundo em captura longa e proporções.
   ========================================================= */

html {
  min-height: 100%;
  background: #04101c !important;
}

body {
  min-height: 100%;
  background:
    radial-gradient(circle at 82% 8%, rgba(16, 126, 214, .16), transparent 30%),
    radial-gradient(circle at 14% 22%, rgba(21, 115, 220, .11), transparent 26%),
    linear-gradient(145deg, #04101c 0%, #061421 48%, #07182a 100%) !important;
  background-attachment: scroll !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
}

body::before {
  position: fixed;
}

#app {
  min-height: 100vh !important;
  background:
    radial-gradient(circle at 78% 4%, rgba(17, 142, 239, .12), transparent 28%),
    linear-gradient(180deg, rgba(4,16,28,.28), rgba(4,16,28,.12)) !important;
  padding-top: 1px;
}

/* Sidebar firme e limpa */
nav {
  top: 18px !important;
  left: 18px !important;
  bottom: 18px !important;
  width: 230px !important;
  padding: 104px 10px 54px !important;
  border-radius: 24px !important;
  overflow: hidden auto !important;
}

.sidebar-brand {
  top: 34px !important;
  left: 34px !important;
  width: 198px !important;
  gap: 11px !important;
}

.sidebar-logo {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px;
}

.sidebar-brand strong {
  font-size: 22px !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.sidebar-brand span {
  margin-top: 5px !important;
  font-size: 8px !important;
  letter-spacing: .13em !important;
  white-space: nowrap;
}

nav::after {
  left: 14px !important;
  right: 14px !important;
  bottom: 14px !important;
  font-size: 7px !important;
  letter-spacing: .13em !important;
}

.nav-item {
  min-height: 44px !important;
  border-radius: 13px !important;
  padding: 11px 10px 11px 40px !important;
  font-size: 13px !important;
}

/* Header fica isolado; não cobre mais o título */
header {
  position: fixed !important;
  top: 18px !important;
  left: 266px !important;
  right: 18px !important;
  min-height: 82px !important;
  padding: 12px 16px !important;
  border-radius: 22px !important;
  z-index: 50 !important;
}

.header-actions {
  display: grid !important;
  grid-template-columns: minmax(240px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px !important;
  width: min(680px, 72%);
  margin-left: auto;
}

.header-actions select {
  min-width: 0 !important;
}

.header-user {
  min-width: 154px !important;
}

/* Espaço real do dashboard começa abaixo do header */
main {
  width: auto !important;
  margin: 0 18px 40px 266px !important;
  padding-top: 126px !important;
}

.page-title {
  margin: 0 0 18px !important;
  min-height: 58px;
  align-items: flex-start !important;
}

.page-title h1 {
  margin: 0 !important;
  font-size: 28px !important;
  line-height: 1.05 !important;
}

.page-title p {
  margin-top: 7px !important;
}

.page-title > input,
.page-title > button {
  margin-top: 0;
}

.section-label {
  margin: 15px 0 9px !important;
}

/* Dashboard mais compacto como a referência */
.cards {
  gap: 12px !important;
}

.metric {
  min-height: 100px !important;
  padding: 15px 16px 17px !important;
}

.metric::before {
  left: 15px !important;
  top: 14px !important;
  width: 6px !important;
  height: 6px !important;
}

.metric span {
  padding-left: 14px !important;
  font-size: 11px !important;
}

.metric strong {
  margin-top: 16px !important;
  font-size: clamp(23px, 2vw, 30px) !important;
}

.status-dia {
  margin: 10px 0 0 !important;
  min-height: 38px !important;
  padding: 9px 12px !important;
  font-size: 12px;
}

.chart-grid {
  gap: 12px !important;
  margin-top: 12px !important;
  grid-template-columns: minmax(0, 1.8fr) minmax(270px, .85fr) !important;
}

.chart-grid .panel {
  min-height: 304px !important;
  height: 304px !important;
  overflow: hidden;
}

.chart-grid canvas {
  max-height: 245px !important;
}

.panel {
  padding: 14px !important;
}

.panel h3 {
  margin-bottom: 10px !important;
  font-size: 16px !important;
}

.historico-panel,
.hoje-panel {
  margin-top: 12px !important;
}

.hoje-panel {
  max-height: 390px !important;
  overflow: auto !important;
}

.movimento {
  padding: 9px 0 !important;
}

/* Evita qualquer faixa branca em conteúdo longo */
.page,
main,
#page-dashboard,
#page-despesas,
#page-receitas,
#page-comprovantes,
#page-relatorio,
#page-config {
  background: transparent !important;
}

/* Mobile: topo simples + navegação inferior */
@media (max-width: 900px) {
  #app {
    padding-top: 1px;
  }

  .sidebar-brand {
    position: static !important;
    width: auto !important;
    margin-right: auto;
  }

  .sidebar-logo {
    width: 38px !important;
    height: 38px !important;
  }

  .sidebar-brand strong {
    font-size: 19px !important;
  }

  header {
    position: sticky !important;
    top: 8px !important;
    left: auto !important;
    right: auto !important;
    margin: 8px 10px 0 !important;
    min-height: auto !important;
    padding: 10px !important;
  }

  header .sidebar-brand {
    display: flex;
  }

  .header-user {
    display: none !important;
  }

  .header-actions {
    width: 100% !important;
    grid-template-columns: 1fr auto auto !important;
  }

  #empresa-select {
    grid-column: 1 / -1;
  }

  main {
    margin: 0 10px 96px !important;
    padding-top: 18px !important;
  }

  nav {
    position: fixed !important;
    top: auto !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    height: 70px !important;
    padding: 7px !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(70px, 1fr)) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 22px !important;
  }

  .page-title {
    min-height: 0;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .chart-grid {
    grid-template-columns: 1fr !important;
  }

  .chart-grid .panel {
    height: auto !important;
    min-height: 300px !important;
  }
}

@media (max-width: 560px) {
  .header-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  #empresa-select {
    grid-column: 1 / -1;
  }

  #btn-empresa,
  #btn-alterar-senha,
  #btn-sair {
    font-size: 12px;
    padding: 9px 10px !important;
  }

  .cards {
    gap: 8px !important;
  }

  .metric {
    min-height: 96px !important;
    padding: 13px !important;
  }

  .metric strong {
    font-size: 18px !important;
  }

  .metric span {
    font-size: 10px !important;
  }

  .page-title h1 {
    font-size: 25px !important;
  }
}

/* =========================================================
   FLUXO V505 — LAYOUT ESTÁVEL
   Header no fluxo normal para nunca cobrir o conteúdo.
   Fundo sólido em toda a altura da página.
   ========================================================= */

html,
body {
  min-height: 100%;
  background-color: #04101c !important;
}

body {
  background-image:
    radial-gradient(circle at 82% 0%, rgba(19, 135, 224, .14), transparent 30%),
    radial-gradient(circle at 12% 18%, rgba(24, 105, 201, .10), transparent 28%),
    linear-gradient(145deg, #04101c 0%, #061421 48%, #07182a 100%) !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}

#app {
  min-height: 100vh !important;
  background: transparent !important;
  padding: 0 !important;
}

/* Sidebar desktop */
nav {
  position: fixed !important;
  top: 18px !important;
  left: 18px !important;
  bottom: 18px !important;
  width: 206px !important;
  height: auto !important;
  padding: 98px 10px 48px !important;
  border-radius: 24px !important;
}

.sidebar-brand {
  position: fixed !important;
  top: 31px !important;
  left: 31px !important;
  width: 180px !important;
  z-index: 70 !important;
  gap: 9px !important;
}

.sidebar-logo {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
}

.sidebar-brand strong {
  font-size: 21px !important;
}

.sidebar-brand span {
  font-size: 7px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  max-width: 116px !important;
}

nav::after {
  font-size: 6px !important;
  left: 10px !important;
  right: 10px !important;
  bottom: 12px !important;
}

/* O header fica no fluxo normal: não existe mais sobreposição. */
header {
  position: sticky !important;
  top: 12px !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  min-height: 76px !important;
  margin: 18px 18px 0 242px !important;
  padding: 12px 14px !important;
  border-radius: 20px !important;
  z-index: 50 !important;
}

.header-user {
  min-width: 140px !important;
  flex: 0 0 auto !important;
}

.header-actions {
  width: auto !important;
  max-width: none !important;
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}

.header-actions select {
  width: clamp(220px, 28vw, 360px) !important;
  min-width: 180px !important;
  flex: 0 1 360px !important;
}

.header-actions button {
  width: auto !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  min-height: 42px !important;
  padding: 10px 13px !important;
}

/* Conteúdo começa depois do header porque o header ocupa espaço real. */
main {
  width: auto !important;
  margin: 18px 18px 42px 242px !important;
  padding: 0 !important;
  min-height: calc(100vh - 120px) !important;
  background: transparent !important;
}

.page,
#page-dashboard,
#page-despesas,
#page-receitas,
#page-comprovantes,
#page-relatorio,
#page-config {
  background: transparent !important;
}

.page-title {
  min-height: 0 !important;
  margin: 0 0 18px !important;
}

.page-title h1 {
  margin: 0 !important;
  font-size: 28px !important;
  line-height: 1.08 !important;
}

.page-title p {
  margin: 6px 0 0 !important;
}

.cards {
  gap: 12px !important;
}

.metric {
  min-height: 98px !important;
}

.chart-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, .85fr) !important;
  gap: 12px !important;
}

.chart-grid .panel {
  height: 300px !important;
  min-height: 300px !important;
}

.chart-grid canvas {
  max-height: 238px !important;
}

.hoje-panel {
  max-height: 430px !important;
  overflow: auto !important;
}

/* Tablet: mantém desktop, mas deixa topo quebrar de forma controlada. */
@media (min-width: 821px) and (max-width: 1080px) {
  header {
    align-items: center !important;
  }

  .header-actions {
    flex-wrap: wrap !important;
    row-gap: 7px !important;
  }

  .header-actions select {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  header {
    min-height: 112px !important;
  }

  main {
    margin-top: 18px !important;
  }
}

/* Mobile real */
@media (max-width: 820px) {
  body {
    background-attachment: scroll !important;
  }

  .sidebar-brand {
    position: static !important;
    width: auto !important;
    margin-right: auto !important;
  }

  .sidebar-logo {
    width: 38px !important;
    height: 38px !important;
  }

  .sidebar-brand strong {
    font-size: 19px !important;
  }

  .sidebar-brand span {
    display: none !important;
  }

  header {
    position: sticky !important;
    top: 8px !important;
    margin: 8px 10px 0 !important;
    width: auto !important;
    min-height: auto !important;
    padding: 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  header .sidebar-brand {
    display: flex !important;
  }

  .header-user {
    display: none !important;
  }

  .header-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 7px !important;
  }

  .header-actions select {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .header-actions button {
    width: 100% !important;
    padding: 9px 7px !important;
    font-size: 12px !important;
  }

  main {
    margin: 16px 10px 96px !important;
    padding: 0 !important;
  }

  nav {
    position: fixed !important;
    top: auto !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    height: 70px !important;
    padding: 7px !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(70px, 1fr)) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 22px !important;
  }

  nav::after {
    display: none !important;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .chart-grid {
    grid-template-columns: 1fr !important;
  }

  .chart-grid .panel {
    height: auto !important;
    min-height: 280px !important;
  }

  .page-title {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

@media (max-width: 520px) {
  .cards {
    grid-template-columns: 1fr !important;
  }

  .metric strong {
    font-size: 24px !important;
  }
}

/* =====================================================
   FLUXO V506 — ACABAMENTO VISUAL FINAL
   Base estrutural preservada da v505.
   ===================================================== */

/* Marca mais limpa e legível */
.sidebar-brand {
  width: 186px !important;
  gap: 10px !important;
  align-items: center !important;
}

.sidebar-logo {
  width: 48px !important;
  height: 48px !important;
  flex: 0 0 48px !important;
  filter: drop-shadow(0 0 14px rgba(38, 190, 255, .28));
}

.sidebar-brand strong {
  font-size: 22px !important;
  line-height: 1 !important;
  letter-spacing: -.02em !important;
}

.sidebar-brand span {
  margin-top: 5px !important;
  max-width: 112px !important;
  font-size: 7.5px !important;
  line-height: 1.28 !important;
  letter-spacing: .13em !important;
  color: #7899c4 !important;
}

/* Navegação com aparência mais premium */
.nav-item {
  min-height: 44px !important;
  border-radius: 14px !important;
  transition: background .18s ease, border-color .18s ease, transform .18s ease !important;
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item.ativo {
  box-shadow:
    inset 3px 0 0 #25c7ff,
    inset 0 0 0 1px rgba(67, 181, 255, .16),
    0 8px 24px rgba(0, 90, 170, .12) !important;
}

/* Topo um pouco mais leve e alinhado */
header {
  border-color: rgba(75, 159, 239, .18) !important;
  background: linear-gradient(180deg, rgba(7, 21, 39, .96), rgba(6, 18, 34, .94)) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .22) !important;
}

.header-user strong {
  font-size: 14px !important;
}

.header-user small {
  color: #7591b8 !important;
}

/* Título e hierarquia */
.page-title h1 {
  font-size: 30px !important;
  letter-spacing: -.035em !important;
}

.page-title p {
  color: #89a2c5 !important;
}

.section-label {
  font-size: 11px !important;
  letter-spacing: .19em !important;
  color: #7898c4 !important;
}

/* Cards com acabamento mais próximo da referência */
.metric {
  min-height: 104px !important;
  padding: 18px 20px !important;
  border-color: rgba(68, 156, 245, .16) !important;
  background:
    radial-gradient(circle at 100% 100%, rgba(30, 157, 255, .16), transparent 32%),
    linear-gradient(145deg, rgba(8, 24, 44, .98), rgba(9, 28, 51, .96)) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .18) !important;
}

.metric:hover {
  transform: translateY(-1px);
  border-color: rgba(58, 180, 255, .28) !important;
}

.metric span {
  color: #7f9bbf !important;
  font-size: 11px !important;
  letter-spacing: .01em !important;
}

.metric strong {
  font-size: clamp(25px, 2.1vw, 34px) !important;
  letter-spacing: -.04em !important;
}

/* Painéis */
.panel,
.table-wrap,
.receipt {
  border-color: rgba(67, 148, 230, .15) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16) !important;
}

.panel h3 {
  font-size: 16px !important;
  letter-spacing: -.02em !important;
}

.chart-grid .panel {
  height: 292px !important;
  min-height: 292px !important;
}

.chart-grid canvas {
  max-height: 226px !important;
}

/* Histórico mais compacto */
.historico-panel {
  padding: 16px !important;
}

.historico-panel th,
.historico-panel td {
  padding-top: 11px !important;
  padding-bottom: 11px !important;
}

/* Remove a barra de rolagem interna feia das movimentações */
.hoje-panel {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

#movimento-hoje {
  max-height: none !important;
  overflow: visible !important;
}

.movimento {
  padding: 12px 0 !important;
}

.movimento-info strong {
  font-size: 13px !important;
}

.movimento-info small {
  font-size: 11px !important;
}

.movimento-valor {
  font-size: 13px !important;
}

/* Tabelas mais refinadas */
th {
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #7895bb !important;
}

td {
  font-size: 13px !important;
}

/* Inputs e botões */
input,
select {
  border-color: rgba(83, 144, 215, .18) !important;
  background: rgba(4, 15, 29, .72) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #25caff 0%, #2589ff 55%, #3767ff 100%) !important;
  box-shadow: 0 10px 24px rgba(28, 133, 255, .24) !important;
}

/* Desktop largo: aproveita melhor a tela sem esticar demais */
@media (min-width: 1450px) {
  main,
  header {
    max-width: 1500px !important;
    margin-right: auto !important;
  }
}

/* Mobile: cards em 2 colunas quando couber, sem apertar valores */
@media (max-width: 820px) {
  .sidebar-logo {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }

  .page-title h1 {
    font-size: 27px !important;
  }

  .metric {
    min-height: 96px !important;
    padding: 15px !important;
  }

  .metric strong {
    font-size: 22px !important;
  }

  .chart-grid .panel {
    min-height: 270px !important;
    height: auto !important;
  }

  .hoje-panel {
    overflow: visible !important;
  }
}

@media (max-width: 560px) {
  .cards {
    grid-template-columns: 1fr !important;
  }

  .metric strong {
    font-size: 26px !important;
  }
}

/* =====================================================
   FLUXO V507 — MARCA / PROPORÇÃO / LUZ
   Mantém a estrutura estável da v505/v506.
   ===================================================== */

/* remove rótulos artificiais que competiam com a marca */
nav::before,
nav::after {
  display: none !important;
  content: none !important;
}

/* marca simples: símbolo + nome, sem textos minúsculos espremidos */
.sidebar-brand {
  position: fixed !important;
  top: 32px !important;
  left: 34px !important;
  width: 158px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  z-index: 70 !important;
  overflow: visible !important;
}

.sidebar-logo {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px !important;
  object-fit: contain !important;
  filter: none !important;
}

.sidebar-brand strong {
  display: block !important;
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: -.03em !important;
  color: #f3f8ff !important;
  white-space: nowrap !important;
}

.sidebar-brand span {
  display: none !important;
}

/* sidebar com proporção mais limpa */
nav {
  width: 206px !important;
  padding: 94px 10px 20px !important;
}

.nav-item {
  min-height: 44px !important;
  padding: 11px 12px 11px 38px !important;
  font-size: 13.5px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

.nav-item::before {
  left: 14px !important;
  width: 16px !important;
  font-size: 13px !important;
  color: #58c9ff !important;
}

/* iluminação: difusa no fundo, sem 'farol' dentro dos cards */
body {
  background-image:
    radial-gradient(circle at 78% 5%, rgba(16, 105, 175, .10), transparent 34%),
    radial-gradient(circle at 15% 18%, rgba(18, 82, 150, .07), transparent 32%),
    linear-gradient(145deg, #04101c 0%, #061421 52%, #071728 100%) !important;
}

.metric::after {
  opacity: 0 !important;
  display: none !important;
}

.metric,
.panel,
.table-wrap,
.receipt {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.018),
    0 12px 32px rgba(0,0,0,.20) !important;
}

.metric {
  background: linear-gradient(180deg, rgba(8, 23, 43, .96), rgba(7, 19, 36, .96)) !important;
  border-color: rgba(80, 150, 222, .16) !important;
}

.btn-primary {
  box-shadow: 0 7px 18px rgba(27, 125, 232, .18) !important;
}

/* mantém cabeçalho visualmente proporcional à sidebar */
header {
  margin-left: 242px !important;
  min-height: 72px !important;
}

main {
  margin-left: 242px !important;
}

@media (max-width: 820px) {
  .sidebar-brand {
    position: static !important;
    width: auto !important;
    height: auto !important;
    gap: 8px !important;
  }

  .sidebar-logo {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
  }

  .sidebar-brand strong {
    font-size: 18px !important;
  }
}


/* =========================================================
   FLUXO V508 — acabamento final dos gráficos
   ========================================================= */

#grafico-dia,
#grafico-categorias {
  width: 100% !important;
  height: 255px !important;
  max-height: 255px !important;
}

.chart-grid .panel {
  min-height: 320px;
}

.chart-grid .panel:first-child {
  overflow: hidden;
}

@media (max-width: 900px) {
  #grafico-dia,
  #grafico-categorias {
    height: 235px !important;
    max-height: 235px !important;
  }

  .chart-grid .panel {
    min-height: 295px;
  }
}


/* FLUXO V509 — barras agrupadas finas */
#grafico-dia {
  height: 245px !important;
  max-height: 245px !important;
}

@media (max-width: 900px) {
  #grafico-dia {
    height: 225px !important;
    max-height: 225px !important;
  }
}

/* =========================================================
   FLUXO V511 - CORRECAO DO GRAFICO DE CATEGORIAS
   ========================================================= */

.chart-grid {
  align-items: stretch;
}

.chart-grid > .panel:nth-child(2) {
  min-height: 335px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chart-grid > .panel:nth-child(2) h3 {
  flex: 0 0 auto;
}

#grafico-categorias {
  display: block !important;
  width: 100% !important;
  height: 245px !important;
  max-height: 245px !important;
  margin: 0 auto !important;
}

@media (max-width: 900px) {
  .chart-grid > .panel:nth-child(2) {
    min-height: 310px;
  }

  #grafico-categorias {
    height: 225px !important;
    max-height: 225px !important;
  }
}


/* =========================================================
   FLUXO V512 — MOBILE REFINADO
   ========================================================= */

@media (max-width: 900px) {

  body {
    overflow-x: hidden;
  }

  #app {
    width: 100%;
  }

  header {
    position: sticky !important;
    top: 8px !important;
    left: auto !important;
    right: auto !important;
    margin: 8px 10px 0 !important;
    padding: 12px !important;
    border-radius: 18px !important;
    z-index: 50;
    background: rgba(7, 18, 34, 0.96);
    backdrop-filter: blur(14px);
  }

  header .brand {
    width: 100%;
  }

  header .brand-icon {
    width: 40px;
    height: 40px;
  }

  header .brand strong {
    font-size: 17px;
  }

  header .brand small {
    font-size: 11px;
  }

  .header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .header-actions select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .header-actions button {
    width: 100%;
    min-height: 42px;
  }

  #btn-sair {
    grid-column: 1 / -1;
  }

  nav {
    position: fixed !important;
    top: auto !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    height: 68px !important;
    min-height: 68px !important;
    padding: 8px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    border-radius: 22px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: rgba(7, 18, 34, 0.98);
    backdrop-filter: blur(14px);
    z-index: 60;
  }

  nav::before {
    display: none !important;
  }

  .nav-item {
    min-width: 98px;
    flex: 1 0 auto;
    text-align: center;
    font-size: 12px;
    padding: 10px 8px !important;
    border-radius: 14px !important;
  }

  main {
    margin: 16px 10px 96px !important;
    width: auto !important;
  }

  .page-title {
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-title h1 {
    font-size: 26px !important;
  }

  .page-title p {
    font-size: 13px;
    line-height: 1.45;
  }

  .page-title input,
  .page-title button {
    width: 100% !important;
  }

  .section-label {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 11px;
  }

  .cards {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .metric {
    min-height: 102px;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .metric span {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .metric strong {
    font-size: 20px !important;
    line-height: 1.1;
    word-break: break-word;
  }

  .cards .metric:nth-child(3) {
    grid-column: 1 / -1;
  }

  .status-dia {
    font-size: 12px;
    padding: 11px 12px;
    border-radius: 14px;
  }

  .chart-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-top: 14px;
  }

  .chart-grid .panel {
    min-height: auto !important;
  }

  .panel {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .panel h3 {
    font-size: 15px;
  }

  #grafico-dia {
    height: 220px !important;
    max-height: 220px !important;
  }

  #grafico-categorias {
    height: 220px !important;
    max-height: 220px !important;
  }

  .table-wrap {
    border-radius: 16px !important;
  }

  .historico-panel {
    overflow: hidden;
  }

  .historico-table {
    min-width: 620px;
  }

  th,
  td {
    padding: 11px 10px;
    font-size: 12px;
  }

  .movimento {
    gap: 10px;
    padding: 11px 0;
  }

  .movimento-info strong {
    font-size: 13px;
  }

  .movimento-info small {
    font-size: 11px;
  }

  .movimento-valor {
    font-size: 13px;
    white-space: nowrap;
  }

  .filtros-lista {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .filtros-lista input,
  .filtros-lista button,
  .filtros-lista label {
    width: 100% !important;
    min-width: 0 !important;
  }

  .filtros-lista input:first-child {
    grid-column: 1 / -1;
  }

  .receipt-grid {
    grid-template-columns: 1fr !important;
  }

  .config-grid {
    grid-template-columns: 1fr !important;
  }

  .inline {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .inline > * {
    width: 100% !important;
  }

  .modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-box {
    width: 100% !important;
    max-width: none !important;
    max-height: 90vh !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 20px 16px 24px !important;
  }

  .modal-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  .modal-actions button {
    width: 100%;
  }

  .toast {
    left: 10px !important;
    right: 10px !important;
    bottom: 90px !important;
  }
}

@media (max-width: 520px) {

  .cards {
    grid-template-columns: 1fr 1fr !important;
  }

  .metric strong {
    font-size: 18px !important;
  }

  .header-actions {
    grid-template-columns: 1fr;
  }

  .header-actions select,
  .header-actions button,
  #btn-sair {
    grid-column: 1 !important;
  }

  nav {
    justify-content: flex-start !important;
  }

  .nav-item {
    min-width: 92px;
  }

  .page-title h1 {
    font-size: 24px !important;
  }

  .filtros-lista {
    grid-template-columns: 1fr !important;
  }

  .filtros-lista input:first-child {
    grid-column: 1 !important;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   FLUXO V513 — MOBILE SEM BARRAS FIXAS
   ========================================================= */

@media (max-width: 900px) {

  /* TOPO ROLA JUNTO COM A TELA */
  header {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;

    width: auto !important;
    margin: 10px !important;

    z-index: auto !important;

    transform: none !important;
  }

  /* MENU TAMBÉM ROLA JUNTO */
  nav {
    position: static !important;

    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;

    width: auto !important;
    height: auto !important;
    min-height: 0 !important;

    margin: 8px 10px 0 !important;
    padding: 8px !important;

    display: flex !important;
    flex-direction: row !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    border-radius: 18px !important;

    z-index: auto !important;

    transform: none !important;
  }

  nav::before {
    display: none !important;
  }

  .nav-item {
    flex: 0 0 auto !important;
    min-width: 100px !important;
  }

  /* CONTEÚDO COMEÇA NORMALMENTE DEPOIS DO MENU */
  main {
    margin: 16px 10px 30px !important;
    padding-bottom: 20px !important;
  }

  /* REMOVE ESPAÇO QUE EXISTIA PARA MENU FIXO */
  body {
    padding-bottom: 0 !important;
  }

  #app {
    padding-bottom: 0 !important;
  }

  /* TOAST NÃO PRECISA MAIS SUBIR POR CAUSA DO MENU */
  .toast {
    bottom: 18px !important;
  }
}

@media (max-width: 520px) {

  header {
    margin: 8px !important;
  }

  nav {
    margin: 8px !important;
  }

  main {
    margin: 14px 8px 24px !important;
  }

}


/* =========================================================
   FLUXO V514 — MOBILE IPHONE / SEM ARRASTAR A TELA
   ========================================================= */

@media (max-width: 900px) {

  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
  }

  body {
    position: relative;
    touch-action: pan-y;
  }

  #app,
  main,
  .page,
  header,
  nav,
  .page-title,
  .cards,
  .chart-grid,
  .panel,
  .metric,
  .config-grid,
  .receipt-grid,
  .filtros-lista {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #app {
    overflow-x: hidden !important;
  }

  /* CABEÇALHO MOBILE */
  header {
    position: static !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
    padding: 12px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  header .brand {
    min-width: 0 !important;
  }

  .header-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .header-actions select {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0 !important;
  }

  .header-actions button {
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  #btn-sair {
    grid-column: 1 / -1;
  }

  /* MENU MOBILE SEM SCROLL HORIZONTAL */
  nav {
    position: static !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
    height: auto !important;
    padding: 8px !important;

    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;

    overflow: hidden !important;
    border-radius: 18px !important;
  }

  .nav-item {
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 4px !important;
    font-size: 11px !important;
    text-align: center !important;
    white-space: normal !important;
  }

  /* CONTEÚDO */
  main {
    margin: 14px 8px 28px !important;
    width: calc(100% - 16px) !important;
    overflow: visible !important;
  }

  .page-title {
    display: block !important;
  }

  .page-title h1 {
    font-size: 24px !important;
    line-height: 1.15 !important;
  }

  .page-title p {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  .page-title input,
  .page-title button {
    width: 100% !important;
    margin-top: 10px;
  }

  /* CARDS FINANCEIROS */
  .cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }

  .cards .metric:nth-child(3) {
    grid-column: auto !important;
  }

  .metric {
    width: 100% !important;
    min-height: 92px !important;
    padding: 14px !important;
  }

  .metric strong {
    font-size: clamp(21px, 7vw, 28px) !important;
    line-height: 1.1 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  /* GRÁFICOS */
  .chart-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .chart-grid > .panel {
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  #grafico-dia,
  #grafico-categorias {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 215px !important;
    max-height: 215px !important;
  }

  /* TABELAS:
     SOMENTE A TABELA PODE ROLAR PARA O LADO */
  .table-wrap,
  .sem-sombra {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  table,
  .historico-table {
    width: max-content !important;
    min-width: 650px !important;
  }

  /* MOVIMENTAÇÕES SEM ESTOURAR A TELA */
  .movimento {
    width: 100% !important;
    min-width: 0 !important;
  }

  .movimento-info {
    min-width: 0 !important;
    flex: 1 1 auto;
  }

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

  .movimento-valor {
    flex: 0 0 auto;
    font-size: 12px !important;
    text-align: right;
    max-width: 48%;
    white-space: normal !important;
  }

  /* FORMULÁRIOS */
  input,
  select,
  button {
    max-width: 100% !important;
  }

  .inline,
  .filtros-lista {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  .inline > *,
  .filtros-lista > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* IPHONE / TELAS PEQUENAS */
@media (max-width: 520px) {

  header {
    margin: 6px !important;
    width: calc(100% - 12px) !important;
  }

  main {
    margin: 12px 6px 24px !important;
    width: calc(100% - 12px) !important;
  }

  nav {
    margin: 6px !important;
    width: calc(100% - 12px) !important;
  }

  .header-actions {
    grid-template-columns: 1fr !important;
  }

  .header-actions select,
  .header-actions button,
  #btn-sair {
    grid-column: 1 !important;
  }

  .metric strong {
    font-size: 22px !important;
  }

  #grafico-dia,
  #grafico-categorias {
    height: 200px !important;
    max-height: 200px !important;
  }
}




/* FLUXO V515 MOBILE HERO */
@media (max-width: 900px) {

  header {
    position: static !important;
    margin: 10px 10px 12px !important;
    width: calc(100% - 20px) !important;
    padding: 14px !important;
    border-radius: 26px !important;
    background:
      radial-gradient(circle at top center, rgba(40,180,255,.18), transparent 45%),
      linear-gradient(180deg, rgba(8,20,43,.96), rgba(5,14,30,.98)) !important;
    border: 1px solid rgba(80,170,255,.18) !important;
    box-shadow:
      0 10px 30px rgba(0,0,0,.35),
      inset 0 1px 0 rgba(255,255,255,.04) !important;
    overflow: hidden !important;
  }

  header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 20% 0%, rgba(48,182,255,.10), transparent 30%),
      radial-gradient(circle at 80% 0%, rgba(35,120,255,.10), transparent 30%);
    pointer-events: none;
  }

  #mobile-brand-hero {
    position: relative;
    z-index: 2;
    margin-bottom: 14px;
    padding: 8px 4px 6px;
    text-align: center;
  }

  .mobile-brand-hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .mobile-brand-hero__logo-wrap {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      linear-gradient(135deg, rgba(52,204,255,.22), rgba(68,120,255,.10));
    border: 1px solid rgba(94,190,255,.30);
    box-shadow:
      0 0 0 1px rgba(255,255,255,.03) inset,
      0 12px 32px rgba(0,0,0,.28);
    backdrop-filter: blur(8px);
  }

  .mobile-brand-hero__logo {
    width: 38px !important;
    height: 38px !important;
    object-fit: contain;
    display: block;
  }

  .mobile-brand-hero__title {
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f4f8ff;
    text-shadow: 0 4px 18px rgba(0,0,0,.35);
  }

  .mobile-brand-hero__subtitle {
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(168,203,255,.78);
    font-weight: 600;
  }

  /* esconde a marca antiga pequena só no mobile */
  header .brand {
    display: none !important;
  }

  .header-actions {
    position: relative;
    z-index: 2;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .header-actions select,
  .header-actions button {
    width: 100% !important;
    min-width: 0 !important;
    height: 56px !important;
    border-radius: 18px !important;
    font-size: 16px !important;
  }

  .header-actions select {
    background: rgba(4,17,35,.92) !important;
    border: 1px solid rgba(87,163,255,.20) !important;
  }

  .header-actions button {
    border: 1px solid rgba(87,163,255,.14) !important;
    background: linear-gradient(180deg, rgba(20,33,58,.92), rgba(16,28,48,.96)) !important;
    color: #edf4ff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  }

  .header-actions button:first-of-type {
    background: linear-gradient(135deg, #3fd0ff 0%, #4476ff 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
    box-shadow: 0 10px 24px rgba(56,136,255,.28) !important;
  }

  nav {
    margin: 0 10px 12px !important;
    width: calc(100% - 20px) !important;
    border-radius: 24px !important;
    padding: 10px !important;
    background:
      linear-gradient(180deg, rgba(6,18,38,.96), rgba(5,16,32,.98)) !important;
    border: 1px solid rgba(80,170,255,.16) !important;
    box-shadow:
      0 10px 28px rgba(0,0,0,.28),
      inset 0 1px 0 rgba(255,255,255,.03) !important;
  }

  .nav-item {
    border-radius: 16px !important;
    min-height: 54px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    padding: 8px 6px !important;
  }

  .page-title h1 {
    font-size: 24px !important;
    line-height: 1.08 !important;
    margin-bottom: 8px !important;
  }

  .page-title p {
    font-size: 15px !important;
    line-height: 1.45 !important;
    color: rgba(214,230,255,.76) !important;
  }
}

@media (max-width: 520px) {
  .mobile-brand-hero__title {
    font-size: 28px;
  }

  .mobile-brand-hero__subtitle {
    font-size: 11px;
    letter-spacing: .16em;
  }
}


/* =========================================================
   FLUXO V516 — MOBILE HEADER PROFISSIONAL
   ========================================================= */

@media (max-width: 900px) {

  /* -----------------------------------------
     TOPO PRINCIPAL
     ----------------------------------------- */

  header {
    position: relative !important;
    margin:
      max(6px, env(safe-area-inset-top))
      8px
      8px !important;

    width: calc(100% - 16px) !important;

    padding: 12px 12px 14px !important;

    border-radius: 24px !important;

    background:
      radial-gradient(
        circle at 50% -20%,
        rgba(41, 173, 255, .14),
        transparent 48%
      ),
      linear-gradient(
        180deg,
        rgba(7, 20, 39, .98),
        rgba(5, 15, 31, .98)
      ) !important;

    border:
      1px solid rgba(74, 164, 255, .16) !important;

    overflow: visible !important;
  }


  /* marca antiga do header some */
  header > .brand {
    display: none !important;
  }


  /* -----------------------------------------
     MARCA CENTRAL
     ----------------------------------------- */

  #mobile-brand-hero {
    position: relative !important;

    margin: 0 !important;

    padding: 4px 52px 12px !important;

    text-align: center;
  }


  .mobile-brand-hero__inner {
    display: flex !important;
    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 3px !important;
  }


  .mobile-brand-hero__logo-wrap {
    width: auto !important;
    height: auto !important;

    padding: 0 !important;

    margin-bottom: 2px !important;

    border: 0 !important;
    background: transparent !important;

    box-shadow: none !important;
  }


  .mobile-brand-hero__logo {
    width: 44px !important;
    height: 44px !important;

    object-fit: contain;

    filter:
      drop-shadow(
        0 6px 15px rgba(25, 168, 255, .24)
      );
  }


  .mobile-brand-hero__title {
    font-size: 29px !important;
    line-height: 1 !important;

    font-weight: 800 !important;

    letter-spacing: -.04em !important;

    color: #f5f9ff !important;
  }


  .mobile-brand-hero__subtitle {
    margin-top: 5px !important;

    font-size: 10px !important;

    font-weight: 600 !important;

    letter-spacing: .20em !important;

    text-transform: uppercase !important;

    color:
      rgba(156, 196, 244, .72) !important;
  }


  /* -----------------------------------------
     AVATAR
     ----------------------------------------- */

  #mobile-user-menu {
    position: absolute;

    top: 13px;
    right: 13px;

    z-index: 90;
  }


  #mobile-user-trigger {
    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;

    padding: 0 !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;

    color: #fff !important;

    font-size: 15px !important;
    font-weight: 800 !important;

    background:
      linear-gradient(
        135deg,
        #20c5ff,
        #326cff
      ) !important;

    border:
      1px solid rgba(255,255,255,.16) !important;

    box-shadow:
      0 8px 22px rgba(27, 131, 255, .25) !important;
  }


  #mobile-user-trigger::after {
    display: none !important;
  }


  #mobile-user-dropdown {
    position: absolute;

    right: 0;
    top: 50px;

    width: 190px;

    padding: 7px;

    border-radius: 17px;

    background:
      rgba(7, 18, 35, .98);

    border:
      1px solid rgba(93, 162, 245, .22);

    box-shadow:
      0 18px 50px rgba(0,0,0,.45);

    backdrop-filter: blur(18px);
  }


  #mobile-user-dropdown.hidden {
    display: none !important;
  }


  .mobile-profile-name {
    padding: 9px 10px 10px;

    color: #f1f6ff;

    font-size: 13px;

    border-bottom:
      1px solid rgba(255,255,255,.07);
  }


  .mobile-profile-name small {
    display: block;

    margin-top: 2px;

    font-size: 10px;

    color: #7893ba;
  }


  #mobile-user-dropdown button {
    width: 100% !important;

    min-height: 42px !important;

    margin-top: 5px !important;

    padding: 10px 11px !important;

    text-align: left !important;

    border-radius: 11px !important;

    background:
      rgba(255,255,255,.035) !important;

    border:
      1px solid transparent !important;

    box-shadow: none !important;

    color: #dce8fa !important;

    font-size: 13px !important;
  }


  #mobile-user-dropdown button:last-child {
    color: #ff8799 !important;
  }


  /* -----------------------------------------
     EMPRESA
     ----------------------------------------- */

  .header-actions {
    display: block !important;

    width: 100% !important;
  }


  #empresa-select {
    width: 100% !important;
    height: 52px !important;

    min-width: 0 !important;

    padding: 0 15px !important;

    border-radius: 16px !important;

    background:
      rgba(3, 14, 30, .76) !important;

    border:
      1px solid rgba(91, 157, 239, .18) !important;

    color: #eef5ff !important;

    font-size: 15px !important;
  }


  /* esses botões foram movidos para outros lugares */
  .header-actions > #btn-empresa,
  .header-actions > #btn-alterar-senha,
  .header-actions > #btn-sair {
    display: none !important;
  }


  /* -----------------------------------------
     MENU MOBILE
     ----------------------------------------- */

  nav {
    display: grid !important;

    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;

    gap: 7px !important;

    margin: 0 8px 10px !important;

    width: calc(100% - 16px) !important;

    padding: 8px !important;

    border-radius: 22px !important;

    overflow: hidden !important;
  }


  .nav-item,
  #mobile-btn-empresa {
    min-width: 0 !important;
    width: 100% !important;

    min-height: 50px !important;

    padding: 7px 4px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;

    white-space: normal !important;

    border-radius: 14px !important;

    font-size: 11px !important;
    line-height: 1.15 !important;
  }


  #mobile-btn-empresa {
    color: #9edfff !important;

    background:
      rgba(25, 145, 255, .08) !important;

    border:
      1px dashed rgba(57, 177, 255, .27) !important;
  }


  /* conteúdo sobe um pouco */
  main {
    margin-top: 10px !important;
  }

}


@media (max-width: 420px) {

  .mobile-brand-hero__title {
    font-size: 27px !important;
  }

  .mobile-brand-hero__logo {
    width: 40px !important;
    height: 40px !important;
  }

  #mobile-user-trigger {
    width: 39px !important;
    height: 39px !important;

    min-width: 39px !important;
  }

}


/* =========================================================
   FLUXO V517 — MOBILE HEADER FINAL
   ========================================================= */

@media (max-width: 900px) {

  /* cabeçalho: só marca + avatar */
  header {
    position: relative !important;
    display: block !important;

    margin:
      max(4px, env(safe-area-inset-top))
      8px
      8px !important;

    width: calc(100% - 16px) !important;

    padding: 14px 56px 16px !important;

    border-radius: 24px !important;

    background:
      radial-gradient(
        circle at 50% 0%,
        rgba(43, 182, 255, .14),
        transparent 50%
      ),
      linear-gradient(
        180deg,
        rgba(7, 20, 40, .98),
        rgba(5, 15, 30, .98)
      ) !important;

    border:
      1px solid rgba(75, 167, 255, .16) !important;

    box-shadow:
      0 12px 34px rgba(0,0,0,.28),
      inset 0 1px 0 rgba(255,255,255,.035) !important;

    overflow: visible !important;
  }


  /* Fluxo antigo desaparece */
  header > .brand {
    display: none !important;
  }


  /* ações antigas também desaparecem */
  header > .header-actions {
    display: none !important;
  }


  /* marca principal */
  #mobile-brand-hero {
    display: block !important;

    margin: 0 !important;
    padding: 2px 0 0 !important;

    text-align: center !important;
  }


  .mobile-brand-hero__inner {
    display: flex !important;

    flex-direction: row !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 11px !important;
  }


  .mobile-brand-hero__logo-wrap {
    display: flex !important;

    width: auto !important;
    height: auto !important;

    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;

    background: transparent !important;
    border: 0 !important;

    box-shadow: none !important;
  }


  .mobile-brand-hero__logo {
    width: 43px !important;
    height: 43px !important;

    display: block !important;

    object-fit: contain !important;

    filter:
      drop-shadow(
        0 5px 13px rgba(27, 167, 255, .22)
      );
  }


  .mobile-brand-copy {
    display: flex;

    flex-direction: column;

    align-items: flex-start;

    text-align: left;
  }


  .mobile-brand-hero__title {
    margin: 0 !important;

    font-size: 27px !important;
    line-height: .95 !important;

    font-weight: 800 !important;

    letter-spacing: -.045em !important;

    color: #f4f8ff !important;
  }


  .mobile-brand-hero__subtitle {
    margin-top: 6px !important;

    font-size: 8px !important;

    line-height: 1 !important;

    font-weight: 600 !important;

    letter-spacing: .20em !important;

    text-transform: uppercase !important;

    color:
      rgba(156, 199, 250, .68) !important;
  }


  /* avatar */
  #mobile-user-menu-v517 {
    position: absolute;

    top: 50%;
    right: 12px;

    transform: translateY(-50%);

    z-index: 500;
  }


  #mobile-user-trigger-v517 {
    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;

    padding: 0 !important;

    border-radius: 50% !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    font-size: 15px !important;

    font-weight: 800 !important;

    color: white !important;

    background:
      linear-gradient(
        135deg,
        #26c6ff 0%,
        #3472ff 100%
      ) !important;

    border:
      1px solid rgba(255,255,255,.16) !important;

    box-shadow:
      0 8px 24px rgba(28, 134, 255, .28) !important;
  }


  /* menu dropdown */
  #mobile-user-dropdown-v517 {
    position: absolute;

    top: 51px;
    right: 0;

    width: min(285px, calc(100vw - 28px));

    padding: 8px;

    border-radius: 20px;

    background:
      rgba(6, 17, 33, .985);

    border:
      1px solid rgba(85, 161, 250, .22);

    box-shadow:
      0 22px 55px rgba(0,0,0,.52);

    backdrop-filter: blur(20px);

    overflow: hidden;
  }


  #mobile-user-dropdown-v517.hidden {
    display: none !important;
  }


  .mobile-user-header-v517 {
    padding: 10px 11px 12px;

    border-bottom:
      1px solid rgba(255,255,255,.07);
  }


  .mobile-user-header-v517 strong {
    display: block;

    color: #f5f8ff;

    font-size: 14px;
  }


  .mobile-user-header-v517 small {
    display: block;

    margin-top: 3px;

    color: #7793bb;

    font-size: 10px;
  }


  .mobile-menu-section-v517 {
    padding: 9px 6px 4px;
  }


  .mobile-menu-label-v517 {
    padding: 3px 6px 7px;

    color: #607fa7;

    font-size: 9px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .15em;
  }


  #mobile-user-dropdown-v517 button {
    width: 100% !important;

    min-height: 42px !important;

    margin: 2px 0 !important;

    padding: 10px 10px !important;

    display: flex !important;

    align-items: center !important;

    text-align: left !important;

    border-radius: 12px !important;

    color: #dce9fa !important;

    background:
      rgba(255,255,255,.025) !important;

    border:
      1px solid transparent !important;

    box-shadow: none !important;

    font-size: 13px !important;
  }


  #mobile-user-dropdown-v517 button:active {
    background:
      rgba(65, 158, 255, .10) !important;
  }


  .mobile-company-current-v517 {
    padding: 10px;

    margin: 1px 0 5px;

    border-radius: 12px;

    background:
      rgba(38, 135, 255, .065);

    border:
      1px solid rgba(69, 157, 255, .12);
  }


  .mobile-company-current-v517 small {
    display: block;

    color: #6583aa;

    font-size: 9px;

    text-transform: uppercase;

    letter-spacing: .12em;
  }


  .mobile-company-current-v517 strong {
    display: block;

    margin-top: 4px;

    color: #edf5ff;

    font-size: 13px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
  }


  #mobile-company-switch-v517 {
    color: #91d8ff !important;
  }


  #mobile-company-new-v517 {
    color: #75ddff !important;
  }


  #mobile-logout-v517 {
    margin-top: 7px !important;

    color: #ff8699 !important;

    border-top:
      1px solid rgba(255,255,255,.055) !important;
  }


  /* navegação volta a conter só páginas reais */
  nav {
    margin-top: 0 !important;
  }


  /* botão empresa criado pela V516 não aparece mais */
  #mobile-btn-empresa {
    display: none !important;
  }


  main {
    margin-top: 10px !important;
  }

}


@media (max-width: 390px) {

  header {
    padding-left: 48px !important;
    padding-right: 52px !important;
  }

  .mobile-brand-hero__logo {
    width: 38px !important;
    height: 38px !important;
  }

  .mobile-brand-hero__title {
    font-size: 24px !important;
  }

  .mobile-brand-hero__subtitle {
    font-size: 7px !important;
  }

  #mobile-user-trigger-v517 {
    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;
  }

}


/* =========================================================
   FLUXO V518 — MOBILE LIMPEZA DO TOPO + MENU AVATAR
   ========================================================= */

@media (max-width: 900px) {

  /* =========================================
     REMOVE DEFINITIVAMENTE A MARCA ANTIGA
     ========================================= */

  header > .brand,
  header .brand:not(#mobile-brand-hero),
  header > .brand:first-child {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }


  /* =========================================
     HEADER FICA ACIMA DA NAVEGAÇÃO
     ========================================= */

  header {
    position: relative !important;

    z-index: 5000 !important;

    overflow: visible !important;

    isolation: auto !important;
  }


  /* =========================================
     MANTÉM SOMENTE O BLOCO BONITO
     FLUXO / FINANÇAS EM MOVIMENTO
     ========================================= */

  #mobile-brand-hero {
    display: block !important;

    position: relative !important;

    z-index: 2 !important;

    visibility: visible !important;

    height: auto !important;

    margin: 0 !important;
  }


  #mobile-brand-hero .mobile-brand-hero__inner {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;
  }


  /* =========================================
     AVATAR
     ========================================= */

  #mobile-user-menu,
  #mobile-user-menu-v517 {
    position: absolute !important;

    z-index: 10000 !important;
  }


  #mobile-user-dropdown,
  #mobile-user-dropdown-v517 {
    position: absolute !important;

    z-index: 20000 !important;

    overflow: visible !important;
  }


  /* =========================================
     BARRA RESUMO / DESPESAS...
     SEMPRE ATRÁS DO MENU DO AVATAR
     ========================================= */

  nav {
    position: relative !important;

    z-index: 10 !important;
  }


  .nav-item {
    position: relative !important;

    z-index: 1 !important;
  }


  /* =========================================
     CONTEÚDO TAMBÉM FICA ATRÁS
     ========================================= */

  main,
  .page,
  .page-title,
  .cards,
  .panel {
    position: relative;

    z-index: 1;
  }

}



/* FLUXO_V519_MOBILE_BRAND_START */
@media (max-width: 900px) {

  html, body {
    overflow-x: hidden !important;
  }

  /* remove a marca antiga duplicada do topo */
  .mobile-top-brand,
  .top-brand,
  .header-brand-top,
  .brand-top,
  header > .brand,
  header > .logo-area,
  header > .app-brand:first-child,
  header .brand-duplicate,
  header .mobile-header-brand-old {
    display: none !important;
  }

  header,
  .app-header,
  .topbar {
    overflow: visible !important;
  }

  #mobile-brand-hero {
    display: block !important;
    margin: 10px 10px 18px !important;
    padding: 0 !important;
    border-radius: 28px !important;
    border: 1px solid rgba(68, 149, 255, 0.28) !important;
    background:
      radial-gradient(circle at 20% 20%, rgba(37, 160, 255, 0.18), transparent 32%),
      radial-gradient(circle at 85% 30%, rgba(80, 140, 255, 0.14), transparent 28%),
      linear-gradient(180deg, rgba(8, 19, 45, 0.94), rgba(4, 14, 36, 0.98)) !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.04),
      0 12px 34px rgba(0,0,0,0.32) !important;
    overflow: hidden !important;
    position: relative !important;
  }

  #mobile-brand-hero .mobile-brand-hero__inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    padding: 18px 18px !important;
    min-height: 118px !important;
  }

  .mobile-brand-hero__brand {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .mobile-brand-hero__logo-wrap {
    width: 62px !important;
    height: 62px !important;
    border-radius: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background:
      radial-gradient(circle at 30% 30%, rgba(73, 202, 255, 0.28), transparent 55%),
      linear-gradient(135deg, rgba(13, 42, 88, 0.96), rgba(8, 23, 54, 0.96)) !important;
    border: 1px solid rgba(95, 186, 255, 0.25) !important;
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.02) inset,
      0 0 24px rgba(55, 164, 255, 0.18) !important;
    flex: 0 0 62px !important;
  }

  .mobile-brand-hero__logo {
    width: 42px !important;
    height: 42px !important;
    object-fit: contain !important;
    display: block !important;
    filter: drop-shadow(0 0 12px rgba(56, 174, 255, 0.28)) !important;
  }

  .mobile-brand-hero__wordmark {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .mobile-brand-hero__name {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 30px !important;
    line-height: 0.95 !important;
    font-weight: 900 !important;
    letter-spacing: -0.04em !important;
    color: #f7fbff !important;
    text-shadow: 0 2px 16px rgba(34, 146, 255, 0.18) !important;
    white-space: nowrap !important;
  }

  .mobile-brand-hero__tag {
    margin-top: 6px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.30em !important;
    color: #87bfff !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  #mobile-brand-hero #mobile-user-menu,
  #mobile-brand-hero #mobile-user-menu-v517,
  #mobile-brand-hero .mobile-user-menu,
  #mobile-brand-hero .user-menu-trigger,
  #mobile-brand-hero .avatar-trigger {
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 40 !important;
  }

  #mobile-brand-hero #mobile-user-dropdown,
  #mobile-brand-hero #mobile-user-dropdown-v517,
  #mobile-brand-hero .mobile-user-dropdown,
  #mobile-brand-hero .user-dropdown {
    z-index: 9999 !important;
  }
}

@media (max-width: 520px) {
  #mobile-brand-hero .mobile-brand-hero__inner {
    padding: 16px 16px !important;
    min-height: 108px !important;
  }

  .mobile-brand-hero__logo-wrap {
    width: 54px !important;
    height: 54px !important;
    flex-basis: 54px !important;
  }

  .mobile-brand-hero__logo {
    width: 36px !important;
    height: 36px !important;
  }

  .mobile-brand-hero__name {
    font-size: 24px !important;
  }

  .mobile-brand-hero__tag {
    font-size: 10px !important;
    letter-spacing: 0.24em !important;
  }
}
/* FLUXO_V519_MOBILE_BRAND_END */

/* =========================================================
   FLUXO V520 — MARCA MOBILE LIMPA
   ========================================================= */

@media (max-width: 900px) {

  /* ESTE É O FLUXO ANTIGO QUE ESTÁ NO CANTO SUPERIOR */
  .sidebar-brand {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }


  /* CABEÇALHO */
  header {
    position: relative !important;

    display: block !important;

    width: calc(100% - 16px) !important;

    margin:
      max(6px, env(safe-area-inset-top))
      8px 10px !important;

    padding: 0 !important;

    border-radius: 26px !important;

    overflow: visible !important;

    z-index: 5000 !important;

    background:
      radial-gradient(
        circle at 28% 10%,
        rgba(34, 177, 255, .12),
        transparent 38%
      ),
      linear-gradient(
        160deg,
        rgba(8, 23, 48, .98),
        rgba(4, 14, 31, .99)
      ) !important;

    border:
      1px solid rgba(71, 156, 255, .20) !important;

    box-shadow:
      0 16px 40px rgba(0,0,0,.30),
      inset 0 1px 0 rgba(255,255,255,.035) !important;
  }


  /* qualquer marca antiga dentro do header */
  header > .brand,
  header > .header-user,
  header > .header-actions {
    display: none !important;
  }


  /* ÚNICA MARCA MOBILE */
  #mobile-brand-hero {
    display: flex !important;

    align-items: center !important;

    justify-content: space-between !important;

    width: 100% !important;

    min-height: 108px !important;

    margin: 0 !important;

    padding: 18px 18px !important;

    border: 0 !important;

    border-radius: 26px !important;

    background: transparent !important;

    box-shadow: none !important;

    overflow: visible !important;

    position: relative !important;
  }


  .v520-brand {
    display: flex !important;

    align-items: center !important;

    gap: 13px !important;

    min-width: 0 !important;

    flex: 1 1 auto !important;
  }


  .v520-brand-logo {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 54px !important;
    height: 54px !important;

    flex: 0 0 54px !important;

    border-radius: 16px !important;

    background:
      linear-gradient(
        145deg,
        rgba(18, 68, 119, .38),
        rgba(7, 24, 52, .22)
      ) !important;

    border:
      1px solid rgba(72, 178, 255, .22) !important;

    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.04),
      0 8px 25px rgba(12, 123, 225, .12) !important;
  }


  .v520-brand-logo img {
    display: block !important;

    width: 38px !important;
    height: 38px !important;

    object-fit: contain !important;

    filter:
      drop-shadow(
        0 5px 12px rgba(32, 183, 255, .26)
      );
  }


  .v520-brand-copy {
    min-width: 0 !important;

    display: flex !important;

    flex-direction: column !important;

    justify-content: center !important;
  }


  .v520-brand-name {
    color: #f5f9ff !important;

    font-size: 27px !important;

    line-height: .95 !important;

    font-weight: 850 !important;

    letter-spacing: -.045em !important;

    white-space: nowrap !important;
  }


  .v520-brand-tagline {
    margin-top: 7px !important;

    color:
      rgba(135, 190, 247, .78) !important;

    font-size: 8px !important;

    line-height: 1 !important;

    font-weight: 650 !important;

    letter-spacing: .23em !important;

    text-transform: uppercase !important;

    white-space: nowrap !important;
  }


  /* AVATAR */
  #mobile-user-menu-v517,
  #mobile-user-menu {
    position: relative !important;

    top: auto !important;
    right: auto !important;

    transform: none !important;

    flex: 0 0 auto !important;

    margin-left: 10px !important;

    z-index: 20000 !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 44px !important;
    height: 44px !important;

    min-width: 44px !important;

    border-radius: 50% !important;
  }


  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    position: absolute !important;

    top: 52px !important;
    right: 0 !important;

    z-index: 30000 !important;
  }


  /* barra de navegação sempre atrás do avatar */
  nav {
    position: relative !important;

    z-index: 10 !important;
  }

}


@media (max-width: 390px) {

  #mobile-brand-hero {
    padding: 15px 14px !important;
  }

  .v520-brand {
    gap: 10px !important;
  }

  .v520-brand-logo {
    width: 48px !important;
    height: 48px !important;

    flex-basis: 48px !important;
  }

  .v520-brand-logo img {
    width: 34px !important;
    height: 34px !important;
  }

  .v520-brand-name {
    font-size: 24px !important;
  }

  .v520-brand-tagline {
    font-size: 7px !important;
    letter-spacing: .19em !important;
  }

}


/* =========================================================
   FLUXO V521 — MOBILE COMPACTO PREMIUM
   ========================================================= */

@media (max-width: 900px) {

  /* remove definitivamente qualquer marca velha */
  .sidebar-brand,
  header > .brand,
  header > .header-actions {
    display: none !important;
  }

  html,
  body,
  #app {
    overflow-x: hidden !important;
  }

  /* HEADER COMPACTO */
  header {
    position: relative !important;

    width: calc(100% - 16px) !important;

    margin:
      max(6px, env(safe-area-inset-top))
      8px 8px !important;

    padding: 0 !important;

    border-radius: 20px !important;

    background:
      linear-gradient(
        145deg,
        rgba(7, 22, 44, .98),
        rgba(4, 15, 31, .99)
      ) !important;

    border:
      1px solid rgba(65, 154, 255, .17) !important;

    box-shadow:
      0 10px 28px rgba(0,0,0,.25) !important;

    overflow: visible !important;

    z-index: 5000 !important;
  }


  /* HERO */
  #mobile-brand-hero {
    display: flex !important;

    align-items: center !important;
    justify-content: space-between !important;

    width: 100% !important;

    min-height: 76px !important;

    margin: 0 !important;

    padding: 11px 12px !important;

    border: 0 !important;
    border-radius: 20px !important;

    background: transparent !important;
    box-shadow: none !important;

    overflow: visible !important;
  }


  /* MARCA */
  .v520-brand {
    display: flex !important;

    align-items: center !important;

    gap: 10px !important;

    min-width: 0 !important;

    flex: 1 1 auto !important;
  }


  .v520-brand-logo {
    width: 46px !important;
    height: 46px !important;

    flex: 0 0 46px !important;

    border-radius: 14px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    background:
      linear-gradient(
        145deg,
        rgba(21, 75, 129, .30),
        rgba(6, 23, 50, .35)
      ) !important;

    border:
      1px solid rgba(70, 170, 255, .18) !important;

    box-shadow:
      0 7px 20px rgba(24, 135, 255, .10) !important;
  }


  .v520-brand-logo img {
    width: 32px !important;
    height: 32px !important;

    object-fit: contain !important;
  }


  .v520-brand-copy {
    min-width: 0 !important;
  }


  .v520-brand-name {
    font-size: 22px !important;

    line-height: 1 !important;

    font-weight: 800 !important;

    letter-spacing: -.035em !important;

    color: #f6f9ff !important;
  }


  .v520-brand-tagline {
    margin-top: 5px !important;

    font-size: 7px !important;

    line-height: 1 !important;

    letter-spacing: .19em !important;

    color:
      rgba(137, 188, 243, .75) !important;

    text-transform: uppercase !important;
  }


  /* AVATAR */
  #mobile-user-menu-v517,
  #mobile-user-menu {
    position: relative !important;

    top: auto !important;
    right: auto !important;

    transform: none !important;

    margin-left: 8px !important;

    flex: 0 0 auto !important;

    z-index: 30000 !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;

    padding: 0 !important;

    border-radius: 50% !important;

    font-size: 14px !important;

    font-weight: 800 !important;
  }


  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    top: 47px !important;
    right: 0 !important;

    z-index: 50000 !important;
  }


  /* MENU PRINCIPAL MAIS COMPACTO */
  nav {
    display: grid !important;

    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;

    gap: 5px !important;

    width: calc(100% - 16px) !important;

    margin: 0 8px 10px !important;

    padding: 6px !important;

    border-radius: 18px !important;

    background:
      rgba(5, 17, 34, .94) !important;

    border:
      1px solid rgba(65, 154, 255, .13) !important;

    box-shadow:
      0 8px 24px rgba(0,0,0,.20) !important;

    z-index: 10 !important;
  }


  .nav-item {
    min-width: 0 !important;

    min-height: 42px !important;

    padding: 6px 4px !important;

    border-radius: 12px !important;

    font-size: 10px !important;

    line-height: 1.1 !important;

    white-space: normal !important;
  }


  .nav-item.ativo {
    box-shadow:
      inset 0 0 0 1px rgba(71, 179, 255, .18) !important;
  }


  /* CONTEÚDO MAIS PRÓXIMO DO TOPO */
  main {
    margin:
      8px 8px 24px !important;
  }


  .page-title {
    margin-bottom: 14px !important;
  }


  .page-title h1 {
    font-size: 25px !important;

    margin-bottom: 5px !important;
  }


  .page-title p {
    font-size: 13px !important;

    line-height: 1.4 !important;
  }


  #dashboard-data {
    min-height: 48px !important;

    margin-top: 10px !important;

    border-radius: 15px !important;

    font-size: 15px !important;
  }

}


@media (max-width: 390px) {

  #mobile-brand-hero {
    min-height: 70px !important;

    padding: 10px !important;
  }

  .v520-brand-logo {
    width: 42px !important;
    height: 42px !important;

    flex-basis: 42px !important;
  }

  .v520-brand-logo img {
    width: 29px !important;
    height: 29px !important;
  }

  .v520-brand-name {
    font-size: 20px !important;
  }

  .v520-brand-tagline {
    font-size: 6.5px !important;
  }

}


/* =========================================================
   FLUXO V522 — MARCA MOBILE CENTRALIZADA
   ========================================================= */

@media (max-width: 900px) {

  #mobile-brand-hero {
    position: relative !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    min-height: 76px !important;

    padding:
      10px
      60px !important;
  }


  /*
     A marca passa a ficar centralizada
     sem considerar o espaço ocupado pelo avatar.
  */
  .v520-brand {
    position: absolute !important;

    left: 50% !important;
    top: 50% !important;

    transform:
      translate(-50%, -50%) !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 10px !important;

    width: max-content !important;

    max-width:
      calc(100% - 120px) !important;

    margin: 0 !important;
  }


  .v520-brand-copy {
    display: flex !important;

    flex-direction: column !important;

    align-items: flex-start !important;

    justify-content: center !important;

    text-align: left !important;
  }


  .v520-brand-name {
    margin: 0 !important;

    font-size: 22px !important;

    line-height: 1 !important;

    text-align: left !important;
  }


  .v520-brand-tagline {
    margin-top: 5px !important;

    text-align: left !important;

    white-space: nowrap !important;
  }


  /*
     Avatar fica totalmente independente
     da posição da marca.
  */
  #mobile-user-menu-v517,
  #mobile-user-menu {
    position: absolute !important;

    right: 12px !important;
    top: 50% !important;

    transform:
      translateY(-50%) !important;

    margin: 0 !important;

    z-index: 30000 !important;
  }


  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    top: 48px !important;
    right: 0 !important;

    transform: none !important;
  }

}


@media (max-width: 390px) {

  .v520-brand {
    gap: 8px !important;

    max-width:
      calc(100% - 105px) !important;
  }


  .v520-brand-logo {
    width: 40px !important;
    height: 40px !important;

    flex-basis: 40px !important;
  }


  .v520-brand-logo img {
    width: 28px !important;
    height: 28px !important;
  }


  .v520-brand-name {
    font-size: 20px !important;
  }


  .v520-brand-tagline {
    font-size: 6.5px !important;

    letter-spacing: .16em !important;
  }

}


/* =========================================================
   FLUXO V523 — HEADER MOBILE SEM SOBREPOSIÇÃO
   ========================================================= */

@media (max-width: 900px) {

  #mobile-brand-hero {
    position: relative !important;

    display: grid !important;

    grid-template-columns:
      46px
      minmax(0, 1fr)
      46px !important;

    align-items: center !important;

    width: 100% !important;

    min-height: 76px !important;

    padding: 10px 12px !important;

    gap: 8px !important;
  }


  /* MARCA CENTRAL */
  .v520-brand {
    position: static !important;

    left: auto !important;
    top: auto !important;

    transform: none !important;

    grid-column: 2 !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 9px !important;

    width: auto !important;
    max-width: 100% !important;

    min-width: 0 !important;

    margin: 0 !important;
  }


  .v520-brand-logo {
    width: 40px !important;
    height: 40px !important;

    flex: 0 0 40px !important;

    border-radius: 12px !important;
  }


  .v520-brand-logo img {
    width: 28px !important;
    height: 28px !important;
  }


  .v520-brand-copy {
    min-width: 0 !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: flex-start !important;

    justify-content: center !important;
  }


  .v520-brand-name {
    font-size: 21px !important;

    line-height: 1 !important;

    white-space: nowrap !important;
  }


  .v520-brand-tagline {
    margin-top: 5px !important;

    font-size: 6.5px !important;

    letter-spacing: .16em !important;

    white-space: nowrap !important;
  }


  /* AVATAR NA COLUNA DIREITA */
  #mobile-user-menu-v517,
  #mobile-user-menu {
    position: relative !important;

    top: auto !important;
    right: auto !important;

    transform: none !important;

    grid-column: 3 !important;

    justify-self: end !important;

    margin: 0 !important;

    z-index: 30000 !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
  }


  /* O DROPDOWN CONTINUA FLUTUANDO */
  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    position: absolute !important;

    top: 48px !important;
    right: 0 !important;

    transform: none !important;

    z-index: 50000 !important;
  }

}


@media (max-width: 390px) {

  #mobile-brand-hero {
    grid-template-columns:
      40px
      minmax(0, 1fr)
      40px !important;

    padding: 9px 10px !important;

    gap: 5px !important;
  }


  .v520-brand {
    gap: 7px !important;
  }


  .v520-brand-logo {
    width: 36px !important;
    height: 36px !important;

    flex-basis: 36px !important;
  }


  .v520-brand-logo img {
    width: 25px !important;
    height: 25px !important;
  }


  .v520-brand-name {
    font-size: 19px !important;
  }


  .v520-brand-tagline {
    font-size: 6px !important;

    letter-spacing: .12em !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 36px !important;
    height: 36px !important;

    min-width: 36px !important;
  }

}


/* =========================================================
   FLUXO V524 — MARCA À ESQUERDA / AVATAR À DIREITA
   ========================================================= */

@media (max-width: 900px) {

  #mobile-brand-hero {
    display: flex !important;
    grid-template-columns: none !important;

    align-items: center !important;
    justify-content: space-between !important;

    width: 100% !important;

    min-height: 74px !important;

    padding: 11px 13px !important;

    gap: 12px !important;
  }


  /* LOGO + NOME + SLOGAN VIRAM UM ÚNICO BLOCO */
  .v520-brand {
    position: static !important;

    display: flex !important;

    align-items: center !important;
    justify-content: flex-start !important;

    flex: 1 1 auto !important;

    width: auto !important;
    max-width: calc(100% - 55px) !important;

    margin: 0 !important;

    transform: none !important;

    gap: 10px !important;
  }


  .v520-brand-logo {
    width: 42px !important;
    height: 42px !important;

    flex: 0 0 42px !important;

    margin: 0 !important;
  }


  .v520-brand-logo img {
    width: 29px !important;
    height: 29px !important;
  }


  .v520-brand-copy {
    display: flex !important;

    flex-direction: column !important;

    align-items: flex-start !important;
    justify-content: center !important;

    min-width: 0 !important;

    text-align: left !important;
  }


  .v520-brand-name {
    margin: 0 !important;

    font-size: 21px !important;

    line-height: 1 !important;

    text-align: left !important;

    white-space: nowrap !important;
  }


  .v520-brand-tagline {
    margin: 5px 0 0 !important;

    font-size: 6.5px !important;

    letter-spacing: .15em !important;

    text-align: left !important;

    white-space: nowrap !important;
  }


  /* AVATAR CONTINUA À DIREITA */
  #mobile-user-menu-v517,
  #mobile-user-menu {
    position: relative !important;

    flex: 0 0 auto !important;

    margin: 0 !important;

    top: auto !important;
    right: auto !important;

    transform: none !important;

    align-self: center !important;

    z-index: 30000 !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
  }


  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    position: absolute !important;

    top: 48px !important;
    right: 0 !important;

    transform: none !important;

    z-index: 50000 !important;
  }

}


@media (max-width: 390px) {

  #mobile-brand-hero {
    padding: 10px 11px !important;

    gap: 8px !important;
  }


  .v520-brand {
    gap: 8px !important;
  }


  .v520-brand-logo {
    width: 38px !important;
    height: 38px !important;

    flex-basis: 38px !important;
  }


  .v520-brand-logo img {
    width: 27px !important;
    height: 27px !important;
  }


  .v520-brand-name {
    font-size: 19px !important;
  }


  .v520-brand-tagline {
    font-size: 5.8px !important;

    letter-spacing: .11em !important;
  }

}


/* =========================================================
   FLUXO V525 — LOGO ESQUERDA / TEXTO CENTRO / AVATAR DIREITA
   ========================================================= */

@media (max-width: 900px) {

  #mobile-brand-hero {
    display: grid !important;

    grid-template-columns:
      48px
      minmax(0, 1fr)
      48px !important;

    align-items: center !important;

    width: 100% !important;

    min-height: 74px !important;

    padding: 10px 12px !important;

    gap: 8px !important;
  }


  /*
     Faz o container da marca "sumir" estruturalmente,
     permitindo posicionar logo e texto separadamente.
  */
  .v520-brand {
    display: contents !important;
  }


  /* LOGOMARCA À ESQUERDA */
  .v520-brand-logo {
    grid-column: 1 !important;

    justify-self: start !important;

    width: 42px !important;
    height: 42px !important;

    margin: 0 !important;

    flex: none !important;
  }


  .v520-brand-logo img {
    width: 29px !important;
    height: 29px !important;
  }


  /* TEXTO EXATAMENTE NO CENTRO */
  .v520-brand-copy {
    grid-column: 2 !important;

    justify-self: center !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;

    min-width: 0 !important;

    text-align: center !important;
  }


  .v520-brand-name {
    margin: 0 !important;

    font-size: 22px !important;

    line-height: 1 !important;

    text-align: center !important;

    white-space: nowrap !important;
  }


  .v520-brand-tagline {
    margin: 5px 0 0 !important;

    font-size: 6.5px !important;

    letter-spacing: .15em !important;

    text-align: center !important;

    white-space: nowrap !important;
  }


  /* AVATAR À DIREITA */
  #mobile-user-menu-v517,
  #mobile-user-menu {
    grid-column: 3 !important;

    justify-self: end !important;

    position: relative !important;

    top: auto !important;
    right: auto !important;

    transform: none !important;

    margin: 0 !important;

    z-index: 30000 !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
  }


  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    position: absolute !important;

    top: 48px !important;
    right: 0 !important;

    transform: none !important;

    z-index: 50000 !important;
  }

}


@media (max-width: 390px) {

  #mobile-brand-hero {
    grid-template-columns:
      42px
      minmax(0, 1fr)
      42px !important;

    padding: 9px 10px !important;

    gap: 5px !important;
  }


  .v520-brand-logo {
    width: 38px !important;
    height: 38px !important;
  }


  .v520-brand-logo img {
    width: 26px !important;
    height: 26px !important;
  }


  .v520-brand-name {
    font-size: 20px !important;
  }


  .v520-brand-tagline {
    font-size: 5.8px !important;

    letter-spacing: .11em !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;
  }

}


/* =========================================================
   FLUXO V526 — MOBILE SIGNATURE
   ========================================================= */

@media (max-width: 900px) {

  header {
    position: relative !important;

    width: calc(100% - 16px) !important;

    margin:
      max(7px, env(safe-area-inset-top))
      8px 9px !important;

    padding: 0 !important;

    border-radius: 24px !important;

    overflow: visible !important;

    background:
      radial-gradient(
        circle at 50% -20%,
        rgba(43, 185, 255, .18),
        transparent 50%
      ),
      linear-gradient(
        160deg,
        rgba(7, 21, 44, .985),
        rgba(3, 13, 29, .99)
      ) !important;

    border:
      1px solid rgba(77, 167, 255, .18) !important;

    box-shadow:
      0 14px 38px rgba(0,0,0,.28),
      inset 0 1px 0 rgba(255,255,255,.04) !important;
  }


  .sidebar-brand,
  header > .brand,
  header > .header-actions {
    display: none !important;
  }


  #mobile-brand-hero {
    position: relative !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    min-height: 94px !important;

    width: 100% !important;

    margin: 0 !important;

    padding: 13px 58px 12px !important;

    border: 0 !important;

    border-radius: 24px !important;

    background: transparent !important;

    overflow: visible !important;

    box-shadow: none !important;
  }


  /*
     A marca vira uma assinatura central.
  */
  .v520-brand {
    position: static !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    width: auto !important;

    max-width: 100% !important;

    gap: 0 !important;

    margin: 0 !important;

    transform: none !important;
  }


  /*
     Símbolo pequeno, flutuante,
     como um selo da marca.
  */
  .v520-brand-logo {
    position: relative !important;

    width: 38px !important;
    height: 38px !important;

    flex: none !important;

    margin: 0 0 3px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    border-radius: 13px !important;

    background:
      linear-gradient(
        145deg,
        rgba(28, 137, 225, .24),
        rgba(7, 30, 63, .28)
      ) !important;

    border:
      1px solid rgba(80, 188, 255, .22) !important;

    box-shadow:
      0 0 22px rgba(38, 170, 255, .13),
      inset 0 1px 0 rgba(255,255,255,.05) !important;
  }


  .v520-brand-logo::before {
    content: "";

    position: absolute;

    inset: -6px;

    border-radius: 17px;

    border:
      1px solid rgba(71, 173, 255, .07);

    pointer-events: none;
  }


  .v520-brand-logo img {
    width: 27px !important;
    height: 27px !important;

    display: block !important;

    object-fit: contain !important;

    filter:
      drop-shadow(
        0 4px 10px rgba(35, 183, 255, .28)
      );
  }


  .v520-brand-copy {
    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;

    min-width: 0 !important;
  }


  .v520-brand-name {
    margin: 0 !important;

    font-size: 23px !important;

    line-height: 1 !important;

    font-weight: 850 !important;

    letter-spacing: -.045em !important;

    color: #f6faff !important;

    text-align: center !important;

    white-space: nowrap !important;

    text-shadow:
      0 3px 16px rgba(32, 135, 255, .13);
  }


  .v520-brand-tagline {
    margin: 5px 0 0 !important;

    padding: 0 !important;

    font-size: 6.5px !important;

    line-height: 1 !important;

    font-weight: 700 !important;

    letter-spacing: .27em !important;

    text-align: center !important;

    text-transform: uppercase !important;

    color:
      rgba(117, 185, 247, .70) !important;

    white-space: nowrap !important;
  }


  /*
     Avatar vira um botão discreto,
     separado da marca.
  */
  #mobile-user-menu-v517,
  #mobile-user-menu {
    position: absolute !important;

    top: 14px !important;
    right: 13px !important;

    margin: 0 !important;

    transform: none !important;

    z-index: 30000 !important;
  }


  #mobile-user-trigger-v517,
  #mobile-user-trigger {
    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;

    padding: 0 !important;

    border-radius: 50% !important;

    font-size: 13px !important;

    font-weight: 800 !important;

    color: #f8fbff !important;

    background:
      linear-gradient(
        145deg,
        rgba(23, 73, 125, .88),
        rgba(10, 32, 67, .96)
      ) !important;

    border:
      1px solid rgba(91, 180, 255, .24) !important;

    box-shadow:
      0 7px 20px rgba(0,0,0,.23),
      inset 0 1px 0 rgba(255,255,255,.06) !important;
  }


  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    position: absolute !important;

    top: 46px !important;
    right: 0 !important;

    transform: none !important;

    z-index: 50000 !important;
  }


  /*
     detalhe decorativo sutil
  */
  #mobile-brand-hero::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 0;

    width: 58px;
    height: 1px;

    transform: translateX(-50%);

    background:
      linear-gradient(
        90deg,
        transparent,
        rgba(61, 180, 255, .48),
        transparent
      );
  }

}


@media (max-width: 390px) {

  #mobile-brand-hero {
    min-height: 88px !important;

    padding:
      11px 52px 10px !important;
  }


  .v520-brand-logo {
    width: 35px !important;
    height: 35px !important;
  }


  .v520-brand-logo img {
    width: 25px !important;
    height: 25px !important;
  }


  .v520-brand-name {
    font-size: 21px !important;
  }


  .v520-brand-tagline {
    font-size: 6px !important;

    letter-spacing: .21em !important;
  }

}



/* === FLUXO V527 MOBILE HEADER START === */

@media (max-width: 900px) {

  html, body {
    overflow-x: hidden !important;
  }

  body {
    touch-action: pan-y !important;
  }

  header {
    position: relative !important;
    overflow: visible !important;
    min-height: 96px !important;
    padding: 0 !important;
    border-radius: 24px !important;
    margin: max(8px, env(safe-area-inset-top)) 8px 10px !important;
    width: calc(100% - 16px) !important;
    background:
      radial-gradient(circle at 50% -10%, rgba(67, 189, 255, .16), transparent 48%),
      linear-gradient(160deg, #07172d 0%, #0a1d38 55%, #09162a 100%) !important;
    border: 1px solid rgba(92, 180, 255, .16) !important;
    box-shadow:
      0 14px 34px rgba(0,0,0,.25),
      inset 0 1px 0 rgba(255,255,255,.04) !important;
  }

  /* esconde a marca antiga do topo esquerdo */
  header .sidebar-brand,
  header .brand,
  header .header-brand,
  header .topbar-brand,
  header .brand-app-logo,
  header .brand-name,
  header .sidebar-logo,
  header .logo-area,
  header .brand-area,
  #mobile-brand-hero {
    display: none !important;
  }

  /* novo hero */
  #fluxo-mobile-x-hero {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    min-height: 96px !important;
    padding: 12px 60px 10px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 2 !important;
  }

  .fluxo-mobile-x-logo {
    width: 44px !important;
    height: 44px !important;
    position: relative !important;
    border-radius: 14px !important;
    margin: 0 0 6px !important;
    background:
      linear-gradient(145deg,
        rgba(20, 58, 104, .98),
        rgba(11, 33, 67, .98)
      ) !important;
    border: 1px solid rgba(105, 194, 255, .24) !important;
    box-shadow:
      0 0 24px rgba(28, 172, 255, .12),
      inset 0 1px 0 rgba(255,255,255,.05) !important;
    flex: none !important;
  }

  .fluxo-mobile-x-logo::before,
  .fluxo-mobile-x-logo::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 23px !important;
    height: 3px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, #52d7ff, #7aa8ff) !important;
    box-shadow: 0 0 12px rgba(82, 215, 255, .28) !important;
    transform-origin: center !important;
  }

  .fluxo-mobile-x-logo::before {
    transform: translate(-50%, -50%) rotate(45deg) !important;
  }

  .fluxo-mobile-x-logo::after {
    transform: translate(-50%, -50%) rotate(-45deg) !important;
  }

  .fluxo-mobile-x-title {
    margin: 0 !important;
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 850 !important;
    letter-spacing: -.04em !important;
    color: #f7fbff !important;
    text-align: center !important;
    white-space: nowrap !important;
    text-shadow: 0 3px 14px rgba(43, 176, 255, .12) !important;
  }

  .fluxo-mobile-x-subtitle {
    margin-top: 5px !important;
    font-size: 7px !important;
    line-height: 1 !important;
    letter-spacing: .28em !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: rgba(145, 203, 255, .74) !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* avatar no canto direito */
  #mobile-user-menu-v517,
  #mobile-user-menu,
  .fluxo-mobile-user-menu {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    margin: 0 !important;
    z-index: 30 !important;
  }

  #mobile-user-trigger-v517,
  #mobile-user-trigger,
  .fluxo-mobile-user-trigger {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background:
      linear-gradient(145deg,
        rgba(18, 57, 102, .95),
        rgba(9, 27, 56, .98)
      ) !important;
    border: 1px solid rgba(105, 194, 255, .22) !important;
    box-shadow:
      0 8px 18px rgba(0,0,0,.22),
      inset 0 1px 0 rgba(255,255,255,.05) !important;
  }

  #mobile-user-dropdown-v517,
  #mobile-user-dropdown {
    position: absolute !important;
    top: 46px !important;
    right: 0 !important;
    z-index: 99999 !important;
  }

  /* evita o efeito de "zoom lateral" */
  .app,
  main,
  .container,
  .content,
  .layout,
  .dashboard,
  .page {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}

@media (max-width: 390px) {
  #fluxo-mobile-x-hero {
    min-height: 90px !important;
    padding: 10px 56px 9px !important;
  }

  .fluxo-mobile-x-logo {
    width: 40px !important;
    height: 40px !important;
  }

  .fluxo-mobile-x-title {
    font-size: 22px !important;
  }

  .fluxo-mobile-x-subtitle {
    font-size: 6px !important;
    letter-spacing: .22em !important;
  }
}
/* === FLUXO V527 MOBILE HEADER END === */

/* =========================================================
   FLUXO V528 — CABECALHO MOBILE FINAL
   ========================================================= */

@media (max-width: 900px) {

  /* mata todos os cabeçalhos/marcas mobile anteriores */
  .sidebar-brand,
  #mobile-brand-hero,
  #fluxo-mobile-x-hero,
  #mobile-user-menu,
  #mobile-user-menu-v517,
  header > .brand,
  header > .header-actions {
    display: none !important;
  }


  header {
    position: relative !important;

    display: block !important;

    width: calc(100% - 16px) !important;

    min-height: 0 !important;

    margin:
      max(8px, env(safe-area-inset-top))
      8px
      10px !important;

    padding: 0 !important;

    overflow: visible !important;

    border-radius: 22px !important;

    background:
      radial-gradient(
        circle at 50% -30%,
        rgba(35, 175, 255, .15),
        transparent 60%
      ),
      linear-gradient(
        145deg,
        rgba(7, 21, 43, .99),
        rgba(4, 14, 29, .99)
      ) !important;

    border:
      1px solid rgba(83, 168, 255, .17) !important;

    box-shadow:
      0 12px 32px rgba(0,0,0,.28),
      inset 0 1px 0 rgba(255,255,255,.035) !important;

    z-index: 5000 !important;
  }


  #fluxo-final-header {
    position: relative !important;

    display: grid !important;

    grid-template-columns:
      52px
      minmax(0, 1fr)
      52px !important;

    align-items: center !important;

    width: 100% !important;

    height: 76px !important;

    padding: 9px 10px !important;

    box-sizing: border-box !important;
  }


  /* X */
  #fluxo-final-x {
    grid-column: 1 !important;

    justify-self: start !important;

    width: 42px !important;
    height: 42px !important;

    position: relative !important;

    border-radius: 13px !important;

    background:
      linear-gradient(
        145deg,
        rgba(16, 57, 104, .96),
        rgba(7, 27, 59, .98)
      ) !important;

    border:
      1px solid rgba(83, 184, 255, .24) !important;

    box-shadow:
      0 8px 20px rgba(0,0,0,.20),
      inset 0 1px 0 rgba(255,255,255,.05) !important;
  }


  #fluxo-final-x::before,
  #fluxo-final-x::after {
    content: "" !important;

    position: absolute !important;

    left: 50% !important;
    top: 50% !important;

    width: 24px !important;
    height: 3px !important;

    border-radius: 999px !important;

    background:
      linear-gradient(
        90deg,
        #42d1ff,
        #6e91ff
      ) !important;

    box-shadow:
      0 0 10px rgba(62, 202, 255, .24) !important;
  }


  #fluxo-final-x::before {
    transform:
      translate(-50%, -50%)
      rotate(45deg) !important;
  }


  #fluxo-final-x::after {
    transform:
      translate(-50%, -50%)
      rotate(-45deg) !important;
  }


  /* texto central */
  #fluxo-final-brand {
    grid-column: 2 !important;

    min-width: 0 !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;

    pointer-events: none !important;
  }


  #fluxo-final-name {
    margin: 0 !important;

    color: #f7faff !important;

    font-size: 24px !important;

    line-height: .95 !important;

    font-weight: 850 !important;

    letter-spacing: -.04em !important;

    white-space: nowrap !important;
  }


  #fluxo-final-tagline {
    margin-top: 6px !important;

    color:
      rgba(137, 192, 247, .72) !important;

    font-size: 6.5px !important;

    font-weight: 700 !important;

    line-height: 1 !important;

    letter-spacing: .23em !important;

    text-transform: uppercase !important;

    white-space: nowrap !important;
  }


  /* avatar */
  #fluxo-final-user {
    grid-column: 3 !important;

    justify-self: end !important;

    position: relative !important;

    z-index: 30000 !important;
  }


  #fluxo-final-avatar {
    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;

    padding: 0 !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;

    color: #fff !important;

    font-size: 14px !important;

    font-weight: 800 !important;

    background:
      linear-gradient(
        145deg,
        rgba(20, 65, 116, .98),
        rgba(9, 30, 64, .98)
      ) !important;

    border:
      1px solid rgba(103, 190, 255, .25) !important;

    box-shadow:
      0 7px 18px rgba(0,0,0,.22),
      inset 0 1px 0 rgba(255,255,255,.05) !important;
  }


  /* menu do avatar */
  #fluxo-final-dropdown {
    position: absolute !important;

    top: 48px !important;
    right: 0 !important;

    width: 260px !important;

    padding: 8px !important;

    border-radius: 18px !important;

    background:
      rgba(5, 16, 32, .99) !important;

    border:
      1px solid rgba(87, 164, 250, .22) !important;

    box-shadow:
      0 22px 55px rgba(0,0,0,.52) !important;

    backdrop-filter: blur(20px) !important;

    z-index: 60000 !important;
  }


  #fluxo-final-dropdown.hidden {
    display: none !important;
  }


  .fluxo-final-user-name {
    padding: 9px 10px 11px !important;

    color: #f3f7ff !important;

    font-size: 14px !important;

    font-weight: 700 !important;

    border-bottom:
      1px solid rgba(255,255,255,.07) !important;
  }


  .fluxo-final-user-name small {
    display: block !important;

    margin-top: 3px !important;

    color: #718caf !important;

    font-size: 10px !important;

    font-weight: 500 !important;
  }


  .fluxo-final-label {
    padding: 10px 8px 5px !important;

    color: #617fa5 !important;

    font-size: 9px !important;

    font-weight: 800 !important;

    letter-spacing: .14em !important;

    text-transform: uppercase !important;
  }


  #fluxo-final-dropdown button {
    width: 100% !important;

    min-height: 42px !important;

    margin: 2px 0 !important;

    padding: 9px 10px !important;

    text-align: left !important;

    border-radius: 11px !important;

    background:
      rgba(255,255,255,.025) !important;

    color: #dce8f8 !important;

    border: 0 !important;

    box-shadow: none !important;

    font-size: 13px !important;
  }


  #fluxo-final-company {
    padding: 9px 10px !important;

    margin-bottom: 3px !important;

    border-radius: 11px !important;

    background:
      rgba(35, 131, 255, .06) !important;

    border:
      1px solid rgba(64, 151, 255, .10) !important;

    color: #edf5ff !important;

    font-size: 13px !important;

    overflow: hidden !important;

    text-overflow: ellipsis !important;

    white-space: nowrap !important;
  }


  #fluxo-final-logout {
    margin-top: 7px !important;

    color: #ff8899 !important;

    border-top:
      1px solid rgba(255,255,255,.055) !important;
  }


  /* navegação sempre atrás */
  nav {
    z-index: 10 !important;
  }

}


@media (max-width: 390px) {

  #fluxo-final-header {
    grid-template-columns:
      46px
      minmax(0, 1fr)
      46px !important;

    height: 72px !important;

    padding: 8px !important;
  }


  #fluxo-final-x {
    width: 38px !important;
    height: 38px !important;
  }


  #fluxo-final-x::before,
  #fluxo-final-x::after {
    width: 21px !important;
  }


  #fluxo-final-name {
    font-size: 21px !important;
  }


  #fluxo-final-tagline {
    font-size: 5.8px !important;

    letter-spacing: .18em !important;
  }


  #fluxo-final-avatar {
    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;
  }

}


/* =========================================================
   FLUXO V529 — PREMIUM MOBILE BRAND
   ========================================================= */

@media (max-width: 900px) {

  /*
   * Esconde todos os cabeçalhos mobile antigos.
   */
  .sidebar-brand,
  #mobile-brand-hero,
  #fluxo-mobile-x-hero,
  #fluxo-final-header,
  header > .brand,
  header > .header-actions,
  #mobile-user-menu,
  #mobile-user-menu-v517 {
    display: none !important;
  }


  header {
    position: relative !important;

    width: calc(100% - 16px) !important;

    min-height: 0 !important;

    margin:
      max(8px, env(safe-area-inset-top))
      8px
      10px !important;

    padding: 0 !important;

    overflow: visible !important;

    border-radius: 26px !important;

    background:
      radial-gradient(
        circle at 12% 0%,
        rgba(21, 195, 255, .16),
        transparent 35%
      ),
      radial-gradient(
        circle at 88% 0%,
        rgba(70, 93, 255, .13),
        transparent 38%
      ),
      linear-gradient(
        145deg,
        #07172e 0%,
        #091b35 52%,
        #071426 100%
      ) !important;

    border:
      1px solid rgba(102, 182, 255, .17) !important;

    box-shadow:
      0 16px 38px rgba(0,0,0,.28),
      inset 0 1px 0 rgba(255,255,255,.045) !important;

    z-index: 5000 !important;
  }


  #fluxo-premium-header {
    position: relative !important;

    width: 100% !important;

    min-height: 96px !important;

    display: grid !important;

    grid-template-columns:
      minmax(0, 1fr)
      48px !important;

    align-items: center !important;

    padding: 14px 14px 14px 16px !important;

    gap: 12px !important;

    box-sizing: border-box !important;

    overflow: visible !important;

    border-radius: 26px !important;
  }


  /*
   * Luz ambiente.
   */
  #fluxo-premium-header::before {
    content: "" !important;

    position: absolute !important;

    left: 54px !important;
    right: 54px !important;
    bottom: 0 !important;

    height: 1px !important;

    background:
      linear-gradient(
        90deg,
        transparent,
        rgba(54, 196, 255, .42),
        rgba(86, 104, 255, .24),
        transparent
      ) !important;

    pointer-events: none !important;
  }


  /*
   * Marca completa.
   */
  .fluxo-premium-brand {
    min-width: 0 !important;

    display: flex !important;

    align-items: center !important;

    gap: 13px !important;
  }


  /*
   * Símbolo Fluxo — fitas em movimento.
   */
  .fluxo-premium-symbol {
    position: relative !important;

    width: 56px !important;
    height: 56px !important;

    flex: 0 0 56px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    border-radius: 18px !important;

    background:
      radial-gradient(
        circle at 30% 20%,
        rgba(73, 219, 255, .19),
        transparent 50%
      ),
      linear-gradient(
        145deg,
        rgba(18, 60, 110, .88),
        rgba(8, 28, 60, .96)
      ) !important;

    border:
      1px solid rgba(91, 194, 255, .22) !important;

    box-shadow:
      0 10px 28px rgba(0,0,0,.20),
      0 0 24px rgba(37, 166, 255, .10),
      inset 0 1px 0 rgba(255,255,255,.06) !important;
  }


  .fluxo-premium-symbol svg {
    width: 38px !important;
    height: 38px !important;

    overflow: visible !important;

    filter:
      drop-shadow(
        0 5px 10px rgba(43, 190, 255, .22)
      ) !important;
  }


  /*
   * Wordmark.
   */
  .fluxo-premium-copy {
    min-width: 0 !important;

    display: flex !important;

    flex-direction: column !important;

    justify-content: center !important;

    align-items: flex-start !important;
  }


  .fluxo-premium-name {
    margin: 0 !important;

    color: #f8fbff !important;

    font-size: 28px !important;

    line-height: .95 !important;

    font-weight: 850 !important;

    letter-spacing: -.047em !important;

    white-space: nowrap !important;

    text-shadow:
      0 4px 18px rgba(40, 155, 255, .14) !important;
  }


  .fluxo-premium-tag {
    display: inline-flex !important;

    align-items: center !important;

    gap: 6px !important;

    margin-top: 8px !important;

    padding: 5px 8px 5px 7px !important;

    border-radius: 999px !important;

    color:
      rgba(170, 211, 255, .85) !important;

    font-size: 7px !important;

    font-weight: 750 !important;

    line-height: 1 !important;

    letter-spacing: .17em !important;

    text-transform: uppercase !important;

    white-space: nowrap !important;

    background:
      rgba(60, 152, 255, .07) !important;

    border:
      1px solid rgba(83, 180, 255, .11) !important;
  }


  .fluxo-premium-dot {
    width: 5px !important;
    height: 5px !important;

    border-radius: 50% !important;

    background:
      #3ad9ff !important;

    box-shadow:
      0 0 8px rgba(58, 217, 255, .60) !important;

    flex: 0 0 5px !important;
  }


  /*
   * Avatar.
   */
  #fluxo-premium-user {
    position: relative !important;

    justify-self: end !important;

    z-index: 40000 !important;
  }


  #fluxo-premium-avatar {
    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;

    padding: 0 !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;

    color: #f8fbff !important;

    font-size: 14px !important;

    font-weight: 850 !important;

    background:
      linear-gradient(
        145deg,
        rgba(28, 91, 155, .96),
        rgba(10, 34, 72, .98)
      ) !important;

    border:
      1px solid rgba(109, 198, 255, .24) !important;

    box-shadow:
      0 9px 22px rgba(0,0,0,.24),
      inset 0 1px 0 rgba(255,255,255,.07) !important;
  }


  #fluxo-premium-avatar::after {
    content: "" !important;

    position: absolute !important;

    right: 1px !important;
    bottom: 1px !important;

    width: 8px !important;
    height: 8px !important;

    border-radius: 50% !important;

    background: #39d98a !important;

    border: 2px solid #09182e !important;
  }


  /*
   * Dropdown premium.
   */
  #fluxo-premium-dropdown {
    position: absolute !important;

    top: 51px !important;
    right: 0 !important;

    width: min(280px, calc(100vw - 28px)) !important;

    padding: 8px !important;

    border-radius: 20px !important;

    background:
      rgba(5, 16, 32, .985) !important;

    border:
      1px solid rgba(87, 166, 255, .21) !important;

    box-shadow:
      0 24px 60px rgba(0,0,0,.54) !important;

    backdrop-filter:
      blur(22px) !important;

    z-index: 60000 !important;
  }


  #fluxo-premium-dropdown.hidden {
    display: none !important;
  }


  .fluxo-premium-profile {
    padding: 11px 11px 12px !important;

    border-bottom:
      1px solid rgba(255,255,255,.065) !important;
  }


  .fluxo-premium-profile strong {
    display: block !important;

    color: #f5f9ff !important;

    font-size: 14px !important;
  }


  .fluxo-premium-profile small {
    display: block !important;

    margin-top: 3px !important;

    color: #718daf !important;

    font-size: 10px !important;
  }


  .fluxo-premium-menu-label {
    padding: 11px 8px 5px !important;

    color: #6684a9 !important;

    font-size: 9px !important;

    font-weight: 800 !important;

    letter-spacing: .14em !important;

    text-transform: uppercase !important;
  }


  #fluxo-premium-dropdown button {
    width: 100% !important;

    min-height: 42px !important;

    padding: 9px 10px !important;

    margin: 2px 0 !important;

    border-radius: 11px !important;

    border: 1px solid transparent !important;

    background:
      rgba(255,255,255,.025) !important;

    box-shadow: none !important;

    color: #dce9f9 !important;

    text-align: left !important;

    font-size: 13px !important;
  }


  #fluxo-premium-company {
    margin: 2px 0 5px !important;

    padding: 10px !important;

    border-radius: 12px !important;

    background:
      rgba(39, 137, 255, .065) !important;

    border:
      1px solid rgba(67, 158, 255, .11) !important;

    color: #edf5ff !important;

    font-size: 13px !important;

    overflow: hidden !important;

    text-overflow: ellipsis !important;

    white-space: nowrap !important;
  }


  #fluxo-premium-logout {
    margin-top: 8px !important;

    color: #ff8a9a !important;

    border-top:
      1px solid rgba(255,255,255,.055) !important;
  }


  /*
   * Menu principal sempre abaixo.
   */
  nav {
    position: relative !important;

    z-index: 10 !important;
  }

}


@media (max-width: 390px) {

  #fluxo-premium-header {
    min-height: 88px !important;

    grid-template-columns:
      minmax(0, 1fr)
      44px !important;

    padding:
      12px 12px 12px 13px !important;
  }


  .fluxo-premium-brand {
    gap: 10px !important;
  }


  .fluxo-premium-symbol {
    width: 50px !important;
    height: 50px !important;

    flex-basis: 50px !important;
  }


  .fluxo-premium-symbol svg {
    width: 34px !important;
    height: 34px !important;
  }


  .fluxo-premium-name {
    font-size: 25px !important;
  }


  .fluxo-premium-tag {
    font-size: 6px !important;

    letter-spacing: .13em !important;
  }


  #fluxo-premium-avatar {
    width: 39px !important;
    height: 39px !important;

    min-width: 39px !important;
  }

}


/* =========================================================
   FLUXO V530 — HEADER MAIS LIMPO E CENTRAL
   ========================================================= */

@media (max-width: 900px) {

  #fluxo-premium-header {
    position: relative !important;

    display: grid !important;

    grid-template-columns:
      56px
      minmax(0, 1fr)
      56px !important;

    align-items: center !important;

    min-height: 82px !important;

    padding: 10px 12px !important;

    gap: 6px !important;

    background: transparent !important;
  }


  /*
   * A marca inteira deixa de mandar no layout.
   * Símbolo e texto passam a ocupar colunas próprias.
   */
  .fluxo-premium-brand {
    display: contents !important;
  }


  /*
   * Símbolo discreto na esquerda.
   */
  .fluxo-premium-symbol {
    grid-column: 1 !important;

    justify-self: start !important;

    width: 42px !important;
    height: 42px !important;

    flex: none !important;

    border-radius: 14px !important;

    background:
      rgba(10, 35, 68, .72) !important;

    border:
      1px solid rgba(93, 171, 235, .14) !important;

    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.035) !important;
  }


  .fluxo-premium-symbol svg {
    width: 29px !important;
    height: 29px !important;

    filter: none !important;
  }


  /*
   * Texto no centro real da tela.
   */
  .fluxo-premium-copy {
    grid-column: 2 !important;

    justify-self: center !important;

    width: 100% !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;
  }


  .fluxo-premium-name {
    margin: 0 !important;

    font-size: 24px !important;

    line-height: 1 !important;

    font-weight: 760 !important;

    letter-spacing: -.03em !important;

    color: #f4f7fb !important;

    text-align: center !important;

    text-shadow: none !important;
  }


  /*
   * Slogan simples. Sem cápsula, sem bolinha.
   */
  .fluxo-premium-tag {
    display: block !important;

    margin-top: 5px !important;

    padding: 0 !important;

    border: 0 !important;

    border-radius: 0 !important;

    background: transparent !important;

    font-size: 6.5px !important;

    font-weight: 600 !important;

    line-height: 1 !important;

    letter-spacing: .20em !important;

    color:
      rgba(145, 169, 199, .72) !important;

    text-align: center !important;

    box-shadow: none !important;
  }


  .fluxo-premium-dot {
    display: none !important;
  }


  /*
   * Avatar permanece na direita.
   */
  #fluxo-premium-user {
    grid-column: 3 !important;

    justify-self: end !important;

    position: relative !important;

    z-index: 40000 !important;
  }


  #fluxo-premium-avatar {
    width: 39px !important;
    height: 39px !important;

    min-width: 39px !important;

    background:
      rgba(14, 45, 82, .90) !important;

    border:
      1px solid rgba(96, 173, 238, .16) !important;

    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.04) !important;
  }


  #fluxo-premium-avatar::after {
    width: 6px !important;
    height: 6px !important;

    box-shadow: none !important;
  }


  /*
   * Cabeçalho geral mais sóbrio.
   */
  header {
    border-radius: 20px !important;

    background:
      linear-gradient(
        145deg,
        rgba(7, 20, 39, .98),
        rgba(5, 15, 30, .99)
      ) !important;

    border:
      1px solid rgba(92, 161, 220, .11) !important;

    box-shadow:
      0 10px 26px rgba(0,0,0,.22) !important;
  }


  #fluxo-premium-header::before {
    display: none !important;
  }

}


@media (max-width: 390px) {

  #fluxo-premium-header {
    grid-template-columns:
      48px
      minmax(0, 1fr)
      48px !important;

    min-height: 76px !important;

    padding: 9px 10px !important;
  }


  .fluxo-premium-symbol {
    width: 38px !important;
    height: 38px !important;
  }


  .fluxo-premium-symbol svg {
    width: 26px !important;
    height: 26px !important;
  }


  .fluxo-premium-name {
    font-size: 22px !important;
  }


  .fluxo-premium-tag {
    font-size: 5.8px !important;

    letter-spacing: .16em !important;
  }


  #fluxo-premium-avatar {
    width: 37px !important;
    height: 37px !important;

    min-width: 37px !important;
  }

}


/* =========================================================
   FLUXO V530 — HEADER MAIS LIMPO E CENTRAL
   ========================================================= */

@media (max-width: 900px) {

  #fluxo-premium-header {
    position: relative !important;

    display: grid !important;

    grid-template-columns:
      56px
      minmax(0, 1fr)
      56px !important;

    align-items: center !important;

    min-height: 82px !important;

    padding: 10px 12px !important;

    gap: 6px !important;

    background: transparent !important;
  }


  /*
   * A marca inteira deixa de mandar no layout.
   * Símbolo e texto passam a ocupar colunas próprias.
   */
  .fluxo-premium-brand {
    display: contents !important;
  }


  /*
   * Símbolo discreto na esquerda.
   */
  .fluxo-premium-symbol {
    grid-column: 1 !important;

    justify-self: start !important;

    width: 42px !important;
    height: 42px !important;

    flex: none !important;

    border-radius: 14px !important;

    background:
      rgba(10, 35, 68, .72) !important;

    border:
      1px solid rgba(93, 171, 235, .14) !important;

    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.035) !important;
  }


  .fluxo-premium-symbol svg {
    width: 29px !important;
    height: 29px !important;

    filter: none !important;
  }


  /*
   * Texto no centro real da tela.
   */
  .fluxo-premium-copy {
    grid-column: 2 !important;

    justify-self: center !important;

    width: 100% !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;
  }


  .fluxo-premium-name {
    margin: 0 !important;

    font-size: 24px !important;

    line-height: 1 !important;

    font-weight: 760 !important;

    letter-spacing: -.03em !important;

    color: #f4f7fb !important;

    text-align: center !important;

    text-shadow: none !important;
  }


  /*
   * Slogan simples. Sem cápsula, sem bolinha.
   */
  .fluxo-premium-tag {
    display: block !important;

    margin-top: 5px !important;

    padding: 0 !important;

    border: 0 !important;

    border-radius: 0 !important;

    background: transparent !important;

    font-size: 6.5px !important;

    font-weight: 600 !important;

    line-height: 1 !important;

    letter-spacing: .20em !important;

    color:
      rgba(145, 169, 199, .72) !important;

    text-align: center !important;

    box-shadow: none !important;
  }


  .fluxo-premium-dot {
    display: none !important;
  }


  /*
   * Avatar permanece na direita.
   */
  #fluxo-premium-user {
    grid-column: 3 !important;

    justify-self: end !important;

    position: relative !important;

    z-index: 40000 !important;
  }


  #fluxo-premium-avatar {
    width: 39px !important;
    height: 39px !important;

    min-width: 39px !important;

    background:
      rgba(14, 45, 82, .90) !important;

    border:
      1px solid rgba(96, 173, 238, .16) !important;

    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.04) !important;
  }


  #fluxo-premium-avatar::after {
    width: 6px !important;
    height: 6px !important;

    box-shadow: none !important;
  }


  /*
   * Cabeçalho geral mais sóbrio.
   */
  header {
    border-radius: 20px !important;

    background:
      linear-gradient(
        145deg,
        rgba(7, 20, 39, .98),
        rgba(5, 15, 30, .99)
      ) !important;

    border:
      1px solid rgba(92, 161, 220, .11) !important;

    box-shadow:
      0 10px 26px rgba(0,0,0,.22) !important;
  }


  #fluxo-premium-header::before {
    display: none !important;
  }

}


@media (max-width: 390px) {

  #fluxo-premium-header {
    grid-template-columns:
      48px
      minmax(0, 1fr)
      48px !important;

    min-height: 76px !important;

    padding: 9px 10px !important;
  }


  .fluxo-premium-symbol {
    width: 38px !important;
    height: 38px !important;
  }


  .fluxo-premium-symbol svg {
    width: 26px !important;
    height: 26px !important;
  }


  .fluxo-premium-name {
    font-size: 22px !important;
  }


  .fluxo-premium-tag {
    font-size: 5.8px !important;

    letter-spacing: .16em !important;
  }


  #fluxo-premium-avatar {
    width: 37px !important;
    height: 37px !important;

    min-width: 37px !important;
  }

}

