/* ═══════════════════════════════════════════════════════
   CLARIÔ v3 FINAL — style.css
   Sidebar Dark · Emerald Accent · Responsivo impecável
   Fonte: Plus Jakarta Sans
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────────────────
   TOKENS PRIMITIVOS
───────────────────────────────────────────────────────── */
:root {
  --sidebar-bg:        #0f1117;
  --sidebar-border:    rgba(255,255,255,0.06);
  --sidebar-hover:     rgba(255,255,255,0.05);
  --sidebar-active:    rgba(16,185,129,0.15);
  --sidebar-active-bd: rgba(16,185,129,0.4);
  --sidebar-text:      rgba(255,255,255,0.55);
  --sidebar-text-h:    rgba(255,255,255,0.9);
  --sidebar-w:         224px;
  --sidebar-w-col:     60px;

  --em-400: #34d399;
  --em-500: #10b981;
  --em-600: #059669;
  --em-700: #047857;
  --em-light: #d1fae5;

  --navy:   #101942;
  --navy-l: #1d2860;

  --g-0:   #ffffff;
  --g-50:  #f8fafc;
  --g-100: #f1f5f9;
  --g-150: #eaeff5;
  --g-200: #e2e8f0;
  --g-300: #cbd5e1;
  --g-400: #94a3b8;
  --g-500: #64748b;
  --g-600: #475569;
  --g-700: #334155;
  --g-800: #1e293b;
  --g-900: #0f172a;

  --success:   #10b981;
  --s-light:   #d1fae5;
  --s-text:    #065f46;
  --danger:    #ef4444;
  --d-light:   #fee2e2;
  --d-text:    #991b1b;
  --warning:   #f59e0b;
  --w-light:   #fef3c7;
  --w-text:    #92400e;
  --info:      #3b82f6;
  --i-light:   #dbeafe;
  --i-text:    #1e40af;

  --bg-page:    #f0f2f7;
  --bg-surface: #ffffff;
  --bg-subtle:  #f8fafc;
  --bg-muted:   #f1f5f9;
  --text-1:     #0f172a;
  --text-2:     #475569;
  --text-3:     #94a3b8;
  --border:     #e2e8f0;
  --border-s:   #cbd5e1;

  --sh-xs: 0 1px 2px rgba(0,0,0,0.04);
  --sh-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --sh-lg: 0 12px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --sh-xl: 0 24px 48px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.05);
  --sh-em: 0 4px 20px rgba(16,185,129,0.25);

  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-2xl:  24px;
  --r-full: 9999px;

  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  --font:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --fs-xs:   0.6875rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md:   1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  --fs-4xl:  2.5rem;

  --ease:   cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;

  /* Aliases de compatibilidade com script.js original */
  --primary:          var(--navy);
  --primary-dark:     var(--navy);
  --primary-light:    var(--navy-l);
  --primary-muted:    rgba(16,25,66,0.08);
  --bg-primary:       var(--bg-surface);
  --bg-secondary:     var(--bg-subtle);
  --text-primary:     var(--text-1);
  --text-secondary:   var(--text-2);
  --border-color:     var(--border);
  --white:            #ffffff;
  --success-light:    var(--s-light);
  --danger-light:     var(--d-light);
  --warning-light:    var(--w-light);
  --info-light:       var(--i-light);
  --success-text:     var(--s-text);
  --danger-text:      var(--d-text);
  --warning-text:     var(--w-text);
  --info-text:        var(--i-text);
  --shadow-sm:        var(--sh-sm);
  --shadow-md:        var(--sh-md);
  --shadow-lg:        var(--sh-lg);
  --shadow-xl:        var(--sh-xl);
  --radius-sm:        var(--r-sm);
  --radius-md:        var(--r-md);
  --radius-lg:        var(--r-lg);
  --radius-xl:        var(--r-xl);
  --radius-2xl:       var(--r-2xl);
  --radius-full:      var(--r-full);
  --font-family:      var(--font);
  --font-size-xs:     var(--fs-xs);
  --font-size-sm:     var(--fs-sm);
  --font-size-base:   var(--fs-base);
  --font-size-md:     var(--fs-md);
  --font-size-lg:     var(--fs-lg);
  --font-size-xl:     var(--fs-xl);
  --font-size-2xl:    var(--fs-2xl);
  --font-size-3xl:    var(--fs-3xl);
  --spacing-xs:       var(--sp-1);
  --spacing-sm:       var(--sp-2);
  --spacing-md:       var(--sp-4);
  --spacing-lg:       var(--sp-6);
  --spacing-xl:       var(--sp-8);
  --spacing-2xl:      var(--sp-12);
  --transition:       var(--t-base) var(--ease);
  --gray-50:  var(--g-50);
  --gray-100: var(--g-100);
  --gray-200: var(--g-200);
  --gray-300: var(--g-300);
  --gray-400: var(--g-400);
  --gray-500: var(--g-500);
  --gray-600: var(--g-600);
  --gray-700: var(--g-700);
  --gray-800: var(--g-800);
  --gray-900: var(--g-900);
}

/* ─────────────────────────────────────────────────────────
   DARK MODE — html.dark
───────────────────────────────────────────────────────── */
html.dark {
  --bg-page:    #080a0e;
  --bg-surface: #111318;
  --bg-subtle:  #161820;
  --bg-muted:   #1c1f2a;
  --text-1:     #e8eaf0;
  --text-2:     #8892a4;
  --text-3:     #4a5468;
  --border:     rgba(255,255,255,0.06);
  --border-s:   rgba(255,255,255,0.10);
  --g-50:  #161820;
  --g-100: #1c1f2a;
  --g-200: #242838;
  --g-300: #2e3344;
  --g-400: #3e4560;
  --g-500: #8892a4;
  --g-600: #b0bac8;
  --g-700: #d0d6e0;
  --g-800: #e8eaf0;
  --g-900: #f0f2f8;
  --sh-sm: 0 1px 3px rgba(0,0,0,0.3);
  --sh-md: 0 4px 12px rgba(0,0,0,0.4);
  --sh-lg: 0 12px 24px rgba(0,0,0,0.5);
  --sh-xl: 0 24px 48px rgba(0,0,0,0.6);
  --bg-primary:   #111318;
  --bg-secondary: #161820;
  --text-primary: #e8eaf0;
  --text-secondary: #8892a4;
  --border-color: rgba(255,255,255,0.06);
  --white: #111318;
  --gray-50:  #161820;
  --gray-100: #1c1f2a;
  --gray-200: #242838;
  --gray-300: #2e3344;
  --gray-400: #3e4560;
  --gray-500: #8892a4;
  --gray-600: #b0bac8;
  --gray-700: #d0d6e0;
  --gray-800: #e8eaf0;
  --gray-900: #f0f2f8;
}

/* body.dark-mode = alias para compatibilidade com script.js */
body.dark-mode { color-scheme: dark; }

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
  overflow-x: hidden;
  max-width: 100vw;
}

a  { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--g-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--g-400); }

