/* ═══════════════════════════════════════════════════════════
   CARTEIRA ASSISTIDA V2 — "Decimal" Design System
   Premium dark theme with glassmorphism & heavy gradients
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Light content area + dark sidebar, ActiveHub-inspired */
  --bg-primary: #f4f5f7;
  --bg-secondary: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.9);
  --bg-sidebar: #14161f;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.08);

  --bg-card: #ffffff;
  --bg-card-hover: #fbfbfc;

  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-border-hover: rgba(15, 23, 42, 0.16);
  --glass-blur: 20px;

  --text-primary: #111827;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-on-dark: #f4f5f7;

  --accent-primary: #f59e0b;
  --accent-primary-hover: #ea8f00;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;

  /* Formatted Decimal gradients */
  --grad-blue: linear-gradient(135deg, #2563eb, #8b5cf6);
  --grad-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
  --grad-green: linear-gradient(135deg, #059669, #3b82f6);
  --grad-cyan: linear-gradient(135deg, #06b6d4, #2563eb);
  --grad-orange: linear-gradient(135deg, #f59e0b, #ea580c);

  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-card-lg: 0 12px 36px rgba(15, 23, 42, 0.1);

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(245, 158, 11, 0.05), transparent),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(139, 92, 246, 0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-xl) var(--space-2xl);
}

/* ════════════════════════════════
   SIDEBAR (Decimal Style)
   ════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width var(--transition-smooth), transform var(--transition-smooth);
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 70px;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  overflow: hidden;
}

.sidebar__logo-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  background: var(--grad-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse-glow 3s infinite alternate;
}

.sidebar__logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.sidebar__toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(244, 245, 247, 0.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.sidebar__toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-on-dark);
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-md);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: rgba(244, 245, 247, 0.65);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
}

.sidebar__link--active {
  background: var(--accent-primary);
  color: #1a1200;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.sidebar__link--admin { color: rgba(244, 245, 247, 0.65); }
.sidebar__link--admin.sidebar__link--active { background: var(--accent-primary); color: #1a1200; }

.sidebar__link-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.sidebar__footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left var(--transition-smooth);
  position: relative;
  z-index: 1;
}

.sidebar-backdrop {
  display: none;
}

/* Collapsed rail state (desktop) */
body.sidebar-collapsed .sidebar { width: 76px; }
body.sidebar-collapsed .sidebar__logo-text,
body.sidebar-collapsed .sidebar__link-text { display: none; }
body.sidebar-collapsed .sidebar__header { justify-content: center; }
body.sidebar-collapsed .sidebar__link { justify-content: center; padding: 12px; }
body.sidebar-collapsed .user-profile-badge { justify-content: center; }
body.sidebar-collapsed .main-content { margin-left: 76px; }

/* ════════════════════════════════
   TOPBAR
   ════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  height: 70px;
  background: var(--bg-nav);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}

.topbar__title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Mobile: sidebar becomes an overlay drawer */
@media (max-width: 880px) {
  .sidebar, body.sidebar-collapsed .sidebar {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }
  body.sidebar-mobile-open .sidebar { transform: translateX(0); }
  .sidebar__logo-text, .sidebar__link-text,
  body.sidebar-collapsed .sidebar__logo-text,
  body.sidebar-collapsed .sidebar__link-text { display: inline-block; }
  body.sidebar-collapsed .sidebar__header { justify-content: space-between; }
  body.sidebar-collapsed .sidebar__link { justify-content: flex-start; }
  .main-content, body.sidebar-collapsed .main-content { margin-left: 0; }
  .topbar__menu-btn { display: flex; }
  body.sidebar-mobile-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

/* ════════════════════════════════
   TABS (Options page)
   ════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 12px;
  margin-bottom: var(--space-xl);
}

.tab-chip {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tab-chip:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--glass-border-hover);
}

.tab-chip--active {
  background: var(--accent-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.navbar__dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.04);
  padding: 6px 12px;
  border-radius: 100px;
}

.navbar__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.navbar__select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.navbar__select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.header__badges {
  display: flex;
  gap: 8px;
}

.header__badge {
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.header__badge strong {
  color: var(--text-primary);
}

/* ════════════════════════════════
   PAGES
   ════════════════════════════════ */
.page {
  display: none;
  animation: fade-in var(--transition-smooth) ease;
}

.page--active {
  display: block;
}

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

/* ════════════════════════════════
   SEARCH / AUTOCOMPLETE
   ════════════════════════════════ */
.search-section {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.search-bar-wrapper {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 8px 8px 8px 24px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast);
}

.search-bar:focus-within {
  border-color: var(--accent-blue);
}

.search-bar__icon {
  font-size: 1.1rem;
  margin-right: var(--space-sm);
}

.search-bar__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
}

.search-bar__input::placeholder {
  color: var(--text-muted);
}

.search-bar__btn {
  padding: 12px 28px;
  background: var(--accent-primary);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.search-bar__btn:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.02);
}

/* Autocomplete Overlay */
.autocomplete-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-lg);
  z-index: 500;
  overflow: hidden;
  text-align: left;
}

