/* --- VARIÁVEIS DE CORES --- */
  :root {
    --primary: #f84268; --primary-dark: #d6345a; --primary-light: #ff7597;
    --bg: #f5f6fa; --bg-card: #ffffff;
    --text: #333333; --text-light: #666;
    --border: #e0e0e0; --radius: 16px;
    --menu-bg: #ffffff;
    --grad-result: linear-gradient(135deg, #fff0f3 0%, #ffffff 100%);
    --border-result: #ffe0e6;
    --card-bg: #ffffff;
    --card-border: #eee;
    --input-bg: #f5f6fa;
    --highlight-bg: #fff5f7;
    --accent-deep: #2c3e50; 
  }
  
  body.dark-mode {
    --bg: #121212; --bg-card: #1e1e1e;
    --text: #e0e0e0; --text-light: #b0b0b0;
    --border: #333333; --menu-bg: #1e1e1e;
    --grad-result: linear-gradient(135deg, #2c2c2c 0%, #1f1f1f 100%);
    --border-result: #444;
    --card-bg: #252525;
    --card-border: #333;
    --input-bg: #121212;
    --highlight-bg: #3a1d24;
    --accent-deep: #ecf0f1; 
  }
  
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  
  body { 
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 
      background: var(--bg); 
      color: var(--text); 
      min-height: 100vh; 
      transition: background 0.3s, color 0.3s; 
      -webkit-tap-highlight-color: transparent; 
      margin: 0;
  }

  /* --- TIPOGRAFIA PARA NÚMEROS --- */
  .tabular-nums {
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.02em;
  }

  /* --- DASHBOARD E MENUS --- */
  .menu-toggle { background: none; border: none; cursor: pointer; color: white; padding: 5px; }
  .menu-dropdown { position: fixed; top: 0; right: 0; width: 280px; height: 100%; background: var(--menu-bg); z-index: 3000; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transform: translateX(100%); transition: 0.3s; overflow-y: auto; }
  .menu-dropdown.open { transform: translateX(0); }
  .menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 2999; display: none; backdrop-filter: blur(2px); }
  .menu-overlay.open { display: block; }
  .menu-profile { padding: 30px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 15px; }
  
  .profile-initial { width: 50px; height: 50px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
  
  .profile-info h4 { font-size: 14px; font-weight: 700; color: var(--text); }
  .profile-info p { font-size: 11px; color: var(--text-light); }
  .menu-list { padding: 10px 0; }
  .menu-item { padding: 15px 25px; display: flex; align-items: center; gap: 15px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; transition: 0.2s; }
  .menu-item:active { background: rgba(0,0,0,0.05); }
  .menu-item svg { width: 20px; height: 20px; color: var(--text-light); }
  
  .theme-switch { display: flex; align-items: center; justify-content: space-between; padding: 15px 25px; border-top: 1px solid var(--border); margin-top: 10px; }
  .switch { position: relative; display: inline-block; width: 40px; height: 20px; }
  .switch input { opacity: 0; width: 0; height: 0; }
  .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
  .slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
  input:checked + .slider { background-color: var(--primary); }
  input:checked + .slider:before { transform: translateX(20px); }

  .dashboard-header { background: var(--primary); color: white; padding: 20px 20px 70px 20px; border-radius: 0 0 30px 30px; box-shadow: 0 4px 15px rgba(248, 66, 104, 0.3); }
  .top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
  .app-name { font-size: 24px; font-weight: 700; letter-spacing: 0.5px; }
  
  .home-content-wrapper { max-width: 800px; margin: 0 auto; }
  
  .summary-card { 
      background: var(--bg-card); 
      color: var(--text); 
      margin: -50px 20px 25px 20px; 
      padding: 20px; 
      border-radius: 20px; 
      box-shadow: 0 10px 25px rgba(0,0,0,0.08); 
      display: flex; 
      justify-content: space-between; 
      align-items: center; 
      position: relative; 
      z-index: 5;
  }
  .summary-item strong { 
      display: block; 
      font-size: 32px; 
      color: var(--primary); 
      font-weight: 700; 
  }
  .summary-item span {
      color: var(--text-light); 
  }
  
  .recent-section { 
      padding: 45px 20px 0 20px; 
  }
  .recent-item { background: var(--bg-card); padding: 15px; border-radius: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; border-left: 5px solid var(--primary); cursor: pointer; }

  .container { padding: 20px; padding-bottom: 100px; max-width: 600px; margin: 0 auto; } 
  
  #screenCalculator .container { padding-top: 85px; }
  
  .calc-header { background: var(--bg-card); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
  .calc-header .header-title { color: var(--primary); font-weight: 700; font-size: 18px; }
  .btn-header-back { background: transparent; border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; cursor: pointer; color: var(--text-light); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 5px; transition: 0.2s; }

  .hidden { display: none !important; }
  .card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 15px; }
  .form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text-light); margin-bottom: 6px; }
  .form-input { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--input-bg); font-size: 14px; width: 100%; color: var(--text); outline: none; box-sizing: border-box; }
  
  .btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border: none; border-radius: 50px; font-weight: 700; cursor: pointer; width: 100%; font-size: 15px; transition: 0.2s; }
  .btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(248, 66, 104, 0.2); }
  .btn-outline { background: var(--bg-card); color: var(--primary); border: 1px solid var(--primary); }
  .btn-back-action { background: transparent; border: 1px solid var(--border); color: var(--text-light); margin-top: 15px; border-radius: 50px; padding: 14px; width: 100%; font-weight: 600; cursor: pointer; }

  .big-result { background: var(--grad-result); border: 1px solid var(--border-result); padding: 25px; border-radius: 20px; text-align: center; margin: 20px 0; }
  .big-result span { color: var(--text-light); display: block; font-size: 11px; text-transform: uppercase; font-weight: 600; margin-bottom: 5px; }
  .big-result strong { font-size: 38px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  
  #topFloatingBar { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 500px; background: var(--bg-card); padding: 10px 20px; border-radius: 50px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); display: none; justify-content: space-between; align-items: center; z-index: 90; border: 1px solid var(--primary); box-sizing: border-box; }
  #topFloatingBar strong { color: var(--primary); }
  
  .transparency-box { background: var(--input-bg); border-radius: 12px; padding: 15px; margin: 15px 0; border: 1px solid var(--border); }
  .transparency-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; color: var(--text); }
  .transparency-item span { font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  .transparency-item strong { color: #219653; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  #transpExtraRow { color: #d35400; font-weight: 500; border-bottom: 1px dashed var(--border); padding-bottom: 5px; margin-bottom: 10px; }
  
  .suggestion-container { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
  .suggest-card { border: 1px solid var(--card-border); padding: 15px; border-radius: 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--card-bg); transition: 0.2s; }
  .suggest-card.active { border-color: var(--primary); background: var(--highlight-bg); box-shadow: 0 4px 10px rgba(248, 66, 104, 0.1); }
  .suggest-info h4 { font-size: 15px; margin-bottom: 2px; font-weight: 800; color: var(--text); } 
  .suggest-info p { font-size: 10px; color: #999; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; } 
  .suggest-val { font-weight: 700; color: var(--primary); font-size: 16px; }

  .compare-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; color: var(--text); }
  .compare-table th { color: var(--text-light); font-weight: 500; text-align: left; padding: 10px 5px; border-bottom: 1px solid var(--border); }
  .compare-table td { padding: 12px 5px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  .row-highlight { background-color: rgba(248, 66, 104, 0.1); font-weight: 700; border-left: 4px solid var(--primary); }

  .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
  .modal-box { background: var(--bg-card); padding: 25px; border-radius: 20px; width: 90%; max-width: 320px; text-align: center; color: var(--text); }
  .modal-btn { width: 100%; padding: 15px; border: none; border-radius: 12px; margin-top: 10px; font-weight: 700; cursor: pointer; }
  .modal-btn-primary { background: var(--primary); color: #fff; }
  .modal-btn-outline { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
  .modal-btn-danger { background: #fff5f5; color: #d32f2f; border: 1px solid #ffcdd2; }
  
  .catalog-item { display: flex; flex-direction: column; gap: 12px; cursor: pointer; margin-bottom: 12px; padding: 16px; border: 1px solid var(--card-border); border-radius: 16px; background: var(--card-bg); box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: transform 0.2s, box-shadow 0.2s; }
  .catalog-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
  
  .catalog-info { display: flex; flex-direction: column; gap: 4px; }
  .catalog-info strong { font-size: 16px; color: var(--text); line-height: 1.3; word-break: break-word; }
  .catalog-price { font-size: 15px; font-weight: 700; color: var(--primary); }
  
  .catalog-details-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
  .catalog-values { display: flex; gap: 16px; }
  .catalog-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

  .btn-simular { display: flex; align-items: center; gap: 4px; background: #8e44ad; color: white; border: none; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
  .btn-simular:hover { background: #732d91; }
  .btn-simular svg { width: 14px; height: 14px; }

  .btn-icon { background: var(--input-bg); border: 1px solid var(--border); width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; color: var(--text-light); }
  .btn-icon svg { width: 16px; height: 16px; }
  .btn-edit:hover { color: #f39c12; border-color: #f39c12; background: rgba(243, 156, 18, 0.1); }
  .btn-duplicate:hover { color: #3498db; border-color: #3498db; background: rgba(52, 152, 219, 0.1); }
  .btn-delete:hover { color: #e74c3c; border-color: #e74c3c; background: rgba(231, 76, 60, 0.1); }

  .article-wrapper { background: var(--bg-card); border-radius: var(--radius); padding: 25px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 20px; line-height: 1.6; color: var(--text); border: 1px solid var(--border); }
  .article-title { font-size: 22px; font-weight: 900; color: var(--primary); margin-bottom: 10px; line-height: 1.3; }
  .article-subtitle { font-size: 14px; font-weight: 500; color: var(--text-light); margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
  .article-text p { margin-bottom: 15px; font-size: 15px; }
  .article-topic { font-size: 17px; font-weight: 700; color: var(--primary-dark); margin: 25px 0 10px 0; display: flex; align-items: center; gap: 8px; }
  .article-topic-number { background: var(--primary-light); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
  .article-highlight { background: var(--highlight-bg); border-left: 4px solid var(--primary); padding: 12px 15px; border-radius: 0 8px 8px 0; font-size: 14px; font-style: italic; margin-bottom: 15px; }
  .article-text ul { padding-left: 20px; margin-bottom: 15px; font-size: 15px; }

  .quick-actions::-webkit-scrollbar, #homeRecentList::-webkit-scrollbar { display: none; }
  
  .home-menu-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
      padding: 0 20px 30px 20px;
      max-width: 800px;
      margin: 0 auto;
  }
  .menu-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 4px 12px rgba(0,0,0,0.03);
      outline: none;
  }
  .menu-card:active {
      transform: scale(0.96);
      background: var(--highlight-bg);
      border-color: var(--primary-light);
  }
  .menu-card-icon {
      width: 54px;
      height: 54px;
      border-radius: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .menu-card-icon svg {
      width: 28px;
      height: 28px;
  }
  .menu-card span {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      text-align: center;
      line-height: 1.2;
  }
  
  .menu-card-icon.financeiro { background: linear-gradient(135deg, #3498db, #2980b9); }
  .menu-card-icon.simulador { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
  .menu-card-icon.nova { background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
  .menu-card-icon.catalogo { background: linear-gradient(135deg, #2ecc71, #27ae60); }
  .menu-card-icon.exit { background: linear-gradient(135deg, #bdc3c7, #95a5a6); }
  
  .menu-card.sair {
      grid-column: span 2;
      flex-direction: row;
      justify-content: center;
      padding: 15px;
      gap: 15px;
      border-radius: 16px;
  }
  .menu-card.sair .menu-card-icon {
      width: 40px;
      height: 40px;
      border-radius: 12px;
  }
  .menu-card.sair .menu-card-icon svg {
      width: 20px;
      height: 20px;
  }

  .quick-actions { display: none; } 
  
  .carousel-item { background: var(--bg-card); min-width: 140px; padding: 15px; border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
  .carousel-item h4 { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .carousel-item .price { font-size: 16px; font-weight: 900; color: var(--primary); }
  
  .insight-card { margin: 0 20px 20px 20px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; padding: 15px 20px; border-radius: 16px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 15px rgba(248, 66, 104, 0.3); }

  .promo-banner {
      width: 100%;
      margin-top: 30px; 
      margin-bottom: 0;
      margin-left: 0;
      margin-right: 0;
      
      background: linear-gradient(90deg, #ffffff, #fff0f3); 
      border: none; 
      border-radius: 0; 
      
      display: flex;
      align-items: center;
      padding: 15px 20px; 
      cursor: pointer;
      overflow: hidden;
      position: relative;
      text-decoration: none;
      
      box-shadow: none; 
  }
  .promo-img {
      display: none; 
  }
  .promo-marquee-container {
      flex: 1;
      overflow: hidden;
      white-space: nowrap;
      position: relative;
  }
  .promo-text {
      display: inline-block;
      font-size: 14px;
      font-weight: 800;
      color: var(--primary-dark); 
      animation: marquee 12s linear infinite;
      padding-left: 100%;
  }
  @keyframes marquee {
      0% { transform: translateX(0); }
      100% { transform: translateX(-100%); }
  }

  @media (min-width: 768px) {
      .dashboard-header { padding: 30px 40px 80px 40px; }
      .summary-card { margin: -60px auto 30px auto; max-width: 800px; padding: 30px; }
      .insight-card { max-width: 800px; margin: 0 auto 20px auto; }
      .promo-banner { 
          max-width: none; 
          margin: 30px 0 0 0;
      }
      .quick-actions { justify-content: center; }
      .recent-section { max-width: 800px; margin: 0 auto; padding-left: 0; padding-right: 0; }
      .container { max-width: 800px; }
      .calc-header { padding: 20px 40px; }
      .ingredient-grid { display: flex; gap: 15px; align-items: flex-end; }
      .ingredient-grid > div { flex: 1; }
      .ingredient-grid button { margin-bottom: 6px; }
  }
  
  .channel-btn {
      padding: 8px 16px;
      border: 1px solid var(--border);
      background: white;
      color: var(--text-light);
      border-radius: 20px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s;
  }
  .channel-btn.active {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
  }
  .dark-mode .channel-btn {
      background: var(--card-bg);
  }
  .dark-mode .channel-btn.active {
      background: var(--primary);
  }
  
  .sim-channels {
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
  }
  .sim-channels::-webkit-scrollbar {
      display: none;
  }

  .info-card {
      background: rgba(33, 150, 243, 0.05);
      border: 1px solid rgba(33, 150, 243, 0.2);
      border-radius: 12px;
      padding: 15px;
      margin: 15px 0;
      font-size: 13px;
      color: var(--text);
      line-height: 1.5;
  }
  .info-card strong {
      color: #2196f3;
      display: block;
      margin-bottom: 5px;
      font-size: 14px;
  }
  .info-card .ideal-tag {
      display: inline-block;
      background: #27ae60;
      color: white;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      margin-left: 5px;
  }


/* ============================================================
   CONTROLE FINANCEIRO — Variáveis e Estilos
   ============================================================ */

:root {
  --profit:             #10b981;
  --cost:               #f43f5e;
  --primary-glow:       rgba(248, 66, 104, 0.3);
  --fin-glass-bg:       rgba(0, 0, 0, 0.03);
  --fin-glass-border:   1px solid rgba(0, 0, 0, 0.07);
  --fin-shadow:         6px 6px 16px rgba(180, 195, 210, 0.5), -4px -4px 12px rgba(255, 255, 255, 0.9);
  --fin-shadow-inset:   inset 4px 4px 10px rgba(180, 195, 210, 0.4), inset -4px -4px 10px rgba(255, 255, 255, 0.8);
}

body.dark-mode {
  --profit:             #34d399;
  --cost:               #fb7185;
  --primary-glow:       rgba(248, 66, 104, 0.5);
  --fin-glass-bg:       rgba(255, 255, 255, 0.05);
  --fin-glass-border:   1px solid rgba(255, 255, 255, 0.09);
  --fin-shadow:         6px 6px 16px rgba(0, 0, 0, 0.5), -4px -4px 12px rgba(255, 255, 255, 0.02);
  --fin-shadow-inset:   inset 4px 4px 10px rgba(0, 0, 0, 0.5), inset -4px -4px 10px rgba(255, 255, 255, 0.02);
}

/* Privacy toggle */
#screenFinanceiro.fin-privacy-active .fin-hide-val {
  filter: blur(6px);
  opacity: 0.65;
  user-select: none;
}
.fin-hide-val { transition: filter 0.3s ease, opacity 0.3s ease; }

/* Scroll area */
.fin-scroll-area {
  overflow-y: auto;
  padding-bottom: 100px;
  height: calc(100vh - 56px);
}
.fin-scroll-area::-webkit-scrollbar { display: none; }

/* Month/week filter */
.fin-time-filter { margin: 14px 18px 10px 18px; }
.fin-months-row {
  display: flex; justify-content: center; gap: 24px; margin-bottom: 10px;
}
.fin-month-btn {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 0; border: none; background: none; transition: color 0.2s;
}
.fin-month-btn.active { color: var(--primary); }

.fin-week-row {
  display: flex; justify-content: space-between; align-items: center;
}
.fin-day-circle {
  width: 40px; height: 46px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; cursor: pointer; transition: background 0.2s;
}
.fin-day-circle .d-name { font-size: 10px; color: var(--text-light); font-weight: 500; margin-bottom: 2px; }
.fin-day-circle .d-num  { font-size: 13px; font-weight: 600; color: var(--text); }
.fin-day-circle.active  { background: var(--primary); box-shadow: 0 4px 10px var(--primary-glow); }
.fin-day-circle.active .d-name,
.fin-day-circle.active .d-num  { color: #fff; }

/* Tabs (shared by main tabs and bottom sheet) */
.fin-tabs-container {
  margin: 0 18px 14px 18px;
  background: var(--fin-glass-bg);
  border-radius: 20px; padding: 4px;
  display: flex;
  box-shadow: var(--fin-shadow-inset);
  border: var(--fin-glass-border);
}
.fin-tab-btn {
  flex: 1; padding: 10px 0; text-align: center;
  border-radius: 16px; font-size: 12px; font-weight: 600;
  color: var(--text-light); cursor: pointer; transition: all 0.3s ease;
  border: none; background: transparent;
}
.fin-tab-btn.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 10px var(--primary-glow);
}

/* Glass card */
.fin-card-glass {
  background: var(--fin-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--fin-glass-border);
  border-radius: 24px;
  box-shadow: var(--fin-shadow);
}

/* Dashboard card */
.fin-unified-dashboard {
  margin: 0 18px 14px 18px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 18px;
}

.fin-saldo-header {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.fin-saldo-info  { display: flex; flex-direction: column; gap: 4px; }
.fin-lbl         { font-size: 12px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.fin-val-main    { font-size: 30px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }

.fin-btn-privacy {
  background: none; border: none; color: var(--text-light); cursor: pointer; padding: 4px;
}
.fin-btn-privacy:hover { color: var(--primary); }
.fin-btn-privacy svg {
  width: 22px; height: 22px; stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

.fin-stats-row { display: flex; justify-content: space-between; }
.fin-stat-col   { display: flex; flex-direction: column; gap: 4px; }
.fin-stat-col.right { text-align: right; align-items: flex-end; }
.fin-val-sub    { font-size: 18px; font-weight: 600; }
.fin-val-sub.up   { color: var(--profit); }
.fin-val-sub.down { color: var(--cost); }

.fin-divider { border: none; border-top: 1px dashed var(--border); margin: 0; }

/* Chart */
.fin-chart        { display: flex; flex-direction: column; gap: 14px; }
.fin-chart-header { display: flex; justify-content: space-between; align-items: center; }
.fin-legend       { display: flex; gap: 12px; }
.fin-legend-item  { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-light); }
.fin-legend-dot   { width: 8px; height: 8px; border-radius: 50%; }
.fin-legend-dot.entradas { background: var(--profit); box-shadow: 0 0 4px var(--profit); }
.fin-legend-dot.saidas   { background: var(--cost);   box-shadow: 0 0 4px var(--cost); }

.fin-bar-wrapper {
  display: flex; justify-content: space-between; align-items: flex-end;
  height: 110px; border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.fin-bar-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1;
}
.fin-bar-col.active .fin-bar-lbl { color: var(--text); font-weight: 700; }
.fin-bar-track {
  width: 14px; height: 80px; background: rgba(0,0,0,0.04); border-radius: 8px;
  display: flex; align-items: flex-end; position: relative;
}
body.dark-mode .fin-bar-track { background: rgba(255,255,255,0.04); }
.fin-bar-fill {
  width: 100%; border-radius: 8px; position: absolute; bottom: 0; transition: height 0.5s ease;
}
.fin-bar-fill.entradas { background: var(--profit); box-shadow: 0 0 6px rgba(52,211,153,0.4); z-index: 1; }
.fin-bar-fill.saidas   { background: var(--cost);   box-shadow: 0 0 6px rgba(251,113,133,0.4); z-index: 2; }
.fin-bar-lbl { font-size: 11px; color: var(--text-light); font-weight: 500; }

/* Predict card */
.fin-predict-card {
  margin: 0 18px 14px 18px;
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.fin-predict-col       { display: flex; flex-direction: column; gap: 3px; }
.fin-predict-col.right { text-align: right; align-items: flex-end; }
.fin-predict-div       { width: 1px; height: 28px; background: var(--border); }

/* Chips */
.fin-chips-container {
  display: flex; gap: 8px;
  padding: 0 18px 8px 18px;
  overflow-x: auto; scrollbar-width: none;
}
.fin-chips-container::-webkit-scrollbar { display: none; }
.fin-chip {
  background: var(--fin-glass-bg); border: var(--fin-glass-border);
  color: var(--text-light); padding: 6px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: all 0.25s ease;
}
.fin-chip.active {
  background: var(--text); color: var(--bg);
}
body.dark-mode .fin-chip.active { background: var(--text); color: var(--bg-card); }

/* Transaction list */
.fin-tx-list { padding: 0 18px 20px 18px; }
.fin-tx-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--fin-glass-bg); border: var(--fin-glass-border);
  border-radius: 14px; margin-bottom: 8px;
}
.fin-tx-left  { display: flex; flex-direction: column; gap: 2px; }
.fin-tx-cat   { font-size: 12px; font-weight: 700; color: var(--text); }
.fin-tx-date  { font-size: 11px; color: var(--text-light); }
.fin-tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.fin-tx-val   { font-size: 15px; font-weight: 700; }
.fin-tx-val.up   { color: var(--profit); }
.fin-tx-val.down { color: var(--cost); }
.fin-tx-status {
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 8px; text-transform: uppercase;
}
.fin-tx-status.pago    { background: rgba(16,185,129,0.15); color: var(--profit); }
.fin-tx-status.pendente{ background: rgba(248,66,104,0.12);  color: var(--cost); }
.fin-tx-del {
  background: none; border: none; color: var(--text-light);
  cursor: pointer; font-size: 16px; padding: 2px 6px; transition: color 0.2s;
}
.fin-tx-del:hover { color: var(--cost); }
.fin-tx-empty {
  text-align: center; color: var(--text-light); padding: 30px 0;
  font-size: 13px; font-style: italic;
}

/* FAB button */
.fin-fab {
  position: fixed; bottom: 22px; right: 22px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px var(--primary-glow);
  cursor: pointer; z-index: 200; border: none;
  transition: transform 0.2s ease;
}
.fin-fab:active { transform: scale(0.94); }
.fin-fab svg { width: 26px; height: 26px; stroke: currentColor; stroke-linecap: round; transition: transform 0.3s; }
.fin-fab.open svg { transform: rotate(45deg); }

/* Bottom sheet overlay */
.fin-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.fin-overlay.active { opacity: 1; pointer-events: auto; }

/* Bottom sheet */
.fin-bottom-sheet {
  position: fixed; bottom: -100%; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 600px;
  background: var(--bg-card);
  border-top-left-radius: 28px; border-top-right-radius: 28px;
  padding: 20px 20px 40px 20px;
  z-index: 400;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-top: var(--fin-glass-border);
}
.fin-bottom-sheet.active { bottom: 0; }
.fin-sheet-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 0 auto 20px auto;
}

/* Modal input (inside bottom sheet) */
.fin-modal-input {
  width: 100%; padding: 14px 16px;
  border-radius: 14px; border: var(--fin-glass-border);
  background: var(--input-bg); color: var(--text);
  font-size: 15px; outline: none;
  box-shadow: var(--fin-shadow-inset);
  transition: border-color 0.3s;
  box-sizing: border-box;
}
.fin-modal-input:focus { border-color: var(--primary); }
.fin-modal-subtitle {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Submit button */
.fin-submit-btn {
  width: 100%; padding: 15px; border-radius: 14px;
  background: var(--profit); color: #fff; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.2s;
}
.fin-submit-btn:active { transform: scale(0.98); }