/* ─────────────────────────────────────────────────────────
   ANIMAÇÕES
───────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.93); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─────────────────────────────────────────────────────────
   LAYOUT — APP WRAPPER
───────────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  transition: padding-left var(--t-slow) var(--ease);
}

.app-wrapper.has-sidebar {
  padding-left: var(--sidebar-w);
}

.app-wrapper.has-sidebar.sidebar-collapsed {
  padding-left: var(--sidebar-w-col);
}

/* ─────────────────────────────────────────────────────────
   SIDEBAR DARK
───────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  transition: width var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

.sidebar.collapsed {
  width: var(--sidebar-w-col);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4);
  height: 60px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--em-500), var(--em-700));
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16,185,129,0.35);
  color: white;
}

.sidebar-logo-text {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  white-space: nowrap;
  transition: opacity var(--t-base) var(--ease);
}

.sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }

.sidebar-collapse-btn {
  position: absolute;
  right: var(--sp-3);
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all var(--t-fast);
  opacity: 0;
  flex-shrink: 0;
}

.sidebar:hover .sidebar-collapse-btn { opacity: 1; }
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-1);
  white-space: nowrap;
  transition: opacity var(--t-base) var(--ease);
}

.sidebar.collapsed .sidebar-nav-label { opacity: 0; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--t-fast) var(--ease);
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
  border: 1px solid transparent;
  animation: slideInLeft var(--t-slow) var(--ease) both;
}

.sidebar-nav-item:nth-child(2) { animation-delay: 40ms; }
.sidebar-nav-item:nth-child(3) { animation-delay: 70ms; }
.sidebar-nav-item:nth-child(4) { animation-delay: 100ms; }
.sidebar-nav-item:nth-child(5) { animation-delay: 130ms; }
.sidebar-nav-item:nth-child(6) { animation-delay: 160ms; }
.sidebar-nav-item:nth-child(7) { animation-delay: 190ms; }
.sidebar-nav-item:nth-child(8) { animation-delay: 220ms; }

.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-h);
}

.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--em-400);
  border-color: var(--sidebar-active-bd);
}

.sidebar-nav-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.sidebar-nav-label-text {
  flex: 1;
  font-size: var(--fs-sm);
  font-weight: 600;
  opacity: 1;
  transition: opacity var(--t-base) var(--ease);
}

.sidebar.collapsed .sidebar-nav-label-text { opacity: 0; pointer-events: none; }

.sidebar-nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--em-500);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(16,185,129,0.6);
  transition: opacity var(--t-base);
}

.sidebar.collapsed .sidebar-nav-active-dot { opacity: 0; }

/* Tooltip colapsado */
.sidebar.collapsed .sidebar-nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e2030;
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  z-index: 999;
  box-shadow: var(--sh-md);
  animation: fadeIn var(--t-fast) var(--ease);
}

/* Footer sidebar */
.sidebar-footer {
  padding: var(--sp-3);
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  position: relative;
}

.sidebar-footer-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: var(--sp-2) 0;
}

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  transition: all var(--t-fast);
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-footer-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text-h); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
  border-color: var(--sidebar-border);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--navy-l), var(--navy));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.1);
}

.sidebar-user-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-toggle:focus-visible {
  outline: 2px solid var(--em-500);
  outline-offset: 2px;
}

.sidebar-user-avatar span {
  font-size: 11px;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  opacity: 1;
  transition: opacity var(--t-base) var(--ease);
}

.sidebar.collapsed .sidebar-user-info { opacity: 0; pointer-events: none; }

.sidebar-user-name {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  font-size: 10px;
  color: var(--em-400);
  font-weight: 500;
}

.sidebar-user-chevron {
  color: var(--sidebar-text);
  flex-shrink: 0;
  opacity: 1;
  transition: opacity var(--t-base), transform var(--t-base);
}

.sidebar-user-chevron svg {
  display: block;
}

.sidebar.collapsed .sidebar-user-chevron { opacity: 0; }

.sidebar-user-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: var(--sp-3);
  right: var(--sp-3);
  background: #1a1d2b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-lg);
  padding: var(--sp-1);
  display: none;
  z-index: 999;
  box-shadow: var(--sh-xl);
}

.sidebar-user-menu.active { /* display controlled by JS */ }

.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
}

.sidebar-user-menu-item:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-user-menu-item.danger:hover { background: rgba(239,68,68,0.1); color: #f87171; }

/* ─────────────────────────────────────────────────────────
   OVERLAY MOBILE
───────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
  animation: fadeIn var(--t-base) var(--ease);
}

/* ─────────────────────────────────────────────────────────
   TOPBAR MOBILE
───────────────────────────────────────────────────────── */
.topbar-mobile {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.topbar-mobile-hamburger {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all var(--t-fast);
}

.topbar-mobile-hamburger:hover { background: rgba(255,255,255,0.12); color: white; }

.topbar-mobile-logo {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: white;
  flex: 1;
  text-align: center;
}

.topbar-mobile-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--em-600), var(--em-700));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
}

.topbar-mobile-avatar span { font-size: 10px; font-weight: 700; color: white; }

/* ─────────────────────────────────────────────────────────
   MAIN + CONTAINER
───────────────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: var(--sp-8) 0;
  min-width: 0;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
  box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────
   BOTÕES
───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  height: 38px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  letter-spacing: -0.01em;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: var(--em-500);
  color: white;
  box-shadow: 0 1px 2px rgba(16,185,129,0.2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--em-600);
  box-shadow: var(--sh-em);
  transform: translateY(-1px);
}

.btn-secondary, .btn-outline {
  background: var(--bg-surface);
  color: var(--text-1);
  border-color: var(--border-s);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled) {
  background: var(--g-100);
  border-color: var(--g-400);
}

.btn-success {
  background: var(--em-500);
  color: white;
}
.btn-success:hover:not(:disabled) { background: var(--em-600); transform: translateY(-1px); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; transform: translateY(-1px); }

.btn-sm   { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn-lg   { height: 46px; padding: 0 var(--sp-6); font-size: var(--fs-base); }
.btn-block { width: 100%; justify-content: center; }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--r-md);
  color: var(--text-2); cursor: pointer; transition: all var(--t-fast);
}
.btn-icon:hover { background: var(--g-100); color: var(--text-1); }
.btn-icon svg { width: 17px; height: 17px; }

.btn-icon-sm {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer; transition: all var(--t-fast);
}
.btn-icon-sm:hover { background: var(--g-100); color: var(--text-1); }
.btn-icon-sm svg { width: 14px; height: 14px; }

.btn-success-sm {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px var(--sp-2); font-size: var(--fs-xs); font-weight: 600;
  font-family: var(--font); border: none; border-radius: var(--r-sm);
  cursor: pointer; background: var(--em-500); color: white; transition: all var(--t-fast);
}
.btn-success-sm:hover { background: var(--em-600); }

.btn-danger-sm {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px var(--sp-2); font-size: var(--fs-xs); font-weight: 600;
  font-family: var(--font); border: none; border-radius: var(--r-sm);
  cursor: pointer; background: var(--danger); color: white; transition: all var(--t-fast);
}
.btn-danger-sm:hover { background: #dc2626; }

.btn-logout {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: 0 var(--sp-5); height: 44px;
  border-radius: var(--r-md); font-family: var(--font); font-size: var(--fs-base);
  font-weight: 600; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-subtle); color: var(--text-2); text-decoration: none;
  transition: all var(--t-fast);
}
.btn-logout:hover { background: var(--g-100); color: var(--text-1); }

.btn-renew {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: 0 var(--sp-5); height: 44px;
  border-radius: var(--r-md); font-family: var(--font); font-size: var(--fs-base);
  font-weight: 700; cursor: pointer; border: none;
  background: var(--em-500); color: white; text-decoration: none;
  transition: all var(--t-fast); box-shadow: var(--sh-em);
}
.btn-renew:hover { background: var(--em-600); transform: translateY(-1px); }

/* ─────────────────────────────────────────────────────────
   BTN-NAV
───────────────────────────────────────────────────────── */
.btn-nav {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2); cursor: pointer;
  transition: all var(--t-fast);
}
.btn-nav:hover { background: var(--g-100); border-color: var(--em-500); color: var(--em-600); }

