/* ============================================
   FundoSmart - Design System
   Dark + Teal Professional (Technoai style)
   ============================================ */

:root {
  --bg-deep:      #060a12;
  --bg-dark:      #0b1120;
  --bg-card:      #0f1726;
  --bg-card-hover:#141e30;
  --bg-input:     rgba(255,255,255,0.05);
  --border:       rgba(0,201,167,0.12);
  --border-focus: rgba(0,201,167,0.5);

  --primary:      #00c9a7;
  --primary-dark: #00a889;
  --secondary:    #0085ff;
  --accent:       #7c6bff;
  --success:      #10d9a0;
  --warning:      #f59e0b;
  --danger:       #f87171;
  --danger-dark:  #dc2626;

  --grad-primary: linear-gradient(135deg, #00c9a7 0%, #0085ff 100%);
  --grad-purple:  linear-gradient(135deg, #7c6bff 0%, #5b4de0 100%);
  --grad-success: linear-gradient(135deg, #10d9a0 0%, #059669 100%);
  --grad-danger:  linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  --grad-warm:    linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-bg:      linear-gradient(160deg, #0b1120 0%, #060a12 50%, #0c1422 100%);

  --text:         #e2e8f0;
  --text-muted:   #8899aa;
  --text-faint:   #4a5568;

  --sidebar-w:    260px;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    22px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-glow:  0 0 30px rgba(0,201,167,0.15);
  --transition:   all 0.2s ease;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Fundo dark com glow teal ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(0,133,255,0.1) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(0,201,167,0.08) 0%, transparent 65%),
    linear-gradient(180deg, #060a12 0%, #0b1120 100%);
  pointer-events: none;
}

/* Grade 3D em perspectiva */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: -20%;
  width: 140%;
  height: 55%;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0,201,167,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,201,167,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(600px) rotateX(55deg);
  transform-origin: 50% 100%;
  animation: gridScroll 12s linear infinite;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  pointer-events: none;
}

@keyframes gridScroll {
  from { background-position: 0 0; }
  to   { background-position: 0 60px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ========== AUTH PAGES ========== */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.auth-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: float 9s ease-in-out infinite;
}
.auth-bg .orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(0,201,167,0.18) 0%, transparent 70%); opacity: 1; top: -20%; left: -15%; animation-delay: 0s; }
.auth-bg .orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(0,133,255,0.15) 0%, transparent 70%); opacity: 1; bottom: -15%; right: -10%; animation-delay: 3.5s; }
.auth-bg .orb-3 { width: 350px; height: 350px; background: radial-gradient(circle, rgba(0,201,167,0.1) 0%, transparent 70%); opacity: 1; top: 35%; left: 50%; animation-delay: 6s; }
.auth-bg .orb-4 { width: 200px; height: 200px; background: radial-gradient(circle, rgba(124,107,255,0.15) 0%, transparent 70%); opacity: 1; top: 15%; right: 20%; animation-delay: 2s; }

@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  33%      { transform: translateY(-25px) scale(1.04) rotate(3deg); }
  66%      { transform: translateY(15px) scale(0.97) rotate(-2deg); }
}

