/* Tema inspirado em apps de finanças (Mobills): verde, cartões limpos, mobile-first */

:root {
  --mb-green: #00a86b;
  --mb-green-dark: #008f5d;
  --mb-green-soft: #e8f7f1;
  --mb-teal: #0d9488;
  --mb-income: #059669;
  --mb-income-bg: #ecfdf5;
  --mb-expense: #dc2626;
  --mb-expense-bg: #fef2f2;
  --mb-text: #1c1917;
  --mb-text-muted: #78716c;
  --mb-border: #e7e5e4;
  --mb-bg: #f5f5f4;
  --mb-card: #ffffff;
  --mb-radius: 16px;
  --mb-radius-sm: 12px;
  --mb-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --mb-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --mb-topbar-h: 56px;
  --mb-bottom-nav-h: 64px;
  --mb-sidebar-w: 272px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--mb-bg);
  color: var(--mb-text);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Tipografia */
.page-title {
  color: var(--mb-text);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.container-slim {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.app-main {
  padding-top: calc(var(--mb-topbar-h) + 12px);
  padding-bottom: calc(var(--mb-bottom-nav-h) + 24px);
}

@media (min-width: 992px) {
  .app-main {
    padding-bottom: 32px;
  }
}

/* Topbar */
.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: var(--mb-topbar-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--mb-green) 0%, var(--mb-teal) 100%);
  box-shadow: var(--mb-shadow-lg);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff !important;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  text-decoration: none !important;
}

.app-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.app-topbar .navbar {
  padding: 0;
  flex: 1;
  justify-content: flex-end;
}

.app-topbar .navbar-nav {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
}

.app-topbar .nav-link {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.4rem 0.65rem !important;
  border-radius: 8px;
  transition: background 0.15s;
}

.app-topbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}

.app-topbar .dropdown-menu {
  border: none;
  border-radius: var(--mb-radius-sm);
  box-shadow: var(--mb-shadow-lg);
  padding: 8px;
  margin-top: 8px;
}

.app-topbar .dropdown-item {
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
}

.app-topbar .dropdown-item:hover {
  background: var(--mb-green-soft);
  color: var(--mb-green-dark);
}

.app-topbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.4);
  padding: 0.35rem 0.55rem;
}

.app-topbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 991px) {
  .app-topbar .navbar-collapse {
    position: absolute;
    top: var(--mb-topbar-h);
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--mb-green-dark) 0%, #0f766e 100%);
    padding: 12px 16px 20px;
    max-height: calc(100vh - var(--mb-topbar-h));
    overflow-y: auto;
    box-shadow: var(--mb-shadow-lg);
  }

  .app-topbar .navbar-nav {
    flex-direction: column;
    width: 100%;
  }

  .app-topbar .nav-item {
    width: 100%;
  }

  .app-topbar .dropdown-menu {
    position: static !important;
    float: none;
    background: rgba(0, 0, 0, 0.15);
    box-shadow: none;
    margin-top: 4px;
  }

  .app-topbar .dropdown-item {
    color: #fff;
  }

  .app-topbar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }
}

/* Cartões */
.card-neo {
  border: 1px solid var(--mb-border);
  border-radius: var(--mb-radius);
  box-shadow: var(--mb-shadow);
  background: var(--mb-card);
  overflow: hidden;
}

.card-neo .card-header {
  background: transparent;
  border-bottom: 1px solid var(--mb-border);
  font-weight: 600;
  color: var(--mb-text);
  padding: 1rem 1.25rem;
}

.card-neo .card-body {
  padding: 1.25rem;
}