/* ─────────────────────────────────────────────────────────
   DASHBOARD
───────────────────────────────────────────────────────── */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  animation: fadeInUp var(--t-slow) var(--ease) both;
}

.dashboard-month {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.04em;
}

.month-nav-compact { display: flex; gap: var(--sp-2); }

/* ─────────────────────────────────────────────────────────
   GRID PRINCIPAL
───────────────────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}

@media (min-width: 1024px) {
  .main-grid { grid-template-columns: 1fr 260px; }
}

@media (min-width: 1280px) {
  .main-grid { grid-template-columns: 1fr 300px; }
}

/* ─────────────────────────────────────────────────────────
   SUMMARY SECTION + CARDS
───────────────────────────────────────────────────────── */
.summary-section {
  background: var(--bg-surface);
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  animation: fadeInUp var(--t-slow) var(--ease) 60ms both;
  transition: background var(--t-slow), border-color var(--t-slow);
  overflow: hidden;
  min-width: 0;
}

/* 2 colunas por padrão, 4 a partir de 960px */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

@media (min-width: 960px) {
  .summary-cards { grid-template-columns: repeat(4, 1fr); }
}

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  background: var(--bg-subtle);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--g-300);
  border-left: none;
  transition: all var(--t-base) var(--ease);
  cursor: default;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.summary-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  border-color: var(--border-s);
  border-top-color: currentColor;
}

.summary-card-primary { border-top-color: var(--navy); }
.summary-card-income  { border-top-color: var(--em-500); }
.summary-card-expense { border-top-color: var(--danger); }
.summary-card-success { border-top-color: var(--em-500); }
.summary-card-danger  { border-top-color: var(--danger); }

.summary-icon {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-bottom: var(--sp-3);
  transition: all var(--t-base);
}

.summary-icon svg { width: 14px; height: 14px; color: var(--text-2); }
.summary-icon-income svg  { color: var(--em-500); }
.summary-icon-expense svg { color: var(--danger); }

.summary-content {
  flex: 1;
  min-width: 0;
}

.summary-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  margin-bottom: 4px;
  white-space: nowrap;
}

/* ── VALUE: sem truncamento, fonte adaptável ── */
.summary-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 3px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  overflow-wrap: anywhere;
  hyphens: none;
  min-width: 0;
}

@media (min-width: 960px) and (max-width: 1280px) {
  .summary-value { font-size: 0.9375rem; }
}

@media (min-width: 1280px) {
  .summary-value { font-size: 1.125rem; }
}

.summary-card-income .summary-value  { color: var(--em-600); }
.summary-card-expense .summary-value { color: var(--danger); }
.summary-card-success .summary-value { color: var(--em-600); }
.summary-card-danger .summary-value  { color: var(--danger); }

.summary-footer {
  font-size: 9px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}


/* Métricas previstas */
.metricas-previstas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-muted);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  border: 1px solid var(--border);
}

.metrica-item { display: flex; align-items: center; gap: 0.35rem; }
.metrica-label { color: var(--text-3); font-weight: 400; }
.metrica-valor { font-weight: 700; letter-spacing: -0.01em; }
.metrica-income  { color: var(--em-600); }
.metrica-expense { color: var(--danger); }
.metrica-separador { color: var(--text-3); opacity: 0.4; user-select: none; }
.previsto-positivo { color: var(--em-600); font-weight: 700; }
.previsto-negativo { color: var(--danger); font-weight: 700; }
.previsto-neutro   { color: var(--text-3); font-weight: 700; }

/* ─────────────────────────────────────────────────────────
   FORECAST COMPACTO
───────────────────────────────────────────────────────── */
.forecast-compact {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  animation: fadeInUp var(--t-slow) var(--ease) 120ms both;
  transition: background var(--t-slow), border-color var(--t-slow);
}

.forecast-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
}

.forecast-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--sp-3) var(--sp-4);
}

.forecast-compact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3);
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}

.forecast-compact-item:hover {
  background: var(--bg-surface);
  border-color: var(--em-500);
  transform: translateX(2px);
}

.forecast-compact-month {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.forecast-compact-values { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.forecast-compact-main  { font-size: var(--fs-base); font-weight: 800; letter-spacing: -0.03em; }
.forecast-compact-value { font-size: var(--fs-base); font-weight: 800; letter-spacing: -0.03em; }
.forecast-compact-details { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-xs); }

/* ─────────────────────────────────────────────────────────
   SPENDING CHART
───────────────────────────────────────────────────────── */
.spending-chart-section {
  background: var(--bg-surface);
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  animation: fadeInUp var(--t-slow) var(--ease) 140ms both;
  transition: background var(--t-slow), border-color var(--t-slow);
}

.section-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-5);
}

.spending-chart { display: flex; flex-direction: column; gap: var(--sp-4); }

.spending-item {
  display: flex; flex-direction: column; gap: var(--sp-2);
  transition: transform var(--t-fast);
}
.spending-item:hover { transform: translateX(3px); }

.spending-info { display: flex; justify-content: space-between; align-items: center; }

.spending-category {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-1);
}

.spending-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.spending-amount { font-size: var(--fs-sm); font-weight: 700; color: var(--text-1); letter-spacing: -0.02em; }

.spending-bar-container {
  width: 100%; height: 5px;
  background: var(--g-200);
  border-radius: var(--r-full);
  overflow: hidden;
}

.spending-bar {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────────
   TRANSAÇÕES
───────────────────────────────────────────────────────── */
.transactions-section {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  animation: fadeInUp var(--t-slow) var(--ease) 180ms both;
  transition: background var(--t-slow), border-color var(--t-slow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.transactions-list { display: flex; flex-direction: column; }

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  background: var(--bg-surface);
  cursor: pointer;
  min-width: 0;
}

.transaction-item:last-child { border-bottom: none; }
.transaction-item:hover { background: var(--bg-subtle); }

.transaction-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--t-fast);
}

.transaction-item:hover .transaction-icon { transform: scale(1.06); }

.transaction-icon-income  { background: var(--s-light); }
.transaction-icon-income svg  { color: var(--em-600); width: 17px; height: 17px; }
.transaction-icon-expense { background: var(--d-light); }
.transaction-icon-expense svg { color: var(--danger); width: 17px; height: 17px; }

.transaction-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}