/* Estrelas no fundo auth */
.auth-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 75%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 30%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 20% 85%, rgba(0,201,167,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 65% 50%, rgba(0,201,167,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 55%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 90%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 5% 45%, rgba(0,201,167,0.4) 0%, transparent 100%);
  pointer-events: none;
  animation: starTwinkle 6s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(11,17,32,0.92);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(0,201,167,0.18);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 40px rgba(0,201,167,0.08);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-mark {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(0,201,167,0.08);
  border: 1px solid rgba(0,201,167,0.3);
  color: #00c9a7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 0 24px rgba(0,201,167,0.15);
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(0,201,167,0.1);
  border: 1px solid rgba(0,201,167,0.3);
  color: #00c9a7;
  border-radius: 8px;
  flex-shrink: 0;
}
.auth-logo h1 {
  font-size: 26px;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tabs button {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.auth-tabs button.active {
  background: var(--grad-primary);
  color: #fff;
  font-weight: 600;
}

/* ========== APP LAYOUT ========== */
#app-screen { display: flex; flex-direction: column; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: rgba(4,10,22,0.97);
  backdrop-filter: blur(30px);
  border-right: 1px solid rgba(0,201,167,0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-section { margin-bottom: 6px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover { background: rgba(0,201,167,0.07); color: var(--text); }
.nav-item.active {
  background: rgba(0,201,167,0.12);
  color: var(--primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--grad-primary);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.75; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.user-chip:hover { background: var(--bg-card-hover); }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text); truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-info .user-role { font-size: 11px; color: var(--text-faint); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh; /* garante altura total mesmo sem banner */
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6,13,31,0.9);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#topbar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.page-content { padding: 24px; flex: 1; max-width: 1400px; width: 100%; }

/* Hamburger for mobile */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ========== COMPONENTS ========== */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  transition: var(--transition);
}
.card:hover { border-color: rgba(0,201,167,0.2); }
.card-glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
}

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}
.stat-card.primary::before { background: var(--grad-primary); }
.stat-card.success::before { background: var(--grad-success); }
.stat-card.warning::before { background: var(--grad-warm); }
.stat-card.danger::before  { background: var(--grad-danger); }
.stat-card.purple::before  { background: var(--grad-purple); }

.stat-icon { font-size: 24px; margin-bottom: 12px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(0,201,167,0.1); border: 1px solid rgba(0,201,167,0.2); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); }
.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger  { color: var(--danger); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-sub   { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* Progress bar */
.progress-wrap { margin-top: 12px; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--grad-primary);
  transition: width 0.5s ease;
}
.progress-fill.warning { background: var(--grad-warm); }
.progress-fill.danger  { background: var(--grad-danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #060a12;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,201,167,0.25);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 6px 28px rgba(0,201,167,0.4); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.btn-danger { background: var(--grad-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { box-shadow: 0 4px 20px rgba(248,113,113,0.3); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-card); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 14px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }

/* Form Elements */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 7px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-faint); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(0,201,167,0.1);
}
.form-select { cursor: pointer; }
.form-select option { background: #0a1628; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.form-input.error { border-color: var(--danger); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-primary   { background: rgba(0,201,167,0.15); color: var(--primary); }
.badge-success   { background: rgba(16,217,160,0.15); color: var(--success); }
.badge-warning   { background: rgba(251,191,36,0.15); color: var(--warning); }
.badge-danger    { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-purple    { background: rgba(167,139,250,0.15); color: var(--accent); }
.badge-muted     { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.td-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Expense Item Row */
.item-row { transition: var(--transition); }
.item-row.purchased td { opacity: 0.55; }
.item-row.purchased .item-name { text-decoration: line-through; }
.item-name { font-weight: 500; }
.item-details { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.item-total { font-weight: 700; color: var(--primary); white-space: nowrap; }
.item-priority-star { color: var(--warning); font-size: 14px; }

/* Inline edit */
.editable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
}
.editable:hover { background: rgba(255,255,255,0.07); }
.inline-input {
  background: var(--bg-input);
  border: 1px solid var(--border-focus);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 4px 8px;
  outline: none;
  font-family: inherit;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.section-icon { font-size: 18px; }
.section-name { font-size: 15px; font-weight: 700; flex: 1; }
.section-totals { font-size: 13px; color: var(--text-muted); }
.section-actions { display: flex; gap: 4px; }
.section-collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  transition: var(--transition);
}
.section-collapse-btn:hover { color: var(--text); }

/* Quick add row */
.quick-add-row td { padding: 8px 16px; background: rgba(0,201,167,0.04); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #0d1a35;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-title { font-size: 18px; font-weight: 700; flex: 1; }
.modal-body { padding: 22px 24px; }
.modal-footer { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: rgba(13,26,53,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: all;
  animation: toastIn 0.3s ease;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform: translateX(100%); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { to   { opacity:0; transform: translateX(100%); } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast-icon    { font-size: 18px; }
.toast-msg     { flex: 1; color: var(--text); }

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-muted);
}
.loading-screen .spinner { width: 40px; height: 40px; border-width: 3px; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  width: 64px; height: 64px; margin-bottom: 16px;
  background: rgba(0,201,167,0.07); border: 1px solid rgba(0,201,167,0.18);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  color: var(--primary); opacity: 0.8;
}
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; color: var(--text-muted); max-width: 300px; margin-bottom: 20px; }

/* Dashboard specific */
.dashboard-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; margin-top: 20px; }
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.project-card:hover { border-color: rgba(0,201,167,0.3); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.project-card .project-icon { font-size: 26px; margin-bottom: 10px; }
.project-card .project-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.project-card .project-type { font-size: 12px; color: var(--text-faint); margin-bottom: 12px; }
.project-card .fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition);
}
.project-card .fav-btn:hover, .project-card .fav-btn.active { opacity: 1; }
.project-card .role-badge { position: absolute; top: 14px; right: 42px; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* AI Suggestions */
.ai-suggestions { display: flex; flex-direction: column; gap: 8px; }
.suggestion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.suggestion-item:hover { background: var(--bg-card-hover); border-color: rgba(0,201,167,0.3); }
.suggestion-item.selected { background: rgba(0,201,167,0.1); border-color: var(--primary); }
.suggestion-check { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: var(--transition); }
.suggestion-item.selected .suggestion-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.suggestion-name { font-size: 14px; font-weight: 500; }
.suggestion-items { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Logs */
.log-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.log-item:last-child { border-bottom: none; }
.log-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; overflow: hidden; }
.log-avatar img { width: 100%; height: 100%; object-fit: cover; }
.log-desc { font-size: 13px; color: var(--text); line-height: 1.5; }
.log-meta { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.log-undo { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; padding: 2px 8px; border-radius: 6px; cursor: pointer; margin-left: auto; flex-shrink: 0; transition: var(--transition); }
.log-undo:hover { border-color: var(--primary); color: var(--primary); }
.log-undone { text-decoration: line-through; opacity: 0.5; }

/* Members */
.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.member-item:last-child { border-bottom: none; }
.member-name { font-size: 14px; font-weight: 500; }
.member-email { font-size: 12px; color: var(--text-faint); }
.member-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* Profile */
.avatar-upload { text-align: center; margin-bottom: 24px; }
.avatar-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(0,201,167,0.3);
  transition: var(--transition);
}
.avatar-large:hover .avatar-overlay { opacity: 1; }
.avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  opacity: 0;
  transition: var(--transition);
}

/* Datas do projeto */
.date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--text-muted);
}
.dates-bar {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.date-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  flex: 1;
  min-width: 220px;
}

/* Splits por membro */
.splits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.split-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,201,167,0.08);
  border: 1px solid rgba(0,201,167,0.2);
  border-radius: 20px;
  padding: 2px 8px 2px 3px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}