/* Dashboard hero */
.mb-hero {
  background: linear-gradient(145deg, var(--mb-green) 0%, #0f766e 55%, #115e59 100%);
  border-radius: var(--mb-radius);
  padding: 1.5rem 1.35rem;
  color: #fff;
  box-shadow: var(--mb-shadow-lg);
  margin-bottom: 1.25rem;
}

.mb-hero-kicker {
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mb-hero-balance-label {
  font-size: 0.9rem;
  opacity: 0.88;
  margin-top: 0.5rem;
}

.mb-hero-balance {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.mb-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 1.25rem;
}

@media (max-width: 576px) {
  .mb-stat-grid {
    grid-template-columns: 1fr;
  }
}

.mb-stat-pill {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border-radius: var(--mb-radius-sm);
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.mb-stat-pill label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.mb-stat-pill strong {
  font-size: 1rem;
  font-weight: 700;
  display: block;
}

.mb-stat-pill.income strong {
  color: #a7f3d0;
}

.mb-stat-pill.expense strong {
  color: #fecaca;
}

.mb-stat-pill.result strong {
  color: #fff;
}

/* Lista de contas estilo “cartão” */
.mb-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mb-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--mb-bg);
  border-radius: var(--mb-radius-sm);
  border: 1px solid var(--mb-border);
  transition: transform 0.12s, box-shadow 0.12s;
}

.mb-account-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--mb-shadow);
}

.mb-account-row .name {
  font-weight: 600;
  color: var(--mb-text);
}

.mb-account-row .balance {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mb-teal);
}

/* Seções */
.mb-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mb-text-muted);
  margin-bottom: 0.75rem;
}

/* Tabelas */
.table {
  font-size: 0.9rem;
}

.table thead th {
  border-top: none;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mb-text-muted);
  white-space: nowrap;
  border-bottom-width: 1px;
}

.th-sort a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}
.th-sort a:hover {
  color: var(--mb-green);
}
.th-sort.is-active a {
  color: var(--mb-text);
}
.th-sort.text-right {
  text-align: right;
}
.th-sort.text-right a {
  justify-content: flex-end;
  width: 100%;
}

.table tbody tr:hover {
  background: #fafaf9;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: #fafaf9;
}

/* Botões */
.btn-brand {
  background: var(--mb-green);
  border: none;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.45rem 1rem;
}

.btn-brand:hover {
  background: var(--mb-green-dark);
  color: #fff !important;
}

.btn-outline-brand {
  border: 2px solid var(--mb-green);
  color: var(--mb-green) !important;
  background: transparent;
  font-weight: 600;
  border-radius: 10px;
}

.btn-outline-brand:hover {
  background: var(--mb-green-soft);
  color: var(--mb-green-dark) !important;
}

/* Badges */
.badge-soft {
  background: var(--mb-green-soft);
  color: var(--mb-green-dark);
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 8px;
}

.badge-income {
  background: var(--mb-income-bg);
  color: var(--mb-income);
  font-weight: 600;
}

.badge-expense {
  background: var(--mb-expense-bg);
  color: var(--mb-expense);
  font-weight: 600;
}

.badge-transfer {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.small-muted {
  font-size: 0.875rem;
  color: var(--mb-text-muted);
}

/* Alertas */
.alert {
  border: none;
  border-radius: var(--mb-radius-sm);
}

/* Formulários */
.form-control {
  border-radius: 10px;
  border-color: var(--mb-border);
}

.form-control:focus {
  border-color: var(--mb-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* Navegação inferior (mobile) */
.app-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1020;
  height: var(--mb-bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--mb-card);
  border-top: 1px solid var(--mb-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

@media (max-width: 991px) {
  .app-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
  }
}

.app-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--mb-text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none !important;
  padding: 8px 4px;
  transition: color 0.15s;
}

.app-bottom-nav a:hover,
.app-bottom-nav a.active {
  color: var(--mb-green);
}

.app-bottom-nav a i {
  font-size: 1.25rem;
}

.app-bottom-nav-logo {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: contain;
  display: block;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.app-bottom-nav a.active .app-bottom-nav-logo {
  box-shadow: 0 0 0 2px var(--mb-green), 0 2px 8px rgba(0, 168, 107, 0.35);
}

.app-bottom-nav .nav-fab {
  position: relative;
  flex: 0 0 auto;
  margin-top: -20px;
}

.app-bottom-nav .nav-fab a {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--mb-green), var(--mb-teal));
  color: #fff !important;
  box-shadow: var(--mb-shadow-lg);
  padding: 0;
  margin-top: 0;
}

.app-bottom-nav .nav-fab a i {
  font-size: 1.5rem;
}

.app-bottom-nav .nav-fab span {
  display: none;
}

/* Botões só ícone (colunas de ação) */
.btn-action {
  padding: 0 !important;
  width: 2.125rem;
  height: 2.125rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  vertical-align: middle;
}

.btn-action i {
  font-size: 1.05rem;
  line-height: 1;
}

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

/* Faturas: vários botões pagar por linha */
.btn-action-compact {
  min-width: 2rem;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}

/* Visão do mês — hero com navegação */
.mb-hero .mb-month-nav-btn {
  color: rgba(255, 255, 255, 0.95) !important;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 0.15s;
}
.mb-hero .mb-month-nav-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  text-decoration: none;
}
.mb-hero .mb-month-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Coluna de ações em tabelas (alinhar à direita, sem quebrar ícones) */
.month-table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 100%;
}
.month-table-actions form {
  margin: 0;
  display: inline-flex;
}