.transaction-description {
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.transaction-meta {
  font-size: var(--fs-xs); color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.transaction-amount {
  font-size: var(--fs-base); font-weight: 800; white-space: nowrap;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.transaction-amount-income  { color: var(--em-600); }
.transaction-amount-expense { color: var(--danger); }

.transaction-actions {
  display: flex; gap: var(--sp-1); flex-shrink: 0;
  opacity: 0.35;
  transition: opacity var(--t-fast);
}
.transaction-item:hover .transaction-actions { opacity: 1; }

/* ─────────────────────────────────────────────────────────
   FAB
───────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-6);
  width: 52px; height: 52px;
  border-radius: var(--r-full);
  background: var(--em-500);
  color: white;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(16,185,129,0.4);
  transition: all var(--t-base) var(--spring);
  z-index: 150;
}

.fab:hover { transform: scale(1.08); box-shadow: 0 8px 24px rgba(16,185,129,0.5); background: var(--em-600); }
.fab:active { transform: scale(0.93); }
.fab svg { width: 22px; height: 22px; transition: transform var(--t-base) var(--spring); }
.fab.active svg { transform: rotate(45deg); }

.fab-menu {
  position: fixed;
  bottom: calc(var(--sp-8) + 62px);
  right: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-end;
  z-index: 149;
  opacity: 0; transform: translateY(10px);
  pointer-events: none;
  transition: all var(--t-base) var(--ease);
}

.fab-menu.active { opacity: 1; transform: translateY(0); pointer-events: all; }

.fab-item {
  display: flex; align-items: center; gap: 0;
  cursor: pointer; text-decoration: none;
  border-radius: var(--r-full);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: all var(--t-base) var(--spring);
  border: none;
  background: none;
  font-family: var(--font);
}
.fab-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.22); }
.fab-item:active { transform: scale(0.96); }

.fab-item-label {
  font-size: var(--fs-sm); font-weight: 700; font-family: var(--font);
  padding: 0 var(--sp-5) 0 var(--sp-4);
  height: 44px; display: flex; align-items: center;
  white-space: nowrap; letter-spacing: -0.01em;
  color: white;
  border: none;
  background: transparent;
}

.fab-item-icon {
  width: 44px; height: 44px;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: filter var(--t-fast);
}
.fab-item:hover .fab-item-icon { filter: brightness(1.1); }
.fab-item svg { width: 18px; height: 18px; color: white; }

.fab-item-income { background: linear-gradient(135deg, var(--em-600), var(--em-500)); }
.fab-item-income .fab-item-icon { background: rgba(0,0,0,0.12); }

.fab-item-expense { background: linear-gradient(135deg, #dc2626, var(--danger)); }
.fab-item-expense .fab-item-icon { background: rgba(0,0,0,0.12); }

/* ─────────────────────────────────────────────────────────
   MODAL
───────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; justify-content: center; align-items: flex-end;
  z-index: 9999; padding: var(--sp-4);
  backdrop-filter: blur(4px);
  animation: fadeIn var(--t-base) var(--ease);
}

@media (min-width: 640px) { .modal-backdrop { align-items: center; } }

.modal {
  background: var(--bg-surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  max-width: 480px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--sh-xl);
  animation: fadeInUp var(--t-base) var(--spring);
}

@media (min-width: 640px) {
  .modal { border-radius: var(--r-2xl); animation: scaleIn var(--t-base) var(--spring); }
}

.modal-header {
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--bg-surface); z-index: 1;
}

.modal-title { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.03em; color: var(--text-1); }
.modal-body { padding: var(--sp-6); }
.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: var(--sp-3);
}

/* ─────────────────────────────────────────────────────────
   FORMS
───────────────────────────────────────────────────────── */
.form-group {
  display: flex; flex-direction: column; gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: var(--fs-xs); font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: 0.07em;
}

.form-input, .form-select, .form-textarea {
  width: 100%; height: 42px; padding: 0 var(--sp-4);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font); font-size: var(--fs-sm); font-weight: 500;
  color: var(--text-1); outline: none;
  transition: all var(--t-fast);
  -webkit-appearance: none;
}

.form-input:hover, .form-select:hover { border-color: var(--border-s); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--em-500);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

.form-input::placeholder { color: var(--text-3); }
.form-textarea { height: auto; padding: var(--sp-3) var(--sp-4); min-height: 80px; resize: vertical; }
.form-select { cursor: pointer; }

.form-hint { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--text-3); line-height: 1.4; }
.form-hint-warning { color: var(--warning); }
.form-label-inline {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); cursor: pointer; color: var(--text-1); font-weight: 500;
}
.form-label-inline input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--em-500); cursor: pointer; }
.form-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ─────────────────────────────────────────────────────────
   TOAST
───────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: var(--sp-6); left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: var(--sp-2);
  align-items: center; pointer-events: none;
}

.toast {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--g-900); color: white;
  border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 600;
  box-shadow: var(--sh-xl); pointer-events: all;
  letter-spacing: -0.01em;
  animation: toastIn var(--t-base) var(--spring) forwards;
}

html.dark .toast { background: var(--g-0); color: var(--g-900); }
.toast.alert-success { background: var(--em-600); }
.toast.alert-error   { background: #dc2626; }

.alert {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  margin-bottom: var(--sp-4); font-size: var(--fs-sm); font-weight: 500;
}
.alert-success { background: var(--s-light); color: var(--s-text); border-left: 3px solid var(--em-500); }
.alert-error   { background: var(--d-light); color: var(--d-text); border-left: 3px solid var(--danger); }
.alert-warning { background: var(--w-light); color: var(--w-text); border-left: 3px solid var(--warning); }

/* ─────────────────────────────────────────────────────────
   LOADING
───────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: none; justify-content: center; align-items: center;
  z-index: 9998; backdrop-filter: blur(2px);
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--em-400);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─────────────────────────────────────────────────────────
   CONTAS
───────────────────────────────────────────────────────── */
.accounts-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); }
@media (min-width: 640px)  { .accounts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .accounts-grid { grid-template-columns: repeat(3, 1fr); } }

.account-card {
  background: var(--bg-surface); padding: var(--sp-6);
  border-radius: var(--r-xl); border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  transition: all var(--t-base) var(--ease);
  animation: scaleIn var(--t-slow) var(--ease) both;
}
.account-card:hover { box-shadow: var(--sh-lg); transform: translateY(-3px); border-color: var(--em-500); }

.account-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-4); }
.account-icon { width: 46px; height: 46px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.account-icon svg { width: 20px; height: 20px; }
.account-actions { display: flex; gap: var(--sp-1); }
.account-name { font-size: var(--fs-lg); font-weight: 700; color: var(--text-1); margin-bottom: 2px; letter-spacing: -0.02em; }
.account-type { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; margin-bottom: var(--sp-4); }
.account-balance { font-size: var(--fs-2xl); font-weight: 800; color: var(--text-1); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────
   CATEGORIAS
───────────────────────────────────────────────────────── */
.categories-tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-5); }
.category-tab {
  padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); font-weight: 600;
  color: var(--text-2); cursor: pointer; border: none; background: none; font-family: var(--font);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--t-fast);
}
.category-tab:hover { color: var(--text-1); }
.category-tab.active { color: var(--em-600); border-bottom-color: var(--em-500); }

.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }

.category-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
  transition: all var(--t-fast);
}
.category-card:hover { box-shadow: var(--sh-sm); border-color: var(--border-s); }
.category-name  { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); flex: 1; }
.category-type  { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; margin-top: 2px; }
.category-dot   { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
/* Fix: .category-color usado no JS para o quadrado colorido do card */
.category-color {
  width: 14px; height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.category-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.category-actions  { flex-shrink: 0; }

.categories-ranking { display: flex; flex-direction: column; gap: var(--sp-2); }

.category-rank-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  background: var(--bg-subtle); border-radius: var(--r-md);
  border: 1px solid var(--border); transition: all var(--t-fast);
}
.category-rank-item:hover { background: var(--bg-surface); border-color: var(--em-500); transform: translateX(3px); }
.category-rank-info { display: flex; align-items: center; gap: var(--sp-2); flex: 1; min-width: 0; }
.category-rank-amount { font-size: var(--fs-sm); font-weight: 800; color: var(--text-1); flex-shrink: 0; letter-spacing: -0.02em; }

.category-bar-track { height: 5px; background: var(--g-200); border-radius: var(--r-full); overflow: hidden; flex: 1; }
.category-bar-fill  { height: 100%; border-radius: var(--r-full); transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }

/* ─────────────────────────────────────────────────────────
   METAS
───────────────────────────────────────────────────────── */
.goals-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); }
@media (min-width: 640px)  { .goals-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .goals-grid { grid-template-columns: repeat(3, 1fr); } }

.goal-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-6);
  box-shadow: var(--sh-sm); transition: all var(--t-base) var(--ease);
}
.goal-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: var(--em-500); }