.split-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.split-avatar img { width: 100%; height: 100%; object-fit: cover; }
.split-amount { color: var(--text); }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 12px;
  margin: 16px 0;
}
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Chip group */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  background: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: rgba(0,201,167,0.12); border-color: var(--primary); color: var(--primary); }

/* Role selector */
.role-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.role-option:hover { background: var(--bg-card-hover); }
.role-option input { margin-top: 3px; }
.role-option .role-info h4 { font-size: 14px; font-weight: 600; }
.role-option .role-info p  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Danger zone */
.danger-zone { border: 1px solid rgba(248,113,113,0.3); border-radius: var(--radius-lg); padding: 20px; }
.danger-zone h3 { color: var(--danger); font-size: 15px; margin-bottom: 12px; }

/* Scrollable panel */
.scroll-panel { max-height: 400px; overflow-y: auto; padding-right: 4px; }

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13,26,53,0.98);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
}
[data-tip]:hover::after { opacity: 1; }

/* Currency input */
.currency-input { position: relative; }
.currency-input .prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.currency-input .form-input { padding-left: 34px; }

/* ════════════════════════════════════
   CONTROLE FINANCEIRO
   ════════════════════════════════════ */

/* Summary cards row */
.fin-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.fin-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}
.fin-summary-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.fin-summary-value { font-size: 20px; font-weight: 700; }
.fin-summary-sub   { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* Tabs internas do financeiro */
.fin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
}
.fin-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.fin-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.fin-tab.active { background: var(--grad-primary); color: #fff; font-weight: 600; }

/* ── Calendário ── */
.fin-cal-wrapper { }
.fin-cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.fin-cal-title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  text-align: center;
}
.fin-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 20px;
}
.fin-cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0;
  text-transform: uppercase;
}
.fin-cal-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 4px;
  min-height: 68px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.fin-cal-cell:hover:not(.empty) { border-color: var(--primary); background: var(--bg-card-hover); }