.ac-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition-fast);
}
.ac-item:last-child { border-bottom: none; }

.ac-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.ac-main { display: flex; flex-direction: column; }
.ac-symbol { font-weight: 700; color: var(--text-primary); font-size: 1.1rem; }
.ac-name { font-weight: 500; color: var(--text-secondary); font-size: 0.8rem; }

.ac-type {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 100px;
  color: var(--text-muted);
}

.search-bar__hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 20px;
  margin-top: 10px;
}
.search-bar__hint--error { color: var(--accent-red); }

/* ════════════════════════════════
   STOCK CARDS (Decimal UI)
   ════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stock-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.stock-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-lg);
  border-color: var(--glass-border-hover);
}

.stock-card--attractive {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), var(--bg-card));
  border-color: rgba(16, 185, 129, 0.2);
}

.stock-card--expensive {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.1), var(--bg-card));
  border-color: rgba(239, 68, 68, 0.2);
}

.card__remove {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.04);
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}
.card__remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.card__identity {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.card__ticker { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.card__name { font-size: 0.8rem; color: var(--text-secondary); }

.card__meta-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.meta-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--text-secondary);
}

.card__price-area {
  display: flex;
  align-items: baseline;
  margin-bottom: 10px;
}

.card__price {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.card__currency {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}

.card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.card__metrics--4col {
  grid-template-columns: repeat(4, 1fr);
}

.metric {
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.metric__label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.metric__value {
  font-size: 0.88rem;
  font-weight: 700;
}

.val-up { color: var(--accent-green); }
.val-down { color: var(--accent-red); }
.val-neutral { color: var(--text-primary); }

/* Varos Specific Sub-sections */
.card__section {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px dashed var(--glass-border);
}

.card__section-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.varos-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.varos-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.varos-badge--safety {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.varos-badge--danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.varos-badge--warning {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #facc15;
}

.varos-badge--quality {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #a78bfa;
}

/* ════════════════════════════════
   EDUCATION SECTION (DECIMAL STYLE)
   ════════════════════════════════ */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.03em;
}

.strategies__intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 700px;
}

/* Asymmetric grid to look like Decimal dashboard */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(240px, auto);
  gap: var(--space-xl);
}

.edu-card {
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  color: #fff;
  transition: transform var(--transition-smooth);
}

.edu-card:hover { transform: translateY(-4px); }

/* Sizes */
.edu-card--hero { grid-column: span 2; grid-row: span 2; }
.edu-card--rect { grid-column: span 2; grid-row: span 1; }
.edu-card--square { grid-column: span 1; grid-row: span 1; }

@media (max-width: 900px) {
  .edu-grid { grid-template-columns: 1fr; }
  .edu-card--hero, .edu-card--rect, .edu-card--square { grid-column: span 1; grid-row: auto; }
}

/* Colors / Gradients */
.edu-card--blue { background: var(--grad-blue); }
.edu-card--purple { background: var(--grad-purple); }
.edu-card--green { background: var(--grad-green); }
.edu-card--cyan { background: var(--grad-cyan); }
.edu-card--orange { background: var(--grad-orange); }

.edu-card__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.edu-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.edu-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.edu-card__header .edu-card__icon { margin-bottom: 0; font-size: 1.8rem; }