.goal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-4); }
.goal-name { font-size: var(--fs-base); font-weight: 700; color: var(--text-1); letter-spacing: -0.02em; }
.goal-pct { font-size: var(--fs-xs); font-weight: 700; color: var(--em-600); background: var(--s-light); padding: 3px 8px; border-radius: var(--r-full); }
.goal-values { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; margin-top: var(--sp-2); }
.goal-date { font-size: var(--fs-sm); color: var(--text-3); }

.progress-bar { height: 6px; background: var(--g-200); border-radius: var(--r-full); overflow: hidden; margin-bottom: 2px; }
.progress-fill { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--em-400), var(--em-600)); transition: width 0.7s cubic-bezier(0.4,0,0.2,1); }

/* ─────────────────────────────────────────────────────────
   RECORRENTES
───────────────────────────────────────────────────────── */
.recurring-container { display: grid; grid-template-columns: 1fr; gap: var(--sp-6); }
@media (min-width: 768px) { .recurring-container { grid-template-columns: repeat(2, 1fr); } }

.recurring-section {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-6);
  box-shadow: var(--sh-sm);
  transition: background var(--t-slow), border-color var(--t-slow);
}

.recurring-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.recurring-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4); border: 1px solid var(--border);
  border-radius: var(--r-lg); border-left: 3px solid var(--g-300);
  transition: all var(--t-fast); background: var(--bg-subtle); min-width: 0;
}
.recurring-item:hover { box-shadow: var(--sh-sm); transform: translateX(3px); background: var(--bg-surface); }
.recurring-item-income  { border-left-color: var(--em-500); }
.recurring-item-expense { border-left-color: var(--danger); }

.recurring-info { flex: 1; min-width: 0; }
.recurring-description { font-weight: 700; color: var(--text-1); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recurring-meta { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.recurring-due-date   { font-size: var(--fs-xs); color: var(--em-600); font-weight: 600; margin-top: 2px; }
.recurring-duration   { font-size: var(--fs-xs); color: var(--info); font-weight: 600; margin-top: 2px; }
.recurring-amount     { font-size: var(--fs-xl); font-weight: 800; margin: 0 var(--sp-4); letter-spacing: -0.03em; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.recurring-actions    { display: flex; gap: var(--sp-1); align-items: center; flex-shrink: 0; }

/* Filtros */
.transactions-filters { display: flex; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.transactions-filters .form-input,
.transactions-filters .form-select { flex: 1; min-width: 140px; }

/* ─────────────────────────────────────────────────────────
   RELATÓRIOS
───────────────────────────────────────────────────────── */
.reports-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); }
/* reports: single col on mobile, 2 col on ≥768px */
@media (max-width: 767px) { .reports-grid { grid-template-columns: 1fr !important; } }
@media (min-width: 768px) { .reports-grid { grid-template-columns: repeat(2, 1fr); } }
.report-chart-full { grid-column: 1 / -1; }
.chart-container { position: relative; height: 280px; width: 100%; }

.report-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-6);
  box-shadow: var(--sh-sm);
  transition: background var(--t-slow), border-color var(--t-slow);
}

.card-title { font-size: var(--fs-base); font-weight: 700; color: var(--text-1); letter-spacing: -0.02em; margin-bottom: var(--sp-5); }

.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.report-summary-card { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); display: flex; align-items: center; gap: var(--sp-4); transition: all var(--t-fast); }
.report-summary-card:hover { box-shadow: var(--sh-sm); border-color: var(--em-500); }
.report-summary-icon { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--bg-surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.report-summary-icon svg { width: 16px; height: 16px; }
.report-summary-content { flex: 1; min-width: 0; }
.report-summary-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin-bottom: 4px; }
.report-summary-value { font-size: var(--fs-xl); font-weight: 800; color: var(--text-1); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.report-summary-income  { color: var(--em-600) !important; }
.report-summary-expense { color: var(--danger) !important; }
.report-summary-change  { font-size: var(--fs-xs); font-weight: 600; margin-top: 2px; }
.report-summary-change.positive { color: var(--em-600); }
.report-summary-change.negative { color: var(--danger); }
.report-summary-footer { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.report-chart { position: relative; min-height: 200px; max-height: 380px; overflow: hidden; }
.report-card-full { grid-column: 1 / -1; }

.year-nav { display: flex; align-items: center; gap: var(--sp-2); }
.year-display { font-size: var(--fs-2xl); font-weight: 800; color: var(--text-1); letter-spacing: -0.04em; min-width: 60px; text-align: center; }

/* ─────────────────────────────────────────────────────────
   PAGES GENÉRICAS
───────────────────────────────────────────────────────── */
.page-container { display: flex; flex-direction: column; gap: var(--sp-6); }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--sp-4); flex-wrap: wrap;
  animation: fadeInUp var(--t-slow) var(--ease) both;
}

.page-title { font-size: var(--fs-2xl); font-weight: 800; color: var(--text-1); letter-spacing: -0.04em; }
.page-subtitle { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.section-subtitle { font-size: var(--fs-base); font-weight: 700; color: var(--text-1); margin-bottom: var(--sp-4); letter-spacing: -0.02em; }

/* ─────────────────────────────────────────────────────────
   BADGES
───────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--s-light); color: var(--s-text); }
.badge-danger  { background: var(--d-light); color: var(--d-text); }
.badge-warning { background: var(--w-light); color: var(--w-text); }
.badge-info    { background: var(--i-light); color: var(--i-text); }
.badge-neutral { background: var(--g-100); color: var(--g-600); }

/* ─────────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: var(--sp-12) var(--sp-8);
  color: var(--text-3); background: var(--bg-subtle);
  border-radius: var(--r-xl); border: 1px dashed var(--border-s);
  animation: fadeIn var(--t-slow) var(--ease);
}

/* ─────────────────────────────────────────────────────────
   INSTALLMENTS
───────────────────────────────────────────────────────── */
.installments-badge { display: inline-block; font-size: var(--fs-xs); font-weight: 600; background: var(--g-100); color: var(--g-500); padding: 1px 6px; border-radius: var(--r-full); }
.installments-recurrent { font-style: italic; opacity: 0.6; }

/* ─────────────────────────────────────────────────────────
   AUTH PAGES
───────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-page); padding: var(--sp-5); }
.auth-container { width: 100%; max-width: 420px; animation: fadeInUp var(--t-slow) var(--ease) both; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin-bottom: var(--sp-8); text-decoration: none; color: var(--text-1); font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; }
.auth-form { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: var(--sp-8); box-shadow: var(--sh-lg); }
.auth-form h1, .auth-form h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.04em; margin-bottom: var(--sp-2); color: var(--text-1); }
.auth-form p { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--sp-6); }
.auth-divider { display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-5) 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.back-link { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); text-decoration: none; margin-bottom: var(--sp-5); transition: all var(--t-fast); }
.back-link:hover { color: var(--em-600); }
.plan-info { background: var(--s-light); border: 1px solid rgba(16,185,129,0.2); border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-5); font-size: var(--fs-sm); color: var(--s-text); }
.password-requirements { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); line-height: 1.6; }

/* ─────────────────────────────────────────────────────────
   ACCESS DENIED
───────────────────────────────────────────────────────── */
.denied-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-page); padding: var(--sp-6); }
.denied-container { width: 100%; max-width: 480px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: var(--sp-12); box-shadow: var(--sh-xl); text-align: center; }
.denied-icon { width: 64px; height: 64px; background: var(--d-light); border-radius: var(--r-xl); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-5); }
.denied-icon svg { width: 28px; height: 28px; color: var(--danger); }
.denied-title   { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.04em; margin-bottom: var(--sp-2); }
.denied-message { font-size: var(--fs-base); color: var(--text-2); margin-bottom: var(--sp-6); line-height: 1.6; }
.expired { background: var(--d-light); color: var(--d-text); border-radius: var(--r-md); padding: var(--sp-4); font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--sp-6); }
.plan-details { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); margin-bottom: var(--sp-6); text-align: left; }
.plan-detail-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.plan-detail-row:last-child { border-bottom: none; }
.plan-label { font-size: var(--fs-sm); color: var(--text-2); }
.plan-value { font-size: var(--fs-sm); font-weight: 700; color: var(--text-1); }
.support-info { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--sp-5); }