.fin-cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.fin-cal-cell.today { border-color: var(--primary); background: rgba(0,201,167,0.06); }
.fin-cal-cell.today .fin-cal-day-num { color: var(--primary); font-weight: 700; }
.fin-cal-cell.selected { border-color: var(--primary); background: rgba(0,201,167,0.12); box-shadow: 0 0 0 2px rgba(0,201,167,0.3); }
.fin-cal-cell.has-data { }
.fin-cal-day-num { font-size: 12px; font-weight: 600; color: var(--text-muted); line-height: 1; }
.fin-cal-income-chip {
  font-size: 10px;
  font-weight: 600;
  color: var(--success);
  background: rgba(52,211,153,0.1);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-cal-expense-chip {
  font-size: 10px;
  font-weight: 600;
  color: var(--danger);
  background: rgba(248,113,113,0.1);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Detalhe do dia */
.fin-day-detail { margin-top: 16px; }

/* ── Linhas de transação ── */
.fin-entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fin-entry-row:last-child { border-bottom: none; }
.fin-entry-row.card-like {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 6px;
}
.fin-entry-icon { font-size: 20px; flex-shrink: 0; width: 32px; text-align: center; }
.fin-entry-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fin-entry-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-entry-cat { font-size: 12px; color: var(--text-muted); }
.fin-entry-amt { font-weight: 700; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.fin-entry-amt.income  { color: var(--success); }
.fin-entry-amt.expense { color: var(--danger);  }
.fin-tag-rec {
  font-size: 10px;
  background: rgba(0,201,167,0.12);
  color: var(--primary);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}
.btn-icon-sm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  opacity: 0.6;
}
.btn-icon-sm:hover { opacity: 1; background: var(--bg-card-hover); }
.opacity-50 { opacity: 0.5; }

/* ── Gráfico de histórico ── */
.fin-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
  padding-bottom: 24px;
  position: relative;
}
.fin-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}
.fin-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 60px;
}
.fin-chart-bar {
  width: 10px;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: all 0.4s ease;
}
.fin-chart-bar.income  { background: var(--success); opacity: 0.8; }
.fin-chart-bar.expense { background: var(--danger);  opacity: 0.8; }
.fin-chart-label {
  font-size: 10px;
  color: var(--text-faint);
  position: absolute;
  bottom: -18px;
  white-space: nowrap;
}

/* ── Investimentos ── */
.fin-inv-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.fin-inv-sum-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-align: center;
}
.fin-inv-sum-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.fin-inv-sum-val   { font-size: 16px; font-weight: 700; }
.fin-inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.fin-inv-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.fin-inv-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.fin-inv-name   { font-size: 14px; font-weight: 600; display: block; margin-bottom: 2px; }
.fin-inv-ticker {
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,201,167,0.1);
  color: var(--primary);
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
}
.fin-inv-detail { font-size: 12px; color: var(--text-muted); }

/* ── Importar projetos ── */
.fin-import-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fin-import-row.already-imported { opacity: 0.55; }
.fin-import-row:last-child { border-bottom: none; }
.fin-import-info { flex: 1; min-width: 0; }
.fin-import-name { font-size: 13px; font-weight: 500; display: block; margin-bottom: 2px; }
.fin-import-detail { font-size: 12px; color: var(--text-muted); }
.fin-import-check { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }

/* ============================================
   MÓDULO PESSOAL — Personal Finance Styles
   ============================================ */

/* ── Layout base ── */
.pf-dashboard, .pf-page { display: flex; flex-direction: column; gap: 20px; padding: 20px; max-width: 1100px; }
.pf-loading  { padding: 60px; text-align: center; color: var(--text-muted); font-size: 14px; }
.pf-error    { padding: 40px; text-align: center; color: var(--danger); font-size: 14px; }
.pf-empty    { padding: 48px 24px; text-align: center; color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* ── Stats ── */
.pf-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.pf-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.pf-stat-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }

.pf-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0,201,167,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.pf-stat-card:hover .pf-stat-icon { transform: scale(1.05); }

.pf-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.pf-stat-value { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }

/* ── Balance bar ── */
.pf-balance-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── 2-column grid ── */
.pf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Section header ── */
.pf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pf-section-title { font-size: 14px; font-weight: 700; }

/* ── Progress bar ── */
.pf-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.pf-progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* ── Type row (patrimônio/categoria bars) ── */
.pf-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.pf-type-row:last-child { margin-bottom: 0; }
.pf-type-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }

/* ── Upcoming row ── */
.pf-upcoming-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.pf-upcoming-row:last-child { border-bottom: none; }