.edu-card__title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.edu-card--rect .edu-card__title, .edu-card--square .edu-card__title {
  font-size: 1.4rem;
}

.edu-card__desc {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.6;
  flex: 1;
}

.edu-card--square .edu-card__desc {
  font-size: 0.9rem;
}

.edu-card__tags {
  display: flex;
  gap: 8px;
  margin-top: var(--space-lg);
}

.edu-tag {
  padding: 4px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Rigor Selector */
.rigor-selector {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.rigor-chip {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.rigor-chip:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--glass-border-hover);
}

.rigor-chip--active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.rigor-chip--active:hover {
  background: var(--accent-purple);
  opacity: 0.9;
}


/* ════════════════════════════════
   EMPTY STATE & ERROR BANNER
   ════════════════════════════════ */
.empty-state { text-align: center; padding: 100px 20px; }
.empty-state__icon { font-size: 4rem; opacity: 0.5; display: block; margin-bottom: 20px; }
.empty-state__title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.empty-state__text { color: var(--text-secondary); }

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--glass-border);
  border-bottom-color: var(--accent-purple);
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.error-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
}

.error-banner__close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ════════════════════════════════
   CHARTS
   ════════════════════════════════ */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}
.chart__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.chart__subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }
.chart__canvas-wrapper { position: relative; height: 300px; }

/* ════════════════════════════════
   OPTIONS LAB & PORTFOLIO
   ════════════════════════════════ */
.options-lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.options-lab-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}

.options-lab-card__title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.portfolio-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.portfolio-summary-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  background: var(--grad-blue);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  color: #fff;
}

.portfolio-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-item {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 600;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.summary-sub {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 4px;
}

.portfolio-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.varos-table th {
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--glass-border);
}

.varos-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--glass-border);
}

/* ════════════════════════════════
   LANÇAMENTOS POR SÉRIE
   ════════════════════════════════ */
.series-block {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.series-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.025);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.series-block__header:hover {
  background: rgba(15, 23, 42, 0.05);
}

.series-block__header-total {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.series-block__chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  display: inline-block;
}

.series-block--collapsed .series-block__chevron {
  transform: rotate(-90deg);
}

.series-block--collapsed .series-block__body {
  display: none;
}

.series-block .varos-table th {
  padding: 8px 12px;
  font-size: 0.68rem;
}