/* ─────────────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────────────── */
.footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding: var(--sp-4) 0; margin-top: auto; text-align: center; color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; }

/* ─────────────────────────────────────────────────────────
   DARK MODE OVERRIDES
───────────────────────────────────────────────────────── */
html.dark .summary-section,
html.dark .transactions-section,
html.dark .spending-chart-section,
html.dark .forecast-compact,
html.dark .recurring-section,
html.dark .report-card,
html.dark .account-card,
html.dark .goal-card    { background: var(--bg-surface); border-color: var(--border); }

html.dark .summary-card  { background: var(--bg-subtle); border-color: var(--border); border-top-color: inherit; }
html.dark .summary-icon  { background: var(--bg-muted); border-color: var(--border); }
html.dark .transaction-item { background: var(--bg-surface); }
html.dark .transaction-item:hover { background: var(--bg-subtle); }
html.dark .forecast-compact-item { background: var(--bg-subtle); border-color: var(--border); }
html.dark .forecast-compact-item:hover { background: var(--bg-surface); }
html.dark .recurring-item { background: var(--bg-subtle); border-color: var(--border); }
html.dark .recurring-item:hover { background: var(--bg-surface); }
html.dark .category-rank-item { background: var(--bg-subtle); }
html.dark .metricas-previstas { background: var(--bg-subtle); border-color: var(--border); }
html.dark .form-input,
html.dark .form-select,
html.dark .form-textarea { background: var(--bg-subtle); border-color: var(--border); color: var(--text-1); }
html.dark .modal { background: var(--bg-surface); border-color: var(--border); }
html.dark .modal-header { background: var(--bg-surface); }
html.dark .btn-secondary,
html.dark .btn-outline { background: var(--bg-subtle); border-color: var(--border); color: var(--text-1); }
html.dark .progress-bar { background: var(--g-200); }
html.dark .spending-bar-container { background: var(--g-200); }
html.dark .category-bar-track { background: var(--g-200); }
html.dark .empty-state { background: var(--bg-subtle); border-color: var(--border-s); }
/* fab-item-label dark: color is white, handled by gradient bg */

/* ─────────────────────────────────────────────────────────
   TABLET 640–1023px
───────────────────────────────────────────────────────── */
@media (min-width: 640px) and (max-width: 1023px) {
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .main-grid     { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────
   MOBILE ≤768px
───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* ── ROOT FIX: body é flex-row por padrão, no mobile precisa ser coluna ── */
  body {
    flex-direction: column !important;
  }

  /* Topbar: ocupa 100% da largura, fica no topo */
  .topbar-mobile {
    display: flex !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    order: -1;
  }

  /* App-wrapper: ocupa o resto da altura abaixo do topbar */
  .app-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
  }

  .app-wrapper.has-sidebar {
    padding-left: 0 !important;
  }

  /* Sidebar: off-canvas, nunca ocupa espaço de layout */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    box-shadow: none;
    position: fixed;
    top: 0; left: 0; height: 100vh;
    z-index: 200;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.45);
  }

  /* Main: sem padding extra — topbar é sticky e não precisa de offset */
  .main { padding: var(--sp-4) 0; width: 100%; }

  html { overflow-x: hidden; }

  .container {
    padding: 0 var(--sp-4);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Dashboard header */
  .dashboard-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: var(--sp-2);
  }
  .dashboard-month { font-size: var(--fs-lg); white-space: nowrap; }
  .month-nav-compact { flex-shrink: 0; }

  /* Cards: 2 colunas */
  .summary-section { padding: var(--sp-4); }
  .summary-cards   { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .summary-card    { padding: var(--sp-3); }
  .summary-icon    { width: 26px; height: 26px; margin-bottom: var(--sp-2); }
  .summary-icon svg { width: 12px; height: 12px; }
  .summary-label   { font-size: 8px; }
  .summary-value   { font-size: 0.875rem; }

  /* Grid: coluna única */
  .main-grid { grid-template-columns: 1fr !important; }

  /* Forecast */
  .forecast-compact { overflow: hidden; }
  .forecast-list    { padding: 0 var(--sp-3) var(--sp-4); }

  /* Spending */
  .spending-chart-section { padding: var(--sp-4); }
  .spending-item:hover    { transform: none; }

  /* Transações */
  .transactions-section { border-radius: var(--r-lg); }
  .section-header  { padding: var(--sp-4); }
  .transaction-item {
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-2);
    flex-wrap: nowrap;
  }
  .transaction-icon { width: 30px; height: 30px; border-radius: var(--r-sm); }
  .transaction-icon-income svg,
  .transaction-icon-expense svg { width: 13px !important; height: 13px !important; }
  .transaction-description { font-size: var(--fs-xs); }
  .transaction-meta        { font-size: 9px; }
  .transaction-amount      { font-size: var(--fs-sm); }
  .transaction-actions     { opacity: 1; flex-shrink: 0; }

  /* Page header */
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn { width: 100%; justify-content: center; }
  .page-title { font-size: var(--fs-xl); }

  /* Filters */
  .transactions-filters { flex-direction: column; gap: var(--sp-2); }

  /* FAB */
  .fab      { width: 46px; height: 46px; bottom: var(--sp-5); right: var(--sp-4); }
  .fab svg  { width: 20px; height: 20px; }
  .fab-menu { bottom: calc(var(--sp-5) + 54px); right: var(--sp-4); }

  /* Recurring */
  .recurring-item   { flex-wrap: wrap; gap: var(--sp-2); }
  .recurring-amount { font-size: var(--fs-base); margin: 0 var(--sp-2); }

  /* Grids */
  .goals-grid    { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }

  /* Métricas */
  .metricas-previstas { font-size: 10px; padding: var(--sp-2) var(--sp-3); }
  .metrica-separador  { display: none; }
  .metrica-item       { flex-basis: 100%; justify-content: space-between; }
}

