:root{
  /* ============================================
     DESIGN SYSTEM - Fundo Branco + Azul
     ============================================ */
  
  /* Cores Azuis */
  --bb-blue-900: #1a365d;
  --bb-blue-800: #1e4175;
  --bb-blue-700: #2c5aa0;
  --bb-blue-600: #3b6db5;
  --bb-blue-500: #4a7bc8;
  --bb-blue-400: #6b9de8;
  --bb-blue-300: #8bb8f8;
  --bb-blue-200: #b3d1fc;
  --bb-blue-100: #dbeafe;
  --bb-blue-50: #eff6ff;
  
  /* Verde (para sucesso) */
  --bb-green-600: #16a34a;
  --bb-green-500: #22c55e;
  --bb-green-100: #dcfce7;
  --bb-green-50: #f0fdf4;
  
  /* Amarelo (alertas) */
  --bb-yellow-600: #ca8a04;
  --bb-yellow-500: #eab308;
  --bb-yellow-400: #facc15;
  --bb-yellow-100: #fef9c3;
  --bb-yellow-50: #fefce8;
  
  /* Cores do sistema (compatibilidade) */
  --rfb-blue-dark: var(--bb-blue-800);
  --rfb-blue: var(--bb-blue-700);
  --rfb-blue-light: var(--bb-blue-500);
  --rfb-blue-lighter: var(--bb-blue-400);
  
  --rfb-green: var(--bb-green-600);
  --rfb-green-light: var(--bb-green-500);
  
  --rfb-yellow: var(--bb-yellow-500);
  --rfb-yellow-light: var(--bb-yellow-400);
  
  --rfb-gray-dark: #1f2937;
  --rfb-gray: #6b7280;
  --rfb-gray-light: #e5e7eb;
  --rfb-white: #ffffff;
  
  /* Backgrounds - Padrão Cinza Claro e Branco */
  --bb-bg: #f8fafc;
  --bb-bg-solid: #ffffff;
  --bb-card: #ffffff;
  --bb-card-hover: #f1f5f9;
  
  /* Textos - Padrão para fundo claro */
  --bb-text: #1f2937;
  --bb-text-muted: #6b7280;
  --bb-text-light: #9ca3af;
  
  /* Bordas e divisores */
  --bb-line: rgba(0, 0, 0, 0.06);
  --bb-line-strong: rgba(0, 0, 0, 0.1);
  
  /* Sombras suaves */
  --bb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --bb-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --bb-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --bb-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  
  /* Radius */
  --bb-radius-sm: 12px;
  --bb-radius: 16px;
  --bb-radius-md: 20px;
  --bb-radius-lg: 24px;
  --bb-radius-full: 999px;
  
  /* Compatibilidade com variáveis antigas */
  --bg: var(--bb-bg);
  --bg2: var(--bb-blue-50);
  --bg-secondary: rgba(241, 245, 249, 0.8); /* Fundo cinza claro para cards */
  --card: var(--bb-card);
  --card2: var(--bb-card-hover);
  --text: var(--bb-text);
  --muted: var(--bb-text-muted);
  --line: var(--bb-line);
  --accent: var(--bb-blue-700);
  --accent2: var(--bb-blue-500);
  --ok: var(--bb-green-600);
  --warn: var(--bb-yellow-500);
  --bad: #dc2626;
  --white: #ffffff;
  --soft: rgba(0, 0, 0, 0.04);
  --soft2: rgba(0, 0, 0, 0.06);
  --radius: var(--bb-radius);
  --shadow: var(--bb-shadow);
  --fs: 16px;
}
html{ 
  font-size: var(--fs);
  scroll-behavior: smooth;
}
body{
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: white;
  color: var(--bb-text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}
.wrap{ 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 16px;
  padding-bottom: 100px;
}
@media (min-width: 768px) {
  .wrap{ 
    padding: 24px;
    padding-bottom: 40px;
  }
}

/* ============================================
   APP HEADER - Fundo Branco + Azul
   ============================================ */
header{
  background: var(--bb-card);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
  padding: 16px 20px;
  position: sticky;
  top: 16px;
  z-index: 1000;
  margin-bottom: 20px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
}

/* Brand Logo - Responsivo */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.brand-logo-horizontal {
  height: 60px;
  width: auto;
  max-width: 400px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-fallback {
  display: none;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* Fallback quando imagem não carrega */
.brand img[style*="display: none"] + .brand-fallback {
  display: flex !important;
}

/* Mobile: usar ícone ou reduzir logo */
@media (max-width: 768px) {
  .brand-logo-horizontal {
    height: 40px;
    max-width: 220px;
  }
  
  .brand-fallback .brand-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .brand-fallback .brand-text strong {
    font-size: 0.95rem;
  }
  
  .brand-fallback .brand-text span {
    font-size: 0.75rem;
  }
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--bb-radius-sm);
  background: linear-gradient(135deg, var(--bb-blue-700), var(--bb-blue-500));
  box-shadow: var(--bb-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-text strong {
  display: block;
  color: var(--bb-blue-700);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text span {
  display: block;
  color: var(--bb-text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* Saudação */
.greeting {
  color: var(--bb-text);
  font-size: 1.25rem;
  font-weight: 600;
}
.greeting-sub {
  color: var(--bb-text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

h1{ margin:0; font-size: 1.35rem; color: var(--rfb-blue); }
h1 a{ color: var(--rfb-blue); }

/* Menu Hambúrguer - Estilo BB */
.menu-toggle{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: var(--bb-radius-sm);
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.menu-toggle:hover {
  background: rgba(255,255,255,0.2);
}
.menu-toggle:active {
  transform: scale(0.95);
}
.menu-toggle span{
  width: 20px;
  height: 2px;
  background: var(--bb-blue-700);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.menu-toggle.active {
  background: rgba(255,255,255,0.2);
}
.menu-toggle.active span:nth-child(1){
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2){
  opacity: 0;
  transform: translateX(-10px);
}
.menu-toggle.active span:nth-child(3){
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Menu de Navegação - Drawer/Modal Style BB */
.main-nav{
  display: none;
  flex-direction: column;
  gap: 2px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bb-card);
  border-radius: var(--bb-radius-lg) var(--bb-radius-lg) 0 0;
  padding: 12px 20px 32px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
  z-index: 1002;
  max-height: 70vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.main-nav.active{
  display: flex;
}
/* Handle do modal */
.main-nav::before {
  content: '';
  width: 40px;
  height: 4px;
  background: var(--bb-line-strong);
  border-radius: 2px;
  margin: 0 auto 16px;
  flex-shrink: 0;
}
/* Overlay quando menu aberto */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
  animation: fadeIn 0.2s ease;
}
.nav-overlay.active {
  display: block;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nav-user{
  padding: 16px;
  color: var(--bb-text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--bb-line);
  padding-bottom: 16px;
  background: var(--bb-blue-50);
  border-radius: var(--bb-radius-sm);
}
.nav-user strong{
  color: var(--bb-blue-700);
  font-weight: 700;
}

.nav-link{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: var(--bb-text);
  text-decoration: none;
  border-radius: var(--bb-radius-sm);
  transition: all 0.2s ease;
  font-size: 1rem;
  font-weight: 500;
  min-height: 52px;
  background: transparent;
  border-bottom: 1px solid var(--bb-line);
}
.nav-link:last-of-type {
  border-bottom: none;
}
.nav-link:hover,
.nav-link:focus{
  background: var(--bb-blue-50);
  color: var(--bb-blue-700);
}
.nav-link:active{
  background: var(--bb-blue-100);
}
.nav-link span{
  font-size: 1.3rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
/* Seta à direita nos links */
.nav-link::after {
  content: '›';
  margin-left: auto;
  font-size: 1.4rem;
  color: var(--bb-text-muted);
  font-weight: 300;
}
.nav-link-danger{
  color: #dc2626;
  margin-top: 12px;
  border-top: 1px solid var(--bb-line);
  padding-top: 16px;
  border-bottom: none;
}
.nav-link-danger:hover,
.nav-link-danger:focus{
  background: #fef2f2;
  color: #dc2626;
}

/* Chat notification badge */
.nav-link-chat{
  position: relative;
}
.chat-notification{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #dc2626;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--bb-radius-full);
  margin-left: 8px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Partner Banners Carousel */
.partner-carousel{
  position: relative;
  overflow: hidden;
  margin: 15px 0;
  border-radius: var(--radius, 8px);
  max-width: 100%;
}
.partner-carousel-track{
  display: flex;
  transition: transform 0.5s ease;
  width: 100%;
}
.partner-slide{
  min-width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  background: linear-gradient(135deg, #e3f2fd, #fff);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  height: 120px;
}
.partner-slide-image{
  width: 150px;
  min-width: 150px;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 8px;
}
.partner-slide-content{
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.partner-slide-title{
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #1f1f1f);
  margin: 0 0 4px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-slide-partner{
  font-size: 0.8rem;
  color: var(--muted, #666666);
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-slide-discount{
  display: inline-block;
  background: var(--ok, #009739);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 6px;
  align-self: flex-start;
}
.partner-slide-code{
  background: #fff3cd;
  color: #856404;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 6px;
  display: inline-block;
  align-self: flex-start;
}
.partner-slide-btn{
  display: inline-block;
  background: var(--accent, #2c5aa0);
  color: white;
  padding: 6px 16px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
  align-self: flex-start;
  margin-top: auto;
}
.partner-slide-btn:hover{
  background: var(--rfb-blue-dark, #1f4788);
  transform: translateY(-1px);
}
.partner-carousel-dots{
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}
.partner-carousel-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,.2);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.partner-carousel-dot.active{
  background: var(--accent, #2c5aa0);
  transform: scale(1.3);
}
.partner-carousel-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card, #ffffff);
  border: 1px solid rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text, #1f1f1f);
  transition: all 0.2s;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.partner-carousel-nav:hover{
  background: #e3f2fd;
  border-color: #4a7bc8;
}
.partner-carousel-nav.prev{ left: 8px; }
.partner-carousel-nav.next{ right: 8px; }

@media (max-width: 767px) {
  .partner-slide{
    height: 100px;
  }
  .partner-slide-image{
    width: 120px;
    min-width: 120px;
  }
  .partner-slide-content{
    padding: 8px 12px;
  }
  .partner-slide-title{
    font-size: 0.9rem;
  }
  .partner-slide-partner{
    font-size: 0.75rem;
  }
  .partner-slide-btn{
    padding: 5px 12px;
    font-size: 0.8rem;
  }
  .partner-carousel-nav{ 
    width: 28px; 
    height: 28px; 
    font-size: 0.9rem; 
  }
  .partner-carousel-nav.prev{ left: 4px; }
  .partner-carousel-nav.next{ right: 4px; }
}

.tools{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
/* ============================================
   BOTÕES - Estilo Banco do Brasil
   ============================================ */
button,
.btn{
  border: none;
  background: var(--bb-card);
  color: var(--bb-text);
  padding: 14px 24px;
  border-radius: var(--bb-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--bb-shadow-sm);
  min-height: 48px;
  text-decoration: none;
  font-family: inherit;
}
button:hover,
.btn:hover{
  background: var(--bb-card-hover);
  box-shadow: var(--bb-shadow);
}
button:active,
.btn:active{
  transform: scale(0.98);
}
@media (max-width: 767px) {
  button,
  .btn{
    padding: 14px 20px;
    min-height: 48px;
    font-size: 0.95rem;
  }
}

/* Botão Primário - Azul */
.btn-primary{
  background: var(--bb-blue-700);
  color: #ffffff;
  box-shadow: var(--bb-shadow);
  font-weight: 700;
  border-radius: var(--bb-radius-sm);
  padding: 14px 24px;
}
.btn-primary:hover,
.btn-primary:focus{ 
  background: var(--bb-blue-600);
  box-shadow: var(--bb-shadow-md);
}
.btn-primary:active{ 
  transform: scale(0.98);
}

/* Botão Secundário - Contorno Azul */
.btn-secondary{
  background: transparent;
  color: var(--bb-blue-700);
  border: 2px solid var(--bb-blue-700);
  box-shadow: none;
}
.btn-secondary:hover,
.btn-secondary:focus{
  background: var(--bb-blue-50);
  color: var(--bb-blue-700);
}

/* Botão Ghost */
.btn-ghost{
  background: transparent;
  color: var(--bb-text-muted);
  box-shadow: none;
}
.btn-ghost:hover,
.btn-ghost:focus{
  background: var(--soft);
  color: var(--bb-text);
}

/* Quick Action Buttons */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--bb-card);
  border-radius: var(--bb-radius-sm);
  text-decoration: none;
  color: var(--bb-text);
  transition: all 0.2s ease;
  box-shadow: var(--bb-shadow-sm);
}
.quick-action:hover {
  box-shadow: var(--bb-shadow);
  transform: translateY(-2px);
}
.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bb-blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.quick-action-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  color: var(--bb-text-muted);
}
@media (max-width: 767px) {
  .btn-primary{
    width: 100%;
    padding: 16px 24px;
    font-size: 1.05rem;
  }
}
/* Botões circulares para ícones */
.btn-circle{
  border-radius: 50% !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.btn-circle-small{
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.9rem !important;
}

/* Botões de ação (Salvar, Editar, Apagar) - Circulares - Estilo Receita Federal */
.btn-action{
  border-radius: 50% !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(0,0,0,.1) !important;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  font-size: 0 !important;
  line-height: 0 !important;
}
.btn-action:hover{
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  border-color: rgba(0,0,0,.15) !important;
}
.btn-action:active{
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.btn-action svg{
  width: 20px !important;
  height: 20px !important;
  fill: none !important;
  stroke: #1f4788 !important;
  stroke-width: 2.5 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
.btn-save{
  background: #e3f2fd !important;
  border-color: #90caf9 !important;
}
.btn-save:hover{
  background: #bbdefb !important;
  border-color: #64b5f6 !important;
}
.btn-save svg{
  stroke: #1976d2 !important;
}
.btn-edit{
  background: #e3f2fd !important;
  border-color: #90caf9 !important;
}
.btn-edit:hover{
  background: #bbdefb !important;
  border-color: #64b5f6 !important;
}
.btn-edit svg{
  stroke: #1976d2 !important;
}
.btn-delete{
  background: #ffebee !important;
  border-color: #ef9a9a !important;
}
.btn-delete:hover{
  background: #ffcdd2 !important;
  border-color: #e57373 !important;
}
.btn-delete svg{
  stroke: #c62828 !important;
}
@media (max-width: 767px) {
  .btn-action{
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }
  .btn-action svg{
    width: 18px !important;
    height: 18px !important;
  }
}
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (min-width: 980px){
  .grid{ grid-template-columns: 1.1fr .9fr; }
}
/* ============================================
   CARDS - Estilo Banco do Brasil
   ============================================ */
.card{
  background: var(--bb-card);
  border: none;
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
  padding: 20px;
  margin-top: 16px;
  transition: all 0.2s ease;
  color: #1f2937; /* Texto escuro para cards brancos */
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
  color: #1f2937 !important; /* Títulos escuros em cards brancos */
}

.card p, .card span:not(.badge):not([style*="color"]), .card div:not([style*="color"]) {
  color: #1f2937; /* Texto escuro em cards brancos */
}
.card:hover{
  box-shadow: var(--bb-shadow-md);
}
@media (max-width: 767px) {
  .card{
    padding: 16px;
    margin-top: 12px;
    border-radius: var(--bb-radius);
  }
}
.card:first-of-type{ 
  margin-top: 0; 
}
.card h2{ 
  margin: 0 0 16px; 
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bb-text);
  line-height: 1.3;
}
.card h3{
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bb-text);
}
/* Card de saldo estilo BB */
.card-balance {
  background: linear-gradient(135deg, var(--bb-green-600), var(--bb-green-500));
  color: #ffffff;
  border-radius: var(--bb-radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-balance h2 {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.card-balance .balance-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
}
.card-balance .balance-negative {
  color: #FF8A80;
}
.muted{ color: var(--muted); }
.note{
  background: var(--bb-yellow-50);
  border: 2px solid var(--bb-yellow-400);
  color: #856404;
  padding: 16px 20px;
  border-radius: var(--bb-radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: var(--bb-shadow-sm);
}
.note strong{ 
  color: #856404; 
  font-weight: 700;
}
.ok,
.alert-success{
  background: #d4edda;
  border: 2px solid #28a745;
  color: #155724;
  padding: 16px 20px;
  border-radius: var(--bb-radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: var(--bb-shadow-sm);
}
.ok strong,
.alert-success strong{
  color: #155724;
  font-weight: 700;
}
.warnbox{
  background: var(--bb-yellow-50);
  border: 2px solid var(--bb-yellow-400);
  color: #856404;
  padding: 16px 20px;
  border-radius: var(--bb-radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 10px;
  display: none;
  box-shadow: var(--bb-shadow-sm);
}
.dangerbox,
.alert-error{
  background: #f8d7da;
  border: 2px solid #dc3545;
  color: #721c24;
  padding: 16px 20px;
  border-radius: var(--bb-radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 10px;
  display: block;
  box-shadow: var(--bb-shadow-sm);
}
.dangerbox strong,
.alert-error strong{
  color: #721c24;
  font-weight: 700;
}
.row{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0 0;
}
@media (min-width: 760px){
  .row.cols2{ grid-template-columns: 1fr 1fr; }
  .row.cols3{ grid-template-columns: 1fr 1fr 1fr; }
}
label{ display:block; font-weight:700; margin-bottom:6px; }
/* ============================================
   INPUTS - Estilo Banco do Brasil
   ============================================ */
input, 
select, 
textarea{
  width: 100%;
  box-sizing: border-box;
  border: 2px solid var(--bb-line);
  border-radius: var(--bb-radius-sm);
  padding: 14px 18px;
  background: var(--bb-card);
  color: var(--bb-text);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
input:hover,
select:hover,
textarea:hover{
  border-color: var(--bb-blue-300);
  background: var(--bb-blue-50);
}
@media (max-width: 767px) {
  input, 
  select, 
  textarea{
    padding: 16px 18px;
    font-size: 16px; /* Evita zoom no iOS */
    min-height: 52px;
  }
}
input:focus, 
select:focus, 
textarea:focus{
  outline: none;
  border-color: var(--bb-blue-500);
  background: var(--bb-card);
  box-shadow: 0 0 0 4px rgba(44, 90, 160, 0.1);
}
input::placeholder,
textarea::placeholder{
  color: var(--bb-text-muted);
  opacity: 0.6;
}
.mini{ font-size:.9rem; color: var(--muted); margin-top:6px; line-height:1.35; }
.hr{ height:1px; background: var(--line); margin: 14px 0; }
.income-item{
  border:1px solid #e0e0e0;
  background: #fafafa;
  border-radius: 8px;
  padding: 12px;
  display:grid;
  gap: 10px;
  margin-top: 10px;
}
.income-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.income-title{ font-weight:800; }
.danger-link{ color: var(--bad); font-weight:800; cursor:pointer; }
.danger-link:hover{ text-decoration: underline; color: #f87171; }
.cards4{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (min-width: 760px){
  .cards4{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1040px){
  .cards4{ grid-template-columns: 1fr 1fr 1fr 1fr; }
}
.kpi{
  border:1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.kpi .t{ font-size:.9rem; color: var(--muted); font-weight: 750; }
.kpi .v{ font-size: 1.25rem; font-weight: 900; margin-top:4px; color: var(--text); }
.badge{
  display:inline-block;
  padding: 6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:.9rem;
  border:1px solid #d0d0d0;
  background: #f5f5f5;
}
.badge.ok{ background: #d4edda; border-color: #28a745; color: #155724; }
.badge.bad{ background: #f8d7da; border-color: #dc3545; color: #721c24; }
.badge.neu{ background: #e3f2fd; border-color: var(--rfb-blue); color: var(--rfb-blue-dark); }
table{
  width:100%;
  border-collapse:collapse;
  margin-top: 10px;
  font-size: .95rem;
}
th, td{
  padding: 10px;
  border-bottom:1px solid #e0e0e0;
  vertical-align:top;
}
th{ text-align:left; color: var(--muted); font-weight: 850; background: #f5f5f5; }
.right{ text-align:right; }
/* Footer */
.footer{
  margin: 40px 0 0;
  padding: 24px 20px;
  text-align: center;
  border-top: 1px solid var(--bb-line);
  color: var(--bb-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--bb-card);
  border-radius: var(--bb-radius-sm);
  box-shadow: var(--bb-shadow-sm);
}

.footer-link {
  color: var(--bb-blue-700);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--bb-blue-500);
  text-decoration: underline;
}

/* ============================================
   BOTTOM NAVIGATION BAR - Estilo Banco do Brasil
   ============================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bb-card);
  border-top: none;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  z-index: 999;
  padding: 8px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-radius: var(--bb-radius-lg) var(--bb-radius-lg) 0 0;
}

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

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  text-decoration: none;
  color: var(--bb-text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  min-width: 50px;
  transition: all 0.2s ease;
  border-radius: var(--bb-radius-sm);
  flex: 1;
  position: relative;
}

.bottom-nav-item span:first-child {
  font-size: 1.4rem;
  line-height: 1;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus,
.bottom-nav-item.active {
  color: var(--bb-blue-700);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--bb-blue-700);
  border-radius: 50%;
}

/* Install Banner */
.install-banner {
  background: var(--bb-blue-50);
  border: 1px solid var(--bb-blue-200);
  border-radius: var(--bb-radius-sm);
  padding: 16px 20px;
  margin-top: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--bb-shadow);
}

.install-banner-content {
  flex: 1;
  min-width: 200px;
}

.install-banner-content strong {
  color: var(--bb-blue-700);
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.install-banner-content span {
  color: var(--bb-text-muted);
  font-size: 0.9rem;
}

.install-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.9rem;
  min-height: 40px;
}

.btn-close {
  width: 36px;
  height: 36px;
  padding: 0;
  min-height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--bb-text-muted);
  background: transparent;
  border: none;
  box-shadow: none;
}

.btn-close:hover {
  background: var(--bb-blue-100);
  color: var(--bb-blue-700);
  transform: scale(1.1);
}
.chip{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-weight: 850;
  font-size: .9rem;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-weight: 800;
  flex-wrap:wrap;
}
.pricing-card{
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pricing-card.featured{
  border-color: var(--accent);
  transform: scale(1.05);
}
.pricing-price{
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  margin: 10px 0;
}
.pricing-features{
  list-style: none;
  padding: 0;
  margin: 20px 0;
  text-align: left;
}
.pricing-features li{
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.pricing-features li:last-child{
  border-bottom: none;
}
.hero{
  text-align: center;
  padding: 40px 20px;
}
.hero h1{
  font-size: 2.5rem;
  margin-bottom: 20px;
}
.hero .sub{
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}
.example-box{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}
.example-box h3{
  margin-top: 0;
  color: var(--accent);
}
@media print{
  .no-print{ display: none !important; }
  body{ background: white; }
  .card{ border: 1px solid #ccc; box-shadow: none; }
}

/* ============================================
   ESTILOS DO QUESTIONÁRIO PASSO A PASSO
   ============================================ */

.questionnaire-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Barra de Progresso */
.progress-bar {
  margin-bottom: 40px;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  position: relative;
}

.step-indicator {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 2;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  border: 3px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  margin: 0 auto 10px;
  transition: all 0.3s ease;
}

.step-indicator.active .step-number {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: scale(1.1);
}

.step-indicator.completed .step-number {
  background: var(--ok);
  border-color: var(--ok);
  color: white;
}

.step-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.step-indicator.active .step-label {
  color: var(--accent);
  font-weight: 800;
}

.progress-line {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  position: relative;
  margin-top: -30px;
  z-index: 1;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

/* Passos do Questionário */
.question-step {
  display: none;
  animation: fadeIn 0.4s ease;
}

.question-step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  border: 1px solid var(--line);
}

.question-header {
  text-align: center;
  margin-bottom: 40px;
}

.question-header h2 {
  font-size: 1.8rem;
  margin: 0 0 15px;
  color: var(--text);
}

.question-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0;
}

/* Seleção de Tipos de Renda */
.income-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.income-type-card {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 25px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255,255,255,.03);
}

.income-type-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(31, 71, 136, 0.3);
  background: rgba(255,255,255,.05);
}

.income-type-card.selected {
  border-color: var(--accent);
  background: #e3f2fd;
  box-shadow: 0 4px 12px rgba(31, 71, 136, 0.2);
}

.income-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.income-type-card h3 {
  margin: 10px 0 5px;
  font-size: 1.1rem;
  color: var(--text);
}

.income-type-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.selected-incomes {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid var(--line);
}

.selected-incomes h3 {
  margin-bottom: 20px;
  color: var(--text);
}

.selected-income-item {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Grupos de Perguntas */
.question-group {
  margin-bottom: 30px;
}

.question-label {
  display: block;
}

.label-text {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--text);
}

.question-input {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.question-input {
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.question-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 71, 136, 0.15);
  background: rgba(255,255,255,.06);
}

.input-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

/* Toggle Switch */
.expenses-toggle {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255,255,255,.03);
  border-radius: 16px;
  border: 1px solid var(--line);
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 60px;
  height: 30px;
  background: var(--line);
  border-radius: 30px;
  position: relative;
  transition: background 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(30px);
}

.toggle-label {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.expenses-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--line);
}

/* Botões de Ação */
.question-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.btn-large {
  padding: 18px 40px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 12px;
}

.btn-secondary {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 2px solid var(--line);
}

.btn-secondary:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
}

/* Resultado */
.result-header {
  text-align: center;
  margin-bottom: 40px;
}

.result-card {
  text-align: center;
  padding: 50px 30px;
  background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.result-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.result-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 15px;
  color: var(--text);
}

.result-amount {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 15px;
}

.result-card.pay .result-amount {
  color: var(--bad);
}

.result-card.receive .result-amount {
  color: var(--ok);
}

.result-description {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.result-details {
  background: rgba(255,255,255,.03);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid var(--line);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row.highlight {
  background: #e3f2fd;
  margin: 10px -10px;
  padding: 15px 10px;
  border-radius: 8px;
  border: 2px solid var(--accent);
}

.detail-label {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}

.detail-value {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--accent);
}

.detail-row.highlight .detail-value {
  color: var(--accent);
  font-size: 1.4rem;
}

.result-note {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 20px;
  margin-top: 30px;
  color: #856404;
  font-size: 0.95rem;
  line-height: 1.6;
}
.result-note strong { color: #856404; }

/* Responsivo */
/* Cards de renda no passo 2 */
.income-card-step2 {
  background: rgba(255,255,255,.03);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.income-card-step2:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(31, 71, 136, 0.25);
  background: rgba(255,255,255,.05);
}

.income-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 15px;
}

.selected-income-item {
  background: var(--soft2);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.selected-income-item:hover {
  border-color: var(--accent);
  background: #f0f7ff;
}

.btn-remove-income {
  transition: all 0.3s ease;
}

.btn-remove-income:hover {
  background: #991b1b !important;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .question-card {
    padding: 25px 20px;
  }
  
  .question-header h2 {
    font-size: 1.4rem;
  }
  
  .income-types-grid {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  
  .step-label {
    font-size: 0.75rem;
  }
  
  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .result-amount {
    font-size: 2rem;
  }
  
  .question-actions {
    flex-direction: column;
  }
  
  .btn-large {
    width: 100%;
  }

  .income-card-header {
    flex-direction: column;
  }

  .selected-income-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn-remove-income {
    width: 100%;
  }
}

/* Estilos adicionais para aparência de App */
@media (max-width: 767px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .wrap {
    padding: 8px;
  }
  
  h1 {
    font-size: 1.2rem;
  }
  
  h2 {
    font-size: 1.1rem;
  }
  
  .card h2 {
    font-size: 1rem;
  }
  
  /* Melhorar espaçamento em mobile */
  .row {
    margin-bottom: 16px;
  }
  
  /* Touch targets maiores */
  a, button, .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Scroll suave */
  html {
    scroll-behavior: smooth;
  }
  
  /* Prevenir seleção acidental */
  .menu-toggle, .nav-link {
    user-select: none;
    -webkit-user-select: none;
  }
}

/* Melhorias gerais para App */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Animações suaves */
.main-nav {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Safe area para dispositivos com notch */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}