.series-block .varos-table td {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.series-block__content {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.series-block__content > .series-block__table-wrap {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}

.series-open-positions {
  flex: 0 0 220px;
  border-left: 1px solid var(--glass-border);
  padding: 12px 14px;
  align-self: stretch;
  background: rgba(15, 23, 42, 0.015);
}

.series-open-positions__title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.series-open-positions__item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  padding: 4px 0;
  border-bottom: 1px dashed var(--glass-border);
}

.series-open-positions__item:last-child {
  border-bottom: none;
}

.series-open-positions__code {
  font-weight: 700;
}

.series-open-positions__qty {
  font-weight: 800;
  white-space: nowrap;
}

.series-open-positions__empty {
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .series-block__content {
    flex-direction: column;
  }
  .series-open-positions {
    flex: 1 1 auto;
    border-left: none;
    border-top: 1px solid var(--glass-border);
  }
}

.year-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  font-weight: 800;
  font-size: 1.1rem;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  padding: var(--space-2xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.modal-title { font-size: 1.4rem; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.search-bar__btn--cancel {
  background: transparent;
  border: 1px solid var(--glass-border);
}
.search-bar__btn--cancel:hover { background: rgba(15, 23, 42, 0.04); }

/* Portfolio Polish */
.portfolio-summary-card {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  position: relative;
  overflow: hidden;
}

.portfolio-summary-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

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

/* ── SaaS Auth CSS Styles ── */
.auth-container {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.auth-panel {
  display: flex;
  flex-direction: column;
  padding: var(--space-2xl);
}

.auth-panel--dark {
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-panel--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 100%, rgba(245, 158, 11, 0.12), transparent),
    radial-gradient(ellipse 50% 50% at 90% 0%, rgba(139, 92, 246, 0.1), transparent);
  pointer-events: none;
}

.auth-panel__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.auth-panel__brand {
  font-size: 1.2rem;
  font-weight: 800;
}

.auth-panel__hero {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.auth-panel__title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.auth-panel__title-accent { color: var(--accent-primary); }

.auth-panel__sub {
  color: rgba(244, 245, 247, 0.7);
  font-size: 1rem;
  margin-bottom: var(--space-lg);
}

.auth-panel__bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-panel__bullets li {
  font-size: 0.9rem;
  color: rgba(244, 245, 247, 0.85);
  padding-left: 18px;
  position: relative;
}

.auth-panel__bullets li::before {
  content: '•';
  color: var(--accent-primary);
  position: absolute;
  left: 0;
  font-weight: 800;
}

.auth-panel__footer {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: rgba(244, 245, 247, 0.5);
  font-style: italic;
}

.auth-panel--light {
  background: var(--bg-card);
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}

.auth-card__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.auth-card__subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.auth-logo-icon {
  font-size: 1.6rem;
}

.auth-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.04);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-xl);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.auth-tab--active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.auth-submit-btn {
  width: 100%;
  margin-top: var(--space-md);
  padding: 14px;
  font-size: 1rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  margin: var(--space-xl) 0 var(--space-md);
  font-weight: 700;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--glass-border);
}

.auth-divider span {
  padding: 0 10px;
}

.google-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  border: none;
  border-radius: 100px;
  padding: 12px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.google-auth-btn:hover {
  background: #f3f4f6;
  transform: scale(1.01);
}

.auth-error-msg {
  margin-top: var(--space-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.user-profile-badge__avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--grad-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.user-profile-badge__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  white-space: nowrap;
}

.user-profile-badge__info strong {
  color: var(--text-on-dark);
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--accent-red);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 0;
  padding: 0;
  text-align: left;
}
.btn-logout:hover {
  text-decoration: underline;
}

/* User Admin Area Panel styles */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.admin-user-item {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ════════════════════════════════
   MEU DINHEIRO
   ════════════════════════════════ */
.finance-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 900px) {
  .finance-layout { grid-template-columns: 1fr; }
}

.finance-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: sticky;
  top: 0;
}

.finance-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 800;
}

.finance-month-btn {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}
.finance-month-btn:hover { background: rgba(15, 23, 42, 0.08); }

.finance-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.finance-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}

.finance-icon-btn {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.finance-icon-btn:hover { background: rgba(15, 23, 42, 0.09); }

.finance-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}
.finance-account-row:last-child { border-bottom: none; }

.finance-account-row input[type="checkbox"] { accent-color: var(--accent-blue); }
.finance-account-row__name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-account-row__values { text-align: right; font-weight: 700; font-size: 0.8rem; }

.finance-account-total {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.025);
}

.finance-results-body {
  padding: 12px 16px;
  font-size: 0.85rem;
}

.finance-results-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.finance-results-row--group {
  font-weight: 800;
  margin-top: 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
}

.finance-results-row--total {
  border-top: 1px solid var(--glass-border);
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 800;
  font-size: 0.95rem;
}

.finance-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.finance-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.finance-search {
  max-width: 280px;
  flex-shrink: 0;
  padding: 6px 6px 6px 18px;
}