/* Layout tela cheia + menu lateral */
body.app-layout-body {
  padding-bottom: 0;
  min-height: 100vh;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1038;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.app-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (min-width: 992px) {
  .app-backdrop {
    display: none !important;
  }
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  width: var(--mb-sidebar-w);
  max-width: min(var(--mb-sidebar-w), 88vw);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--mb-green) 0%, #0d9488 42%, #115e59 100%);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

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

@media (min-width: 992px) {
  .app-sidebar {
    transform: none;
    max-width: none;
  }
}

.app-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  flex-shrink: 0;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff !important;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  text-decoration: none !important;
  flex-wrap: wrap;
  min-width: 0;
  line-height: 1.2;
}

.app-topbar-mobile-brand {
  padding-left: 4px;
  padding-right: 8px;
}

.app-topbar-title {
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  min-width: 0;
}

.app-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.65rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.app-sidebar-section {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  padding: 1rem 0.75rem 0.35rem;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 2px;
  border-radius: var(--mb-radius-sm);
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}

.app-sidebar-link i {
  font-size: 1.1rem;
  opacity: 0.9;
  width: 1.35rem;
  text-align: center;
}

.app-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

.app-sidebar-link.is-active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.85);
}

.app-sidebar-sublink {
  font-size: 0.85rem;
  font-weight: 500;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  opacity: 0.95;
}

.app-sidebar-footer {
  flex-shrink: 0;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.08);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin-left: 0;
}

@media (min-width: 992px) {
  .app-shell {
    margin-left: var(--mb-sidebar-w);
  }
}