/* ─────────────────────────────────────────────────────────
   MOBILE PEQUENO ≤480px
───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container       { padding: 0 var(--sp-3); }
  .summary-cards   { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .summary-card    { padding: var(--sp-2) var(--sp-3); }
  .summary-icon    { width: 24px; height: 24px; margin-bottom: 6px; }
  .summary-icon svg { width: 11px; height: 11px; }
  .summary-value   { font-size: 0.8125rem; }
  .dashboard-month { font-size: var(--fs-lg); }
  .section-header  { padding: var(--sp-3) var(--sp-4); }
  .transaction-item { padding: var(--sp-2) var(--sp-3); }
  .recurring-amount { font-size: var(--fs-sm); margin: 0 var(--sp-1); }
  .fab { bottom: var(--sp-4); right: var(--sp-3); width: 44px; height: 44px; }
}

/* ─────────────────────────────────────────────────────────
   ACESSIBILIDADE
───────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────
   MODAL FIXOS DO MÊS
───────────────────────────────────────────────────────── */
.recurring-modal-container { display: flex; flex-direction: column; gap: var(--sp-5); }
.recurring-modal-section   { display: flex; flex-direction: column; gap: var(--sp-2); }
.recurring-modal-title {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: var(--sp-1);
}
.recurring-modal-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.recurring-modal-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  border-left: 3px solid var(--g-300);
  transition: all var(--t-fast);
}
.recurring-modal-item:hover {
  background: var(--bg-surface);
  box-shadow: var(--sh-sm);
  transform: translateX(2px);
}
.recurring-modal-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.recurring-modal-name {
  font-size: var(--fs-sm); font-weight: 700; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.recurring-modal-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: var(--fs-xs); color: var(--text-3);
}
.recurring-modal-dot { opacity: 0.4; }
.recurring-modal-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2);
  flex-shrink: 0;
}
.recurring-modal-amount {
  font-size: var(--fs-base); font-weight: 800;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
html.dark .recurring-modal-item {
  background: var(--bg-subtle); border-color: var(--border);
}
html.dark .recurring-modal-item:hover { background: var(--bg-surface); }

/* ─────────────────────────────────────────────────────────
   MODAL PERFIL
───────────────────────────────────────────────────────── */
.profile-modal-header {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.profile-modal-avatar {
  width: 60px; height: 60px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--em-500), var(--em-700));
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xl); font-weight: 800; color: white;
  flex-shrink: 0; overflow: hidden; border: 3px solid var(--border);
  cursor: pointer; position: relative;
}
.profile-modal-avatar:hover::after {
  content: 'Trocar foto';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: white;
}
.profile-modal-info { flex: 1; min-width: 0; }
.profile-modal-name {
  font-size: var(--fs-lg); font-weight: 800; color: var(--text-1);
  letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-modal-email { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.profile-plan-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--s-light); color: var(--s-text);
  font-size: var(--fs-xs); font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-full);
  margin-top: var(--sp-2); letter-spacing: 0.01em;
}
.profile-plan-badge svg { width: 11px; height: 11px; }


/* ─────────────────────────────────────────────────────────
   CATEGORY SUGGESTION BANNER (novos usuários)
───────────────────────────────────────────────────────── */
.category-suggestion {
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(16,185,129,0.02));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-xl);
  padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: flex-start; gap: var(--sp-4);
  animation: fadeInUp var(--t-slow) var(--ease) both;
  margin-bottom: var(--sp-2);
}
.category-suggestion-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--s-light); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
}
.category-suggestion-icon svg { width: 16px; height: 16px; color: var(--em-600); }
.category-suggestion-content { flex: 1; min-width: 0; }
.category-suggestion-title {
  font-size: var(--fs-sm); font-weight: 700; color: var(--text-1);
  margin-bottom: var(--sp-2); letter-spacing: -0.01em;
}
.category-suggestion-chips {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
}
.category-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: var(--fs-xs); font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-full);
  cursor: pointer; transition: all var(--t-fast); font-family: var(--font);
  white-space: nowrap;
}
.category-chip:hover {
  background: var(--s-light); border-color: var(--em-500);
  color: var(--em-700); transform: translateY(-1px);
}
.category-chip .chip-dot {
  width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0;
}
.category-suggestion-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 2px; flex-shrink: 0;
  transition: color var(--t-fast); border-radius: var(--r-sm);
}
.category-suggestion-dismiss:hover { color: var(--text-1); }
html.dark .category-suggestion {
  background: rgba(16,185,129,0.05);
  border-color: rgba(16,185,129,0.15);
}
html.dark .category-chip {
  background: var(--bg-subtle); border-color: var(--border);
}

/* ─────────────────────────────────────────────────────────
   OFX IMPORT MODAL
───────────────────────────────────────────────────────── */
.ofx-dropzone {
  border: 2px dashed var(--border-s);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  text-align: center; cursor: pointer;
  transition: all var(--t-base);
  background: var(--bg-subtle);
}
.ofx-dropzone:hover, .ofx-dropzone.drag-over {
  border-color: var(--em-500);
  background: rgba(16,185,129,0.04);
}
.ofx-dropzone-icon {
  width: 48px; height: 48px; margin: 0 auto var(--sp-3);
  background: var(--s-light); border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
}
.ofx-dropzone-icon svg { width: 22px; height: 22px; color: var(--em-600); }
.ofx-dropzone-text { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.ofx-dropzone-hint { font-size: var(--fs-xs); color: var(--text-3); }
.ofx-file-selected {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--s-light); border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-3);
}
.ofx-file-name { font-size: var(--fs-sm); font-weight: 600; color: var(--s-text); flex: 1; }
.ofx-transactions-preview {
  margin-top: var(--sp-4); max-height: 280px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.ofx-preview-header {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: var(--sp-3); padding: var(--sp-2) var(--sp-4);
  background: var(--bg-muted); font-size: var(--fs-xs);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); border-bottom: 1px solid var(--border);
}
.ofx-preview-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border); font-size: var(--fs-xs);
  align-items: center; transition: background var(--t-fast);
}
.ofx-preview-row:last-child { border-bottom: none; }
.ofx-preview-row:hover { background: var(--bg-subtle); }
.ofx-preview-desc { font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ofx-preview-date { color: var(--text-3); white-space: nowrap; }
.ofx-preview-amount { font-weight: 700; white-space: nowrap; }
.ofx-preview-income  { color: var(--em-600); }
.ofx-preview-expense { color: var(--danger); }
.ofx-summary-bar {
  display: flex; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  background: var(--bg-subtle); border-radius: var(--r-md);
  margin-top: var(--sp-3); font-size: var(--fs-xs); flex-wrap: wrap;
}
.ofx-summary-item { display: flex; align-items: center; gap: var(--sp-2); }
.ofx-summary-label { color: var(--text-3); }
.ofx-summary-value { font-weight: 700; }

/* ─────────────────────────────────────────────────────────
   PROFILE MODAL FULL
───────────────────────────────────────────────────────── */
.profile-section-title {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  margin-bottom: var(--sp-3); margin-top: var(--sp-5);
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border);
}
.profile-section-title:first-child { margin-top: 0; }
.plan-info-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(16,185,129,0.03));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-lg); padding: var(--sp-4);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
}
.plan-info-card-left { display: flex; flex-direction: column; gap: 3px; }
.plan-info-name { font-size: var(--fs-base); font-weight: 800; color: var(--text-1); letter-spacing: -0.02em; }
.plan-info-expiry { font-size: var(--fs-xs); color: var(--text-3); }
.plan-cancel-btn {
  font-size: var(--fs-xs); font-weight: 600; font-family: var(--font);
  color: var(--danger); background: none; border: 1px solid rgba(239,68,68,0.3);
  padding: 5px 12px; border-radius: var(--r-full); cursor: pointer;
  transition: all var(--t-fast); white-space: nowrap;
}
.plan-cancel-btn:hover { background: var(--d-light); border-color: var(--danger); }


/* ─────────────────────────────────────────────────────────
   IMPORT OFX BUTTON — hide label on small screens
───────────────────────────────────────────────────────── */
.btn-import-label { display: inline; }
@media (max-width: 480px) {
  .btn-import-label { display: none; }
}