.finance-status-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.finance-status-chip {
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.finance-status-chip:hover { background: rgba(15, 23, 42, 0.04); }
.finance-status-chip--active { background: var(--accent-primary); color: #fff; border-color: transparent; }

.finance-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.finance-row-saldo-anterior td {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

.finance-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.finance-status-dot--pendente { background: var(--accent-red); }
.finance-status-dot--agendado { background: var(--accent-yellow); }
.finance-status-dot--confirmado { background: var(--accent-green); }
.finance-status-dot--conciliado { background: var(--accent-blue); }

/* FAB de adição rápida */
.finance-fab-wrapper {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.finance-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent-primary);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
  transition: transform var(--transition-fast);
}
.finance-fab:hover { transform: scale(1.06) rotate(45deg); }

.finance-fab-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finance-fab-option {
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}
.finance-fab-option:hover { transform: translateX(-4px); border-color: var(--accent-green); }
.finance-fab-option--expense:hover { border-color: var(--accent-red); }

/* Calculadora flutuante */
.finance-calculator {
  position: fixed;
  bottom: 100px;
  right: 32px;
  z-index: 1600;
  width: 260px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: width var(--transition-fast);
}

.finance-calculator--with-history {
  width: 460px;
}

.finance-calculator__body {
  display: flex;
}

.finance-calculator__main {
  width: 260px;
  flex-shrink: 0;
}

.finance-calculator__history {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
  max-height: 420px;
  overflow-y: auto;
}

.finance-calculator__history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}

.finance-calculator__history-group {
  padding: 8px 14px 4px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.finance-calculator__history-item {
  padding: 6px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
}
.finance-calculator__history-item:hover { background: rgba(15, 23, 42, 0.04); }

.finance-calculator__history-expr {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.finance-calculator__history-result {
  font-size: 0.9rem;
  font-weight: 700;
}

.finance-calculator__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-weight: 800;
  border-bottom: 1px solid var(--glass-border);
}

.finance-calculator__display {
  padding: 16px;
  text-align: right;
  font-size: 1.8rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.04);
  overflow-x: auto;
  white-space: nowrap;
}

.finance-calculator__pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px;
}

.finance-calculator__pad button {
  padding: 12px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.03);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}
.finance-calculator__pad button:hover { background: rgba(15, 23, 42, 0.08); }
.finance-calculator__equals { background: var(--accent-primary) !important; color: #fff !important; border-color: transparent !important; }

/* ════════════════════════════════
   GENERIC FORM / BUTTON COMPONENTS (Configurações, Alertas)
   ════════════════════════════════ */
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 10px 0 4px;
}

.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.input-field:disabled {
  background: rgba(15, 23, 42, 0.03);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  padding: 9px 18px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Toggle switch (pill) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch__slider {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.15);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle-switch__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
}

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

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

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pill--ok { background: rgba(16, 185, 129, 0.12); color: #059669; }
.status-pill--error { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }
.status-pill--muted { background: rgba(15, 23, 42, 0.06); color: var(--text-muted); }

/* Alert channel cards (Configurações > Módulo de Alertas) */
.alert-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.alert-channel-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.alert-channel-card--placeholder {
  opacity: 0.75;
}

.alert-channel-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.alert-channel-card__title {
  font-weight: 800;
  font-size: 0.95rem;
}

.alert-channel-card__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.alert-channel-card__actions {
  display: flex;
  gap: 10px;
  margin-top: var(--space-md);
}

.alert-channel-card__result {
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.03);
}

.alert-channel-card__result--ok { color: #059669; background: rgba(16, 185, 129, 0.08); }
.alert-channel-card__result--error { color: var(--accent-red); background: rgba(239, 68, 68, 0.08); }

.status-pill--warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }

/* ════════════════════════════════
   SIDEBAR — GRUPOS EXPANSÍVEIS (Ações / Configurações)
   ════════════════════════════════ */
.sidebar__group-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: rgba(244, 245, 247, 0.65);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sidebar__group-header:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
}

.sidebar__group-header.sidebar__link--active {
  background: var(--accent-primary);
  color: #1a1200;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.sidebar__group-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.sidebar__group--expanded .sidebar__group-chevron {
  transform: rotate(180deg);
}

.sidebar__sublist {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 4px 14px;
}

.sidebar__group--expanded .sidebar__sublist {
  display: flex;
}

.sidebar__sublink {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: rgba(244, 245, 247, 0.55);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sidebar__sublink:hover {
  color: var(--text-on-dark);
  border-left-color: rgba(255, 255, 255, 0.3);
}

.sidebar__sublink--active {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.08);
}

body.sidebar-collapsed .sidebar__group-chevron,
body.sidebar-collapsed .sidebar__sublist {
  display: none;
}

body.sidebar-collapsed .sidebar__group-header {
  justify-content: center;
  padding: 12px;
}

/* ════════════════════════════════
   CONEXÕES (WhatsApp)
   ════════════════════════════════ */
.connections-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.connections-server-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-card);
  flex: 1 1 320px;
}

.connections-server-icon { font-size: 1.6rem; }

.connections-server-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connections-server-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.connections-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.connection-card__id {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: monospace;
}

.connection-card__row {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