.app-topbar-mobile {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: var(--mb-topbar-h);
  padding: 0 8px 0 4px;
  background: linear-gradient(135deg, var(--mb-green) 0%, var(--mb-teal) 100%);
  box-shadow: var(--mb-shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1035;
}

@media (min-width: 992px) {
  .app-topbar-mobile {
    display: none !important;
  }
}

.app-main-full {
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 16px calc(var(--mb-bottom-nav-h) + 20px);
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .app-main-full {
    padding: 16px 20px 40px;
  }
}

/* Login (página isolada) */
body.auth-body {
  min-height: 100vh;
  background: linear-gradient(155deg, #ecfdf5 0%, #f5f5f4 42%, #e0f2f1 72%, #d8f3e8 100%);
}

.auth-wrap {
  min-height: 100vh;
}

.auth-card {
  border-radius: var(--mb-radius);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 20px 50px rgba(15, 118, 110, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.auth-card-accent {
  height: 5px;
  background: linear-gradient(90deg, var(--mb-green) 0%, var(--mb-teal) 45%, #4338ca 100%);
}

.auth-brand-logo {
  max-height: 160px;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--mb-text);
}

.auth-sub {
  color: var(--mb-text-muted);
  font-size: 0.9rem;
}

.auth-card .form-control {
  border-radius: var(--mb-radius-sm);
  border-color: var(--mb-border);
  padding: 0.65rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card .form-control:focus {
  border-color: var(--mb-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mb-text-muted);
  font-size: 1.05rem;
  pointer-events: none;
  z-index: 1;
}

.auth-input-wrap .form-control {
  padding-left: 2.5rem;
}

.auth-card .btn-brand {
  border-radius: var(--mb-radius-sm);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  box-shadow: 0 4px 14px rgba(0, 168, 107, 0.35);
}

.auth-card .btn-brand:hover {
  box-shadow: 0 6px 20px rgba(0, 168, 107, 0.45);
}

/* Marca (ícone) — menu e barra superior */
.app-brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
}

.app-brand-mark--sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

/* Login premium — colunas fixas 70% / 30% em desktop */
body.login-premium-body {
  background: #0f172a;
}

body.login-premium-body.auth-body {
  background: #0f172a;
}

.login-premium {
  min-height: 100vh;
  min-height: 100dvh;
}

.login-premium-layout {
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .login-premium-layout {
    display: grid;
    grid-template-columns: 70% 30%;
    grid-template-rows: minmax(100vh, auto);
    align-items: stretch;
  }

  .login-premium-hero {
    grid-column: 1;
    grid-row: 1;
    min-height: 100vh;
    min-width: 0;
  }

  .login-premium-form-wrap {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
    background: linear-gradient(190deg, #f8fafc 0%, #eef2f7 55%, #e8edf4 100%);
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.06);
    padding: 2.5rem 1.5rem !important;
  }

  .login-premium-form-inner {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Painel do formulário de login (contorno + profundidade) */
.login-form-panel {
  width: 100%;
  padding: 1.25rem 1rem 1.5rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 20px 50px -12px rgba(15, 23, 42, 0.15),
    0 8px 24px -8px rgba(15, 23, 42, 0.1);
}

@media (min-width: 992px) {
  .login-form-panel {
    padding: 1.5rem 1.35rem 1.75rem;
  }
}

.login-form-panel .login-premium-card {
  background: #fff;
  border-radius: 18px !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
}

.login-premium-hero {
  overflow: hidden;
  min-height: 0;
}

.login-premium-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 920px;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.login-premium-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, #064e3b 0%, #0d9488 38%, #0f766e 72%, #115e59 100%);
  opacity: 1;
}

.login-premium-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.88;
}

.login-premium-hero-content {
  z-index: 1;
  max-width: 52rem;
}

.login-premium-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.55);
}

.login-premium-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1.12;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.28);
}

.login-premium-lead {
  font-size: clamp(0.95rem, 1.35vw, 1.08rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  max-width: 38rem;
}

.login-premium-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(167, 243, 208, 0.85);
  margin-bottom: 1.25rem;
  margin-top: 0.25rem;
}

.login-premium-mark {
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.38);
  flex-shrink: 0;
}

.login-premium-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem 1.5rem;
  text-align: left;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .login-premium-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .login-premium-hero-inner {
    max-width: 1000px;
  }

  .login-premium-features {
    gap: 1rem 2rem;
  }
}

.login-premium-features li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.87rem;
  line-height: 1.48;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--mb-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-premium-features i {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.05rem;
  color: #d1fae5;
  margin-top: 0.05rem;
}

.login-premium-card {
  border-radius: 16px !important;
}

.login-form-heading {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--mb-text);
}

.login-premium-card .auth-input-wrap .form-control {
  padding-left: 2.5rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  font-size: 0.95rem;
}