/* ── Goal mini (dashboard) ── */
.pf-goal-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.pf-goal-mini:last-child { border-bottom: none; }
.pf-goal-mini:hover { opacity: 0.85; }

/* ── Month navigation ── */
.pf-month-nav { display: flex; align-items: center; gap: 6px; }
.pf-month-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.pf-month-btn:hover { background: var(--bg-card-hover); border-color: var(--primary); }
.pf-month-label { font-size: 13px; font-weight: 600; min-width: 72px; text-align: center; }

/* ── Total banner ── */
.pf-total-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── List rows (income / variable) ── */
.pf-list-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}
.pf-list-row:last-child { border-bottom: none; }
.pf-inactive { opacity: 0.45; }

/* ── Type badge ── */
.pf-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Category dot ── */
.pf-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Category chips (variable summary) ── */
.pf-cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-cat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--cc, #64748b);
  font-size: 12px;
}

/* ── Account group ── */
.pf-account-group { padding: 0 !important; overflow: hidden; }
.pf-account-group-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.pf-account-row {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
  transition: var(--transition);
}
.pf-account-row:last-child { border-bottom: none; }
.pf-account-row:hover { background: var(--bg-card-hover); }

/* ── Goal card ── */
.pf-goal-card { padding: 20px !important; }

/* ── Goal icon picker ── */
.pf-goal-icon-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}
.pf-goal-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.pf-goal-icon-btn:hover {
  border-color: var(--primary);
  background: rgba(0,201,167,0.08);
  color: var(--primary);
}
.pf-goal-acc-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.pf-goal-acc-check:hover { border-color: var(--primary); background: rgba(0,201,167,0.05); }
.pf-goal-acc-check:has(input:checked) { border-color: var(--primary); background: rgba(0,201,167,0.08); }

.pf-goal-icon-btn.active {
  border-color: var(--primary);
  background: rgba(0,201,167,0.12);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,201,167,0.15);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .pf-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-grid-2    { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .pf-stat-grid { grid-template-columns: 1fr; }
  .pf-dashboard, .pf-page { padding: 12px; gap: 12px; }
}

/* ── Yield badge ── */
.pf-yield-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(16,217,160,0.12);
  color: var(--yc, #10d9a0);
  border: 1px solid rgba(16,217,160,0.2);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Botão pulsando quando há rendimentos pendentes */
@keyframes yieldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,217,160,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(16,217,160,0); }
}
.yield-btn-pulse {
  animation: yieldPulse 1.8s ease infinite;
  border-color: var(--success) !important;
  color: var(--success) !important;
}

/* ── Module switcher (sidebar) ── */
.nav-module-switch {
  margin: 8px 10px 4px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-module-switch:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(0,201,167,0.25);
  box-shadow: 0 0 16px rgba(0,201,167,0.08);
}

.nav-module-switch-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-module-switch-icon { font-size: 20px; flex-shrink: 0; display:none; }

.nav-module-switch-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1;
  margin-bottom: 2px;
}

.nav-module-switch-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.nav-module-switch-arrow {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-faint);
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-module-switch:hover .nav-module-switch-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* ── Email verification wall ── */
#verify-wall {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.verify-wall-card {
  background: var(--bg-card);
  border: 1px solid rgba(0,201,167,0.2);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.verify-wall-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(0,201,167,0.08); border: 1px solid rgba(0,201,167,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); margin: 0 auto 20px;
}
.verify-wall-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.verify-wall-card p { color: var(--text-muted); font-size: 14px; margin: 4px 0; }
.verify-wall-card strong { color: var(--primary); font-size: 15px; }
.verify-wall-actions { display: flex; gap: 10px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* ── Email badge in profile ── */
.email-verified-badge,
.email-unverified-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  pointer-events: none;
}
.email-verified-badge {
  background: rgba(52,211,153,0.12);
  color: var(--success);
  border: 1px solid rgba(52,211,153,0.3);
}
.email-unverified-badge {
  background: rgba(245,158,11,0.12);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
}

/* ── Auth forgot password link ── */
.forgot-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  opacity: 0.8;
  transition: var(--transition);
}
.forgot-link:hover { opacity: 1; text-decoration: underline; }

/* ── Alert boxes (success/error) in modals ── */
.alert-success {
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--success);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
}
.alert-error {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
}