/* ─────────────────────────────────────────────────────────
   PROFILE SECTION TITLE
───────────────────────────────────────────────────────── */
.profile-section-title {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  margin: var(--sp-5) 0 var(--sp-3);
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border);
}
.plan-info-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(16,185,129,0.03));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-lg); padding: var(--sp-4);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
}
.plan-info-card-left { display: flex; flex-direction: column; gap: 3px; }
.plan-info-name { font-size: var(--fs-base); font-weight: 800; color: var(--text-1); letter-spacing: -0.02em; }
.plan-info-expiry { font-size: var(--fs-xs); color: var(--text-3); }
.plan-cancel-btn {
  font-size: var(--fs-xs); font-weight: 600; font-family: var(--font);
  color: var(--danger); background: none; border: 1px solid rgba(239,68,68,0.3);
  padding: 5px 12px; border-radius: var(--r-full); cursor: pointer;
  transition: all var(--t-fast); white-space: nowrap;
}
.plan-cancel-btn:hover { background: var(--d-light); border-color: var(--danger); }

/* ══════════════════════════════════════════════════════════
   USER MENU (UM) — Menu de conta da sidebar
   Tokens: usa variáveis da sidebar existentes para zero drift
   ══════════════════════════════════════════════════════════ */

/* Menu de conta — vive no body (teleportado via JS), sem conflito com overflow:hidden */
.sidebar-user-menu {
  padding: var(--sp-1);
  min-width: 220px;
  /* position, top, left, width definidos por JS — não sobrescrever aqui */
  background: #1a1d2b !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.3) !important;
}

/* Cabeçalho do menu */
.um-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
}

.um-avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: white;
  flex-shrink: 0; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.12);
  cursor: pointer; transition: opacity var(--t-fast);
}
.um-avatar:hover { opacity: 0.85; }
.um-avatar span { line-height: 1; }

.um-header-info { flex: 1; min-width: 0; }

.um-header-name {
  font-size: var(--fs-sm); font-weight: 700;
  color: rgba(255,255,255,0.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.um-header-email {
  font-size: 10px; color: rgba(255,255,255,0.38);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}

/* Divisor */
.um-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: var(--sp-1) 0;
}

/* Item base */
.um-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font);
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
  line-height: 1.3;
}
.um-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.92);
}
.um-item:active { background: rgba(255,255,255,0.1); }
.um-item:focus-visible {
  outline: 2px solid var(--em-500);
  outline-offset: -2px;
}

/* Ícone do item */
.um-item-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.um-item:hover .um-item-icon { background: rgba(255,255,255,0.1); }

.um-item-icon--plan { background: rgba(16,185,129,0.15); }
.um-item-icon--plan svg { stroke: var(--em-400); }
.um-item:hover .um-item-icon--plan { background: rgba(16,185,129,0.22); }

.um-item-icon--ref { background: rgba(59,130,246,0.15); }
.um-item-icon--ref svg { stroke: #60a5fa; }
.um-item:hover .um-item-icon--ref { background: rgba(59,130,246,0.22); }

/* Label do item */
.um-item-label {
  flex: 1;
  display: flex; align-items: center; gap: var(--sp-2);
}

/* Badge "Ativo/Expirado" inline no plano */
.um-plan-badge {
  font-size: 9px; font-weight: 700;
  background: rgba(16,185,129,0.2);
  color: var(--em-400);
  padding: 1px 6px; border-radius: var(--r-full);
  letter-spacing: 0.03em; text-transform: uppercase;
}

/* Dias restantes */
.um-plan-days {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* Badge "Novo" */
.um-badge-new {
  font-size: 9px; font-weight: 700;
  background: rgba(16,185,129,0.2);
  color: var(--em-400);
  padding: 1px 6px; border-radius: var(--r-full);
  letter-spacing: 0.02em;
}

/* Item cancelar — discreto */
.um-item--cancel {
  margin-top: 2px;
  padding: 5px var(--sp-2);
  justify-content: center;
}
.um-item--cancel .um-item-label {
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,0.22);
  text-decoration: underline;
  text-underline-offset: 2px;
  justify-content: center;
}
.um-item--cancel:hover .um-item-label { color: rgba(239,68,68,0.7); }
.um-item--cancel:hover { background: rgba(239,68,68,0.06); }

/* ── Modals do UM ── */

/* Modal: Editar Nome inline */
.um-name-inline {
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
}
.um-name-inline label {
  display: block;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: rgba(255,255,255,0.35);
  margin-bottom: var(--sp-2);
}
.um-name-inline input {
  width: 100%; height: 34px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.9);
  font-family: var(--font); font-size: var(--fs-xs); font-weight: 600;
  padding: 0 var(--sp-3); outline: none;
  transition: border-color var(--t-fast);
}
.um-name-inline input:focus { border-color: var(--em-500); }
.um-name-inline input::placeholder { color: rgba(255,255,255,0.25); }
.um-name-actions {
  display: flex; gap: var(--sp-2); margin-top: var(--sp-2);
}
.um-name-actions button {
  flex: 1; height: 30px; border-radius: var(--r-sm);
  font-family: var(--font); font-size: 11px; font-weight: 700;
  cursor: pointer; border: none; transition: all var(--t-fast);
}
.um-name-btn-save {
  background: var(--em-500); color: white;
}
.um-name-btn-save:hover { background: var(--em-600); }
.um-name-btn-cancel {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
}
.um-name-btn-cancel:hover { background: rgba(255,255,255,0.1); }

/* Plan info card no modal */
.um-plan-card {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
}
.um-plan-card-name {
  font-size: var(--fs-lg); font-weight: 800;
  color: var(--text-1); letter-spacing: -0.03em;
  margin-bottom: 3px;
}
.um-plan-card-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border); font-size: var(--fs-xs);
}
.um-plan-card-row:last-child { border-bottom: none; }
.um-plan-card-label { color: var(--text-3); }
.um-plan-card-value { font-weight: 700; color: var(--text-1); }
.um-plan-status-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--em-500);
  margin-right: 5px; box-shadow: 0 0 6px rgba(16,185,129,0.5);
}

/* Referral card */
.um-referral-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.um-referral-code-row {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-3);
}
.um-referral-code {
  flex: 1; font-size: var(--fs-base); font-weight: 800;
  color: var(--text-1); letter-spacing: 0.08em;
  font-family: monospace;
}
.um-copy-btn {
  background: var(--em-500); color: white;
  border: none; border-radius: var(--r-sm);
  padding: 5px 12px; font-size: var(--fs-xs); font-weight: 700;
  font-family: var(--font); cursor: pointer;
  transition: background var(--t-fast); white-space: nowrap;
}
.um-copy-btn:hover { background: var(--em-600); }
.um-referral-benefit {
  font-size: var(--fs-xs); color: var(--text-3);
  margin-top: var(--sp-3); line-height: 1.5;
}
.um-referral-benefit strong { color: var(--em-600); }

/* ── FIX: Chevron animado ── */
.sidebar-user-chevron {
  transition: transform var(--t-base) var(--ease) !important;
}
.sidebar-user.menu-open .sidebar-user-chevron {
  transform: rotate(180deg);
}

/* Mobile: sidebar-user-menu usa fixed via JS */


/* ── Foto expandida overlay ── */
@keyframes umFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes umScaleIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
#umPhotoOverlay { animation: umFadeIn 0.2s ease; }
#umPhotoOverlay img { animation: umScaleIn 0.2s ease; }

/* ── Avatar clicável no menu ── */
.um-avatar {
  cursor: zoom-in !important;
}

:focus-visible { outline: 2px solid var(--em-500); outline-offset: 2px; }
/* OVERRIDE DEFINITIVO: forçar sidebar-user-menu a não ter position/bottom do CSS */
body > .sidebar-user-menu,
.sidebar-user-menu {
  position: fixed !important;
  bottom: auto !important;
  right: auto !important;
}

.sidebar-user-menu.active { display: block !important; }