.login-premium-foot {
  font-size: 0.78rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

@media (max-width: 991.98px) {
  .login-premium-hero {
    padding-top: 2rem !important;
    padding-bottom: 2.5rem !important;
    min-height: auto;
    flex: 1 1 auto;
  }

  .login-premium-hero-inner {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
  }

  .login-premium-form-wrap {
    background: #eef2f7;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    border-left: none;
    box-shadow: none;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
  }

  .login-premium-form-inner {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .login-premium-features li {
    font-size: 0.82rem;
    padding: 0.55rem 0.75rem;
  }

  .login-premium-title {
    font-size: 1.55rem;
  }

  .login-premium-section-title {
    margin-bottom: 1rem;
  }
}

/* Início: análise IA + empilhamento da seção dívidas */
.ai-insight-card {
  border: 1px solid var(--mb-border) !important;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.ai-insight-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f59e0b, #ea580c);
  color: #fff;
  font-size: 1.1rem;
}

.ai-insight-body {
  line-height: 1.55;
}

.index-two-col-row {
  margin-bottom: 0.25rem;
}

.dashboard-debts-section {
  position: relative;
  z-index: 2;
  clear: both;
  padding-top: 0.25rem;
}

/* Previsão — gráfico */
.forecast-chart-shell {
  border-radius: var(--mb-radius);
}

.forecast-chart-head {
  background: linear-gradient(120deg, #0f766e 0%, #115e59 45%, #312e81 100%);
}

.forecast-chart-body {
  min-height: 280px;
  background: linear-gradient(180deg, #fafaf9 0%, #f5f5f4 100%);
}

.period-nav-bar .card-body {
  padding: 0.65rem 1rem;
}

/* Faturas de cartão — gráfico premium */
.invoice-chart-shell {
  border-radius: var(--mb-radius);
}

.invoice-chart-head {
  background: linear-gradient(125deg, #b45309 0%, #ea580c 38%, #0f766e 92%);
}

.invoice-chart-body {
  min-height: 300px;
  background: linear-gradient(180deg, #fffbeb 0%, #fafaf9 50%, #f5f5f4 100%);
}

.invoice-chart-body--compact {
  min-height: 200px;
  max-height: 240px;
}

.invoice-cat-chart-head {
  background: linear-gradient(125deg, #115e59 0%, #312e81 55%, #6d28d9 100%);
}

.invoice-cat-chart-body {
  min-height: 200px;
  max-height: 240px;
  background: linear-gradient(180deg, #f0fdfa 0%, #fafaf9 55%, #f5f5f4 100%);
}

.invoice-table-wrap .table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #57534e;
  border-bottom-width: 1px;
}

.invoice-row-current {
  box-shadow: inset 3px 0 0 0 #ea580c;
  background-color: rgba(254, 243, 199, 0.45) !important;
}

.invoice-pay-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---------- Mobile layout refinements ---------- */
html {
  -webkit-text-size-adjust: 100%;
}

body.app-layout-body {
  overflow-x: hidden;
}

@media (max-width: 991px) {
  .tap-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .tap-target-nav {
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-sidebar-link {
    min-height: 44px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .page-title {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  /* Cabeçalhos de página: botão não espreme o título */
  .page-toolbar-mobile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .page-toolbar-mobile .page-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-toolbar-mobile .btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Navegação de período: em telas estreitas, setas na linha de baixo ocupando largura */
  @media (max-width: 420px) {
    .period-nav-bar-inner {
      flex-direction: column;
      align-items: stretch !important;
    }

    .period-nav-arrows {
      justify-content: space-between;
      width: 100%;
      padding-top: 0.25rem;
    }

    .period-nav-arrows .btn {
      flex: 1;
      max-width: calc(50% - 6px);
      justify-content: center;
    }

    .period-nav-arrows .ml-2 {
      margin-left: 0 !important;
    }
  }

  /* Tabelas: scroll suave no iOS */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 var(--mb-radius-sm) var(--mb-radius-sm);
  }

  .card-neo .table-responsive {
    margin-left: -1px;
    margin-right: -1px;
    width: calc(100% + 2px);
  }

  /* Formulários em colunas: empilhar melhor */
  @media (max-width: 575.98px) {
    .form-row > .form-group {
      margin-bottom: 0.75rem;
    }
  }

  /* Bottom nav — área de toque */
  .app-bottom-nav a {
    min-height: 48px;
    justify-content: center;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .app-bottom-nav-menu {
    cursor: pointer;
  }

  /* Alertas não encostam nas bordas da tela */
  .app-main-full > .alert {
    margin-left: -4px;
    margin-right: -4px;
  }

  /* Previsão / gráficos: não estourar viewport */
  .forecast-chart-body,
  .invoice-chart-body {
    max-width: 100%;
  }
}

@media (min-width: 992px) {
  .page-toolbar-mobile .btn {
    white-space: nowrap;
  }
}