/* ── App body: sidebar + main content (abaixo do banner) ── */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }

  .main-content { margin-left: 0; }
  .page-content  { padding: 16px; }
  .topbar        { padding: 0 16px; }

  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }

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

  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 90vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .auth-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .fin-summary-row  { grid-template-columns: 1fr 1fr; }
  .fin-inv-summary  { grid-template-columns: 1fr 1fr; }
  .fin-tabs         { flex-wrap: wrap; }
  .fin-tab          { flex: unset; font-size: 12px; padding: 6px 10px; }
  .fin-cal-cell     { min-height: 50px; padding: 4px 2px; }
  .fin-cal-day-num  { font-size: 11px; }
  .fin-cal-income-chip,
  .fin-cal-expense-chip { font-size: 9px; }
}

/* ============================================
   LANDING PAGE — Partículas + Dois Módulos
   ============================================ */

#landing-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060a12;
  overflow: hidden;
}

#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 52px;
  padding: 24px;
  animation: landingIn 0.8s cubic-bezier(0.16,1,0.3,1) both;
}

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

@keyframes landingOut {
  to { opacity: 0; transform: scale(1.04); }
}

.landing-screen-exit { animation: landingOut 0.35s ease forwards; }

/* ── Logo ── */
.landing-logo { text-align: center; }

.landing-logo-mark {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(0,201,167,0.08);
  border: 1px solid rgba(0,201,167,0.3);
  color: #00c9a7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(0,201,167,0.2);
}

.landing-logo h1 {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ffffff 0%, #00c9a7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  line-height: 1;
}

.landing-logo p {
  font-size: 15px;
  color: rgba(255,255,255,0.35);
  font-weight: 400;
  letter-spacing: 0.6px;
}

/* ── Cards ── */
.landing-cards {
  display: flex;
  gap: 28px;
  align-items: stretch;
}

.landing-card {
  width: 300px;
  padding: 40px 32px 36px;
  background: #0d1626;
  border: 1px solid rgba(0,201,167,0.15);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-card::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card-projects::before { background: radial-gradient(circle, rgba(0,201,167,0.14) 0%, transparent 70%); }
.card-personal::before  { background: radial-gradient(circle, rgba(0,133,255,0.14) 0%, transparent 70%); }

.landing-card:hover { transform: translateY(-8px); }
.landing-card:hover::before { opacity: 1; }

.card-projects:hover {
  border-color: rgba(0,201,167,0.4);
  box-shadow: 0 20px 60px rgba(0,201,167,0.15);
}

.card-personal:hover {
  border-color: rgba(0,133,255,0.4);
  box-shadow: 0 20px 60px rgba(0,133,255,0.15);
}

.landing-card-icon { display: none; }

.landing-card-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}
.landing-card-icon-wrap.projects-icon {
  background: rgba(0,201,167,0.08);
  color: #00c9a7;
  border-color: rgba(0,201,167,0.3);
}
.landing-card-icon-wrap.personal-icon {
  background: rgba(0,133,255,0.08);
  color: #0085ff;
  border-color: rgba(0,133,255,0.3);
}
.landing-card:hover .landing-card-icon-wrap { transform: scale(1.1); }

.landing-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.landing-card p {
  font-size: 13.5px;
  color: rgba(255,255,255,0.35);
  line-height: 1.65;
  margin-bottom: 28px;
  flex: 1;
}

.landing-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 26px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-projects .landing-card-btn {
  background: transparent;
  border: 1px solid #00c9a7;
  color: #00c9a7;
}
.card-projects:hover .landing-card-btn {
  background: #00c9a7;
  color: #060a12;
}

.card-personal .landing-card-btn {
  background: transparent;
  border: 1px solid #0085ff;
  color: #0085ff;
}
.card-personal:hover .landing-card-btn {
  background: #0085ff;
  color: #fff;
}

.card-btn-arrow { transition: transform 0.2s ease; display: inline-block; }
.landing-card:hover .card-btn-arrow { transform: translateX(4px); }

/* ── Footer hint ── */
.landing-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.18);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* ── Responsivo ── */
@media (max-width: 680px) {
  .landing-cards { flex-direction: column; gap: 16px; }
  .landing-card  { width: 290px; padding: 32px 24px 28px; }
  .landing-logo h1 { font-size: 38px; }
  .landing-logo-mark { width: 56px; height: 56px; font-size: 22px; }
  .landing-content { gap: 36px; }
}
