/* ---------------------- BASE REPROSENSE ---------------------- */

:root {
  --accent-primary: #0f4c8a;
  --accent-secondary: #1f7fba;
  --accent-cyan: #3fb8e8;
  --accent-cyan-soft: #79dcff;

  --accent-gradient: linear-gradient(135deg, #0a2e57 0%, #114d8b 38%, #1f7fba 70%, #49c6f1 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(10, 46, 87, 0.9), rgba(17, 77, 139, 0.82), rgba(73, 198, 241, 0.72));

  --bg-main: #06111f;
  --bg-secondary: #0b1728;
  --bg-glass: rgba(10, 22, 38, 0.78);
  --bg-glass-strong: rgba(7, 17, 30, 0.92);
  --bg-hover: rgba(63, 184, 232, 0.12);

  --text-main: #e9f4ff;
  --text-soft: #9bb7d3;
  --text-muted: #6e8aa6;

  --border-soft: rgba(96, 178, 255, 0.16);
  --border-strong: rgba(96, 178, 255, 0.32);

  --success-dot: #1dd1a1;
  --warning-main: #ffc107;

  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.36);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

a,
button,
.btn,
.nav-link,
.dropdown-item,
.form-control,
.card,
.table,
.alert,
.badge {
  transition:
    background-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 127, 186, 0.12) 0%, transparent 28%),
    radial-gradient(circle at 85% 82%, rgba(73, 198, 241, 0.10) 0%, transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(10, 46, 87, 0.18) 0%, transparent 32%),
    linear-gradient(135deg, var(--bg-main) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow-x: hidden;
  color: var(--text-main);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}

/* Background tecnológico */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
  -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% -10%, rgba(73, 198, 241, 0.08), transparent 42%);
  pointer-events: none;
  z-index: 0;
  animation: pulseAmbient 8s ease-in-out infinite;
}

main {
  position: relative;
  z-index: 1;
}

/* Container principal */
main.container {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem;
  margin-top: 1.4rem;
  margin-bottom: 2rem;
  animation: fadeInUp 0.55s ease;
}

/* largura maior */
@media (min-width: 1400px) {
  main.container.container-wider {
    max-width: 1770px;
  }
}

/* ---------------------- NAVBAR ---------------------- */

.navbar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(6, 17, 31, 0.82) !important;
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid rgba(121, 220, 255, 0.10);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(121,220,255,.55), transparent);
}

.brand {
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
  position: relative;
  padding: 0.5rem 0;
}

.brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
}

.brand:hover::after {
  width: 100%;
}

/* Nav links */
.nav-link,
.dropdown-item {
  position: relative;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: var(--text-soft) !important;
}

.nav-link:hover,
.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-main) !important;
  transform: translateY(-2px);
}

.nav-link.active,
.dropdown-item.active {
  background: linear-gradient(135deg, rgba(15, 76, 138, 0.40), rgba(63, 184, 232, 0.18));
  color: #ffffff !important;
  font-weight: 600;
  box-shadow:
    inset 0 0 0 1px rgba(121, 220, 255, 0.12),
    0 0 16px rgba(63, 184, 232, 0.12);
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  width: 72%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-gradient);
  background-size: 220% 100%;
  opacity: 0;
  box-shadow: 0 0 10px rgba(63, 184, 232, 0.35);
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    box-shadow 0.22s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
  animation: navUnderlineFlow 1.8s linear infinite;
}

@keyframes navUnderlineFlow {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 0 8px rgba(63, 184, 232, 0.25);
  }

  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 16px rgba(121, 220, 255, 0.55);
  }

  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 8px rgba(63, 184, 232, 0.25);
  }
}

/* Dropdown */
.dropdown-menu {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 22, 38, 0.95) !important;
  border: 1px solid rgba(121, 220, 255, 0.10);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  animation: dropdownSlide 0.24s ease;
}

.dropdown-item {
  margin: 0.2rem 0;
  border-radius: 10px;
}

.dropdown-item i {
  transition: transform 0.3s ease;
}

.dropdown-item:hover i {
  transform: scale(1.15) rotate(4deg);
}

.dropdown-divider {
  border-color: rgba(255, 255, 255, 0.08);
  margin: 0.75rem 0;
}

/* Área restrita */
.text-warning-emphasis {
  color: var(--warning-main) !important;
  font-weight: 700;
}

.text-warning-emphasis i {
  animation: pulse 2s infinite;
}

/* ---------------------- USER / CHIPS ---------------------- */

.user-info {
  padding: 0.55rem 1rem;
  background: rgba(63, 184, 232, 0.08);
  border-radius: 999px;
  border: 1px solid rgba(63, 184, 232, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.user-greeting {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-greeting::before {
  content: '👋';
  animation: wave 1.5s infinite;
  transform-origin: 70% 70%;
  display: inline-block;
}

.chip {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  border-radius: 999px;
  padding: 0.52rem 0.9rem;
  border: 1px solid rgba(121, 220, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.chip strong {
  color: var(--text-main);
}

.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-dot);
  box-shadow:
    0 0 10px var(--success-dot),
    0 0 0 4px rgba(29, 209, 161, 0.08);
  animation: pulseDot 2s ease-in-out infinite;
}

/* Badge empresa antigo */
.empresa-badge {
  background: var(--accent-gradient);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  animation: slideInRight 0.5s ease;
  color: #fff;
}

/* ---------------------- BOTÕES ---------------------- */

.btn {
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  font-size: 0.84rem;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-outline-secondary,
.btn-outline-light,
.btn-outline-primary,
.btn-outline-danger {
  border-width: 1px;
  border-color: rgba(121, 220, 255, 0.18);
  color: var(--text-main);
  background: rgba(255,255,255,0.02);
}

.btn-outline-secondary:hover,
.btn-outline-light:hover,
.btn-outline-primary:hover,
.btn-outline-danger:hover {
  background: rgba(63, 184, 232, 0.08);
  border-color: rgba(121, 220, 255, 0.32);
}

/* Ripple manual */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0.5;
  background: currentColor;
  pointer-events: none;
  animation: ripple-anim 0.6s ease-out;
}

/* ---------------------- TOGGLER ---------------------- */

.navbar-toggler {
  border: 1px solid rgba(121, 220, 255, 0.22);
  border-radius: 12px;
  padding: 0.5rem;
  background: rgba(255,255,255,0.03);
}

.navbar-toggler:hover {
  background: rgba(63, 184, 232, 0.10);
  border-color: rgba(63, 184, 232, 0.35);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(63, 184, 232, 0.18);
}

/* ---------------------- ALERTAS ---------------------- */

.alert {
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
}

.alert.alert-success {
  color: #ffffff !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
  border: 0;
}

.alert.alert-success a,
.alert.alert-success strong {
  color: #ffffff !important;
  text-decoration: underline;
}

/* ---------------------- PARTÍCULAS DOS HEADERS ---------------------- */

.form-header,
.page-header,
#aboutContainer {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(8, 21, 36, 0.86), rgba(10, 28, 47, 0.80));
  border: 1px solid rgba(121,220,255,.10);
  box-shadow: var(--shadow-md);
}

.header-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.form-header > *:not(.header-particles),
.page-header > *:not(.header-particles),
#aboutContainer > *:not(.header-particles) {
  position: relative;
  z-index: 1;
}

.no-particles .header-particles {
  display: none !important;
}

.sperm-layer {
  position: absolute;
  inset: 0;
}

.sperm-layer canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------------- CALCULADORA ---------------------- */

.calc-panel {
  position: fixed;
  right: 22px;
  top: 90px;
  width: 340px;
  border-radius: 22px;
  border: 1px solid rgba(121, 220, 255, 0.18);
  background: linear-gradient(180deg, rgba(8, 20, 35, 0.96), rgba(9, 24, 41, 0.92));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(63, 184, 232, 0.10);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
  transform: translateY(18px) scale(.96);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 3000;
}

.calc-panel.calc-opening,
.calc-panel.calc-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.calc-panel.calc-leaving {
  opacity: 0;
  transform: translateY(12px) scale(.96);
}

.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .95rem 1rem;
  background: linear-gradient(135deg, rgba(13, 52, 92, 0.95), rgba(29, 119, 173, 0.78));
  color: #eefbff;
  font-weight: 800;
  cursor: move;
  user-select: none;
  border-bottom: 1px solid rgba(121,220,255,.15);
}

.calc-body {
  padding: 1rem;
  transition: height .22s ease, opacity .22s ease;
}

.calc-panel.minimized .calc-body {
  display: none;
}

#calcDisplay {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: .02em;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(2, 11, 20, 0.82), rgba(7, 21, 36, 0.94));
  color: #e9fbff;
  border: 1px solid rgba(121,220,255,.16);
}

/* ---------------------- LOADER ---------------------- */

#page-loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(8, 26, 44, 0.55), rgba(3, 10, 18, 0.9));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .3s ease, visibility .3s ease;
  opacity: 1;
  visibility: visible;
  z-index: 5000;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pl-inner {
  min-width: 180px;
  padding: 1.4rem 1.5rem;
  text-align: center;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(8, 20, 35, 0.92), rgba(10, 26, 44, 0.88));
  border: 1px solid rgba(121,220,255,.16);
  box-shadow:
    0 20px 60px rgba(0,0,0,.34),
    0 0 24px rgba(63,184,232,.08);
}

.pl-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto .9rem;
  border-radius: 50%;
  border: 3px solid rgba(121,220,255,.12);
  border-top-color: var(--accent-cyan-soft);
  border-right-color: var(--accent-secondary);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 24px rgba(63,184,232,.18);
}

.pl-text {
  margin: 0;
  color: var(--text-soft);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------------------- LIGHT THEME ---------------------- */

:root[data-bs-theme="light"] {
  --accent-primary: #0f4c8a;
  --accent-secondary: #1f7fba;
  --accent-cyan: #1ca8e1;
  --accent-cyan-soft: #56c9f0;

  --accent-gradient: linear-gradient(135deg, #0f4c8a 0%, #1f7fba 58%, #56c9f0 100%);

  --bg-main: #edf6ff;
  --bg-secondary: #dfeefb;
  --bg-glass: rgba(255,255,255,0.82);
  --bg-glass-strong: rgba(255,255,255,0.95);
  --bg-hover: rgba(13, 110, 253, 0.08);

  --text-main: #09213a;
  --text-soft: #35526e;
  --text-muted: #5f7891;

  --border-soft: rgba(17, 76, 138, 0.12);
  --border-strong: rgba(17, 76, 138, 0.22);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
}

:root[data-bs-theme="light"] body {
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 127, 186, 0.10) 0%, transparent 28%),
    radial-gradient(circle at 85% 82%, rgba(73, 198, 241, 0.08) 0%, transparent 24%),
    linear-gradient(135deg, #f7f9fc 0%, #e9eef9 100%);
  color: var(--text-main);
}

:root[data-bs-theme="light"] body::before {
  background:
    linear-gradient(rgba(9,33,58,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(9,33,58,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}

:root[data-bs-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.82) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

:root[data-bs-theme="light"] .dropdown-menu {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(0,0,0,0.08);
}

:root[data-bs-theme="light"] .nav-link,
:root[data-bs-theme="light"] .dropdown-item {
  color: #1b2130 !important;
}

:root[data-bs-theme="light"] .nav-link:hover,
:root[data-bs-theme="light"] .dropdown-item:hover {
  background: rgba(13, 110, 253, 0.08);
}

:root[data-bs-theme="light"] .user-info {
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.22);
}

:root[data-bs-theme="light"] .chip {
  border: 1px solid rgba(13,110,253,0.18);
  background: rgba(13,110,253,0.06);
  color: #0b1733;
}

:root[data-bs-theme="light"] .chip strong {
  color: #0b1733;
}

:root[data-bs-theme="light"] main.container {
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(0,0,0,0.08);
}

:root[data-bs-theme="light"] .navbar-toggler {
  border: 1px solid rgba(0,0,0,0.20);
}

:root[data-bs-theme="light"] .navbar-toggler:hover {
  background: rgba(13,110,253,0.10);
  border-color: rgba(13,110,253,0.35);
}

:root[data-bs-theme="light"] .alert.alert-success {
  color: #0f5132 !important;
  text-shadow: none;
}

:root[data-bs-theme="light"] .alert.alert-success a,
:root[data-bs-theme="light"] .alert.alert-success strong {
  color: #0f5132 !important;
}

/* ---------------------- RESPONSIVO ---------------------- */

@media (max-width: 991px) {
  .navbar-collapse {
    background: rgba(10, 22, 38, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .d-flex.align-items-center {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  .calc-panel {
    width: min(92vw, 340px);
    right: 4vw;
    top: 84px;
  }

  :root[data-bs-theme="light"] .navbar-collapse {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(0,0,0,0.08);
  }

  :root[data-bs-theme="light"] .d-flex.align-items-center {
    border-top: 1px solid rgba(0,0,0,0.08);
  }
}

/* ---------------------- ANIMAÇÕES ---------------------- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

@keyframes ripple-anim {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

@keyframes pulseAmbient {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 10px var(--success-dot),
      0 0 0 4px rgba(29, 209, 161, 0.08);
  }
  50% {
    transform: scale(1.12);
    box-shadow:
      0 0 16px var(--success-dot),
      0 0 0 7px rgba(29, 209, 161, 0.05);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes noteIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes noteOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(.92);
  }
}

@keyframes miniPulse {
  0% { transform: scale(.95); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ---------------------- CHIP DO PLANO + POPOVER ---------------------- */

.chip-plan {
  --plan-color: var(--accent-secondary);
  --plan-bg: rgba(255, 255, 255, 0.04);
  --plan-border: rgba(121, 220, 255, 0.14);

  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .58rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--plan-border);
  background: var(--plan-bg);
  color: var(--text-soft);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.04);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  font: inherit;
}

.chip-plan strong {
  color: var(--text-main);
  font-weight: 700;
}

.chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.chip-icon-brain {
  position: relative;
  color: var(--plan-color);
  transform-origin: center;
}

.chip-icon-brain svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
  transform-origin: center;
}

/* Compatível caso o HTML do cérebro esteja em camadas */
.chip-icon-brain .brain-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-icon-brain .brain-layer svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

/* ESSENCIAL */
.chip-plan-essencial {
  --plan-color: var(--accent-primary);
  --plan-border: rgba(15, 76, 138, 0.22);
  --plan-bg: rgba(15, 76, 138, 0.10);
}

/* PROFISSIONAL */
.chip-plan-profissional {
  --plan-color: var(--accent-secondary);
  --plan-border: rgba(31, 127, 186, 0.24);
  --plan-bg: rgba(31, 127, 186, 0.12);
}

/* PERFORMANCE */
.chip-plan-performance {
  --plan-color: var(--accent-cyan);
  --plan-border: rgba(63, 184, 232, 0.28);
  --plan-bg: rgba(63, 184, 232, 0.12);
}

/* ULTRA REPRO */
.chip-plan-ultra_repro {
  --plan-color: #b476ff;
  --plan-border: rgba(177, 118, 255, 0.30);
  --plan-bg: linear-gradient(
    135deg,
    rgba(155, 92, 255, 0.14),
    rgba(83, 196, 255, 0.10)
  );
}

/* Glitch + brilho somente no plano Ultra Repro */
.chip-plan-ultra_repro .chip-icon-brain {
  color: #d9c0ff;
  filter:
    drop-shadow(0 0 4px rgba(163, 96, 255, 0.72))
    drop-shadow(0 0 10px rgba(93, 207, 255, 0.34));
  animation: chipBrainGlitchFive 5s infinite;
  will-change: transform, opacity, filter;
}

/* Segunda batida do glitch em 7s */
.chip-plan-ultra_repro .chip-icon-brain > svg,
.chip-plan-ultra_repro .chip-icon-brain .brain-layer-base {
  animation: chipBrainGlitchSeven 7s infinite;
  will-change: transform, opacity, filter;
}

/* Camadas coloridas opcionais, caso você tenha usado o HTML em 3 camadas */
.chip-plan-ultra_repro .chip-icon-brain .brain-layer-glitch {
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform, opacity, clip-path;
}

.chip-plan-ultra_repro .chip-icon-brain .brain-layer-glitch-a {
  color: #ff6adf;
  filter: drop-shadow(0 0 6px rgba(255, 106, 223, 0.50));
  animation: chipBrainColorGlitchFive 5s infinite;
}

.chip-plan-ultra_repro .chip-icon-brain .brain-layer-glitch-b {
  color: #56e6ff;
  filter: drop-shadow(0 0 6px rgba(86, 230, 255, 0.50));
  animation: chipBrainColorGlitchSeven 7s infinite;
}

/* Glitch 5s — mexe o wrapper do cérebro */
@keyframes chipBrainGlitchFive {
  0%, 9.8%, 12.2%, 20%, 100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter:
      drop-shadow(0 0 4px rgba(163, 96, 255, 0.72))
      drop-shadow(0 0 10px rgba(93, 207, 255, 0.34));
  }

  10.2% {
    opacity: 0.35;
    transform: translate(-3px, 0) scale(1);
    filter:
      drop-shadow(-3px 0 4px rgba(255, 106, 223, 0.75))
      drop-shadow(3px 0 4px rgba(86, 230, 255, 0.65));
  }

  10.7% {
    opacity: 1;
    transform: translate(3px, 0) scale(1.03);
    filter:
      drop-shadow(3px 0 4px rgba(86, 230, 255, 0.75))
      drop-shadow(-3px 0 4px rgba(255, 106, 223, 0.65));
  }

  11.2% {
    opacity: 0.22;
    transform: translate(-2px, 1px) scale(1);
    filter:
      drop-shadow(-2px 0 4px rgba(255, 106, 223, 0.55))
      drop-shadow(2px 0 4px rgba(86, 230, 255, 0.45));
  }

  11.7% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter:
      drop-shadow(0 0 4px rgba(163, 96, 255, 0.72))
      drop-shadow(0 0 10px rgba(93, 207, 255, 0.34));
  }

  20.5% {
    opacity: 0.42;
    transform: translate(0, -2px) scale(1.02);
    filter:
      drop-shadow(0 -2px 4px rgba(255, 106, 223, 0.55))
      drop-shadow(0 2px 4px rgba(86, 230, 255, 0.45));
  }

  21% {
    opacity: 1;
    transform: translate(2px, 0) scale(1);
    filter:
      drop-shadow(2px 0 4px rgba(86, 230, 255, 0.65))
      drop-shadow(-2px 0 4px rgba(255, 106, 223, 0.55));
  }

  21.5% {
    opacity: 0.18;
    transform: translate(-2px, 0) scale(1);
    filter:
      drop-shadow(-2px 0 4px rgba(255, 106, 223, 0.55))
      drop-shadow(2px 0 4px rgba(86, 230, 255, 0.45));
  }

  22% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter:
      drop-shadow(0 0 4px rgba(163, 96, 255, 0.72))
      drop-shadow(0 0 10px rgba(93, 207, 255, 0.34));
  }
}

/* Glitch 7s — mexe o SVG interno em outro ritmo */
@keyframes chipBrainGlitchSeven {
  0%, 15.8%, 18.2%, 28%, 100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  16.3% {
    opacity: 0.40;
    transform: translate(2px, 0) scale(1);
  }

  16.8% {
    opacity: 1;
    transform: translate(-2px, 0) scale(1.04);
  }

  17.3% {
    opacity: 0.24;
    transform: translate(1px, -1px) scale(1);
  }

  17.8% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  28.5% {
    opacity: 0.35;
    transform: translate(-1px, -2px) scale(1.02);
  }

  29% {
    opacity: 1;
    transform: translate(2px, 1px) scale(1);
  }

  29.5% {
    opacity: 0.15;
    transform: translate(-2px, 0) scale(1);
  }

  30% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

/* Glitch colorido 5s — só funciona se o HTML tiver camada glitch-a */
@keyframes chipBrainColorGlitchFive {
  0%, 9.8%, 12.2%, 20%, 100% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }

  10.2% {
    opacity: 0.75;
    transform: translate(-3px, 0);
    clip-path: inset(0 0 68% 0);
  }

  10.7% {
    opacity: 0.65;
    transform: translate(3px, 0);
    clip-path: inset(36% 0 30% 0);
  }

  11.2% {
    opacity: 0.50;
    transform: translate(-2px, 1px);
    clip-path: inset(68% 0 0 0);
  }

  11.7% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }

  20.5% {
    opacity: 0.55;
    transform: translate(2px, -1px);
    clip-path: inset(12% 0 58% 0);
  }

  21% {
    opacity: 0.75;
    transform: translate(-3px, 1px);
    clip-path: inset(48% 0 22% 0);
  }

  21.5% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }
}

/* Glitch colorido 7s — só funciona se o HTML tiver camada glitch-b */
@keyframes chipBrainColorGlitchSeven {
  0%, 15.8%, 18.2%, 28%, 100% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }

  16.3% {
    opacity: 0.70;
    transform: translate(3px, 0);
    clip-path: inset(8% 0 62% 0);
  }

  16.8% {
    opacity: 0.58;
    transform: translate(-3px, 1px);
    clip-path: inset(42% 0 28% 0);
  }

  17.3% {
    opacity: 0.48;
    transform: translate(2px, -1px);
    clip-path: inset(74% 0 0 0);
  }

  17.8% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }

  28.5% {
    opacity: 0.55;
    transform: translate(-2px, -1px);
    clip-path: inset(16% 0 54% 0);
  }

  29% {
    opacity: 0.75;
    transform: translate(3px, 1px);
    clip-path: inset(54% 0 18% 0);
  }

  29.5% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }
}

.plan-chip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* DARK */
.plan-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 315px;
  max-width: min(315px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(121, 220, 255, 0.16);
  background: linear-gradient(180deg, rgba(7, 20, 34, 0.92), rgba(6, 18, 30, 0.94));
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  backdrop-filter: blur(22px) saturate(120%);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(66, 189, 231, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
  z-index: 120;
  overflow: hidden;
}

.plan-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 22px;
  width: 14px;
  height: 14px;
  border-left: 1px solid rgba(121, 220, 255, 0.16);
  border-top: 1px solid rgba(121, 220, 255, 0.16);
  background: rgba(7, 20, 34, 0.94);
  transform: rotate(45deg);
}

.plan-chip-wrap.is-open .plan-popover,
.plan-chip-wrap:hover .plan-popover,
.plan-chip-wrap:focus-within .plan-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.plan-popover__top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.plan-popover__name {
  color: var(--text-main);
  font-size: .94rem;
  line-height: 1.2;
  font-weight: 800;
}

.plan-popover__hint {
  color: var(--text-muted);
  font-size: .74rem;
}

.plan-popover__limits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.plan-popover__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.plan-popover__line:last-child {
  border-bottom: none;
}

.plan-popover__line span {
  color: var(--text-soft);
  font-size: .78rem;
}

.plan-popover__line strong {
  color: var(--text-main);
  font-size: .84rem;
  font-weight: 800;
  text-align: right;
}

.plan-popover__modules {
  padding-top: 10px;
  border-top: 1px solid rgba(121, 220, 255, 0.10);
}

.plan-popover__modules-title {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: .76rem;
  font-weight: 700;
}

.plan-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: .70rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
}

.plan-badge-ultra {
  color: #efe5ff;
  border-color: rgba(177, 118, 255, 0.24);
  background: linear-gradient(
    135deg,
    rgba(155, 92, 255, 0.16),
    rgba(83, 196, 255, 0.10)
  );
}

/* LIGHT — CORRETO PARA O SEU SISTEMA */
:root[data-bs-theme="light"] .chip-plan {
  color: var(--text-soft);
  box-shadow:
    0 8px 24px rgba(15, 52, 88, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.70);
}

:root[data-bs-theme="light"] .chip-plan strong {
  color: var(--text-main);
}

:root[data-bs-theme="light"] .chip-plan-essencial {
  --plan-border: rgba(15, 76, 138, 0.14);
  --plan-bg: rgba(15, 76, 138, 0.06);
}

:root[data-bs-theme="light"] .chip-plan-profissional {
  --plan-border: rgba(31, 127, 186, 0.16);
  --plan-bg: rgba(31, 127, 186, 0.07);
}

:root[data-bs-theme="light"] .chip-plan-performance {
  --plan-border: rgba(63, 184, 232, 0.18);
  --plan-bg: rgba(63, 184, 232, 0.08);
}

:root[data-bs-theme="light"] .chip-plan-ultra_repro {
  --plan-color: #7b4df1;
  --plan-border: rgba(126, 85, 232, 0.22);
  --plan-bg: linear-gradient(
    135deg,
    rgba(130, 80, 255, 0.10),
    rgba(39, 173, 241, 0.08)
  );
}

:root[data-bs-theme="light"] .chip-plan-ultra_repro .chip-icon-brain {
  color: #7b4df1;
  filter:
    drop-shadow(0 0 4px rgba(123, 77, 241, 0.30))
    drop-shadow(0 0 8px rgba(56, 186, 240, 0.18));
}

:root[data-bs-theme="light"] .chip-plan-ultra_repro .chip-icon-brain .brain-layer-glitch-a {
  color: #b13dff;
  filter: drop-shadow(0 0 5px rgba(177, 61, 255, 0.35));
}

:root[data-bs-theme="light"] .chip-plan-ultra_repro .chip-icon-brain .brain-layer-glitch-b {
  color: #1bbde8;
  filter: drop-shadow(0 0 5px rgba(27, 189, 232, 0.35));
}

:root[data-bs-theme="light"] .plan-popover {
  border: 1px solid rgba(17, 76, 138, 0.14);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(245, 250, 255, 0.98)
  );
  -webkit-backdrop-filter: blur(20px) saturate(115%);
  backdrop-filter: blur(20px) saturate(115%);
  box-shadow:
    0 18px 42px rgba(15, 52, 88, 0.14),
    0 0 20px rgba(63, 184, 232, 0.05),
    inset 0 1px 0 rgba(255,255,255,0.72);
}

:root[data-bs-theme="light"] .plan-popover::before {
  border-left: 1px solid rgba(17, 76, 138, 0.14);
  border-top: 1px solid rgba(17, 76, 138, 0.14);
  background: rgba(250, 253, 255, 0.98);
}

:root[data-bs-theme="light"] .plan-popover__name {
  color: var(--text-main);
}

:root[data-bs-theme="light"] .plan-popover__hint {
  color: var(--text-muted);
}

:root[data-bs-theme="light"] .plan-popover__line {
  border-bottom: 1px solid rgba(17, 76, 138, 0.08);
}

:root[data-bs-theme="light"] .plan-popover__line span {
  color: var(--text-soft);
}

:root[data-bs-theme="light"] .plan-popover__line strong {
  color: var(--text-main);
}

:root[data-bs-theme="light"] .plan-popover__modules {
  border-top: 1px solid rgba(17, 76, 138, 0.10);
}

:root[data-bs-theme="light"] .plan-badge {
  color: var(--text-main);
  background: rgba(17, 76, 138, 0.04);
  border-color: rgba(17, 76, 138, 0.08);
}

:root[data-bs-theme="light"] .plan-badge-ultra {
  color: #5f3fc2;
  border-color: rgba(126, 85, 232, 0.18);
  background: linear-gradient(
    135deg,
    rgba(130, 80, 255, 0.10),
    rgba(39, 173, 241, 0.08)
  );
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .plan-popover {
    right: auto;
    left: 0;
    width: min(315px, calc(100vw - 24px));
  }

  .plan-popover::before {
    left: 22px;
    right: auto;
  }
}

.util-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
}

.util-item-left,
.util-item-right {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.util-link-locked {
  opacity: .82;
  cursor: not-allowed;
  user-select: none;
}

.util-link-locked:hover {
  transform: none !important;
  background: rgba(255,255,255,0.04);
}

.util-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--accent-cyan-soft);
  background: rgba(63, 184, 232, 0.10);
  border: 1px solid rgba(63, 184, 232, 0.20);
  white-space: nowrap;
}

.util-lock {
  font-size: .82rem;
  color: var(--text-muted);
}

:root[data-bs-theme="light"] .util-link-locked:hover {
  background: rgba(13,110,253,0.05);
}

:root[data-bs-theme="light"] .util-plan-badge {
  color: var(--accent-primary);
  background: rgba(13,110,253,0.08);
  border-color: rgba(13,110,253,0.14);
}

.floating-messages {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 1300px);
  z-index: 2000;
  pointer-events: none;
}

.floating-alert {
  pointer-events: auto;
  margin: 0 0 12px 0;
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.alert-warning.floating-alert {
  background: rgba(255, 243, 205, 0.88);
  border: 1px solid rgba(255, 193, 7, 0.22);
  color: #8a6d00;
}

.alert-danger.floating-alert,
.alert-error.floating-alert {
  background: rgba(248, 215, 218, 0.90);
  border: 1px solid rgba(220, 53, 69, 0.18);
  color: #842029;
}

.alert-success.floating-alert {
  background: rgba(209, 231, 221, 0.90);
  border: 1px solid rgba(25, 135, 84, 0.18);
  color: #0f5132;
}

.alert-info.floating-alert {
  background: rgba(207, 244, 252, 0.90);
  border: 1px solid rgba(13, 202, 240, 0.18);
  color: #055160;
}

:root[data-bs-theme="dark"] .alert-warning.floating-alert {
  background: rgba(84, 68, 18, 0.86);
  border: 1px solid rgba(255, 193, 7, 0.20);
  color: #ffe08a;
}

:root[data-bs-theme="dark"] .alert-danger.floating-alert,
:root[data-bs-theme="dark"] .alert-error.floating-alert {
  background: rgba(77, 23, 29, 0.88);
  border: 1px solid rgba(220, 53, 69, 0.20);
  color: #ffd4da;
}

:root[data-bs-theme="dark"] .alert-success.floating-alert {
  background: rgba(17, 58, 41, 0.88);
  border: 1px solid rgba(25, 135, 84, 0.20);
  color: #bff0d5;
}

:root[data-bs-theme="dark"] .alert-info.floating-alert {
  background: rgba(10, 58, 68, 0.88);
  border: 1px solid rgba(13, 202, 240, 0.18);
  color: #bfefff;
}

@media (max-width: 991px) {
  .floating-messages {
    top: 72px;
    width: min(94vw, 900px);
  }

  .floating-alert {
    border-radius: 16px;
  }
}

.chip-plan-alert-ok .plan-chip-subtitle {
  color: #7dffd7;
}

.chip-plan-alert-atencao {
  border-color: rgba(255, 193, 7, 0.35);
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.12),
    rgba(255, 152, 0, 0.10)
  );
  box-shadow:
    0 8px 24px rgba(255, 152, 0, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.chip-plan-alert-atencao .plan-chip-subtitle {
  color: #ffd666;
}

.chip-plan-alert-critico,
.chip-plan-alert-expirado {
  border-color: rgba(255, 82, 82, 0.42);
  background: linear-gradient(
    135deg,
    rgba(255, 82, 82, 0.15),
    rgba(255, 0, 85, 0.11)
  );
  box-shadow:
    0 10px 26px rgba(255, 82, 82, 0.14),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.chip-plan-alert-critico .plan-chip-subtitle,
.chip-plan-alert-expirado .plan-chip-subtitle {
  color: #ff9a9a;
}

.chip-plan-alert-critico {
  animation: planChipPulse 1.8s ease-in-out infinite;
}

.chip-plan-alert-expirado {
  animation: planChipPulseStrong 1.2s ease-in-out infinite;
}

.plan-remaining-text-ok {
  color: #7dffd7;
}

.plan-remaining-text-atencao {
  color: #ffd666;
}

.plan-remaining-text-critico,
.plan-remaining-text-expirado {
  color: #ff8f8f;
}

@keyframes planChipPulse {
  0%, 100% {
    box-shadow:
      0 10px 24px rgba(255, 82, 82, 0.10),
      inset 0 1px 0 rgba(255,255,255,0.04);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(255, 82, 82, 0.08),
      0 14px 32px rgba(255, 82, 82, 0.18),
      inset 0 1px 0 rgba(255,255,255,0.05);
  }
}

@keyframes planChipPulseStrong {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(255, 82, 82, 0.00),
      0 14px 32px rgba(255, 82, 82, 0.18),
      inset 0 1px 0 rgba(255,255,255,0.04);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(255, 82, 82, 0.10),
      0 18px 38px rgba(255, 82, 82, 0.24),
      inset 0 1px 0 rgba(255,255,255,0.05);
  }
}

.plan-chip-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.plan-chip-title {
  display: inline-block;
}

.plan-chip-subtitle {
  margin-top: 2px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .01em;
  opacity: .9;
}

:root[data-bs-theme="light"] .chip-plan-alert-atencao {
  border-color: rgba(255, 179, 0, 0.28);
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.12),
    rgba(255, 152, 0, 0.10)
  );
}

:root[data-bs-theme="light"] .chip-plan-alert-critico,
:root[data-bs-theme="light"] .chip-plan-alert-expirado {
  border-color: rgba(220, 53, 69, 0.26);
  background: linear-gradient(
    135deg,
    rgba(220, 53, 69, 0.10),
    rgba(255, 99, 132, 0.08)
  );
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .chip-plan-ultra_repro .chip-icon-brain,
  .chip-plan-ultra_repro .chip-icon-brain > svg,
  .chip-plan-ultra_repro .chip-icon-brain .brain-layer-base,
  .chip-plan-ultra_repro .chip-icon-brain .brain-layer-glitch-a,
  .chip-plan-ultra_repro .chip-icon-brain .brain-layer-glitch-b,
  .chip-plan-alert-critico,
  .chip-plan-alert-expirado {
    animation: none !important;
  }
}

.dropdown-support {
  align-items: flex-start;
  gap: .45rem;
  white-space: normal;
}

.dropdown-support .support-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
}

.dropdown-support .support-title {
  font-weight: 600;
}

.dropdown-support small {
  margin-top: .15rem;
  font-size: .72rem;
  color: var(--text-muted, #8fa3b8);
}

.user-dropdown-menu {
  min-width: 280px;
  padding: .55rem;
  border-radius: 16px;
}

.user-dropdown-company-li {
  padding: .15rem;
}

.user-dropdown-company {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem;
  border-radius: 14px;
  background:
    linear-gradient(
      135deg,
      rgba(66, 189, 231, .11),
      rgba(19, 57, 97, .08)
    );
  border: 1px solid rgba(121, 220, 255, .16);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, .14),
    inset 0 1px 0 rgba(255, 255, 255, .04);
}

.user-dropdown-company-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #79dcff;
  background: rgba(66, 189, 231, .12);
  border: 1px solid rgba(66, 189, 231, .2);
}

.user-dropdown-company-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-dropdown-company-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(213, 231, 245, .62));
}

.user-dropdown-company-name {
  margin-top: .18rem;
  font-size: .95rem;
  color: var(--text-main, #f4fbff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-company-plan {
  margin-top: .18rem;
  color: var(--text-soft, #d5e7f5);
}

/* LIGHT MODE */
:root.light .user-dropdown-company,
[data-bs-theme="light"] .user-dropdown-company,
body.light .user-dropdown-company {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, .96),
      rgba(225, 244, 252, .92)
    );
  border-color: rgba(19, 57, 97, .12);
  box-shadow:
    0 10px 24px rgba(7, 20, 34, .08),
    inset 0 1px 0 rgba(255, 255, 255, .78);
}

:root.light .user-dropdown-company-icon,
[data-bs-theme="light"] .user-dropdown-company-icon,
body.light .user-dropdown-company-icon {
  color: #1f7fba;
  background: rgba(31, 127, 186, .08);
  border-color: rgba(31, 127, 186, .16);
}

:root.light .user-dropdown-company-label,
[data-bs-theme="light"] .user-dropdown-company-label,
body.light .user-dropdown-company-label {
  color: rgba(7, 20, 34, .55);
}

:root.light .user-dropdown-company-name,
[data-bs-theme="light"] .user-dropdown-company-name,
body.light .user-dropdown-company-name {
  color: #071422;
}

:root.light .user-dropdown-company-plan,
[data-bs-theme="light"] .user-dropdown-company-plan,
body.light .user-dropdown-company-plan {
  color: rgba(7, 20, 34, .62);
}

/* =======================================================
   NAVBAR — SUBMENUS LATERAIS
   ======================================================= */

.dropdown-menu-cadastros {
  min-width: 280px;
  overflow: visible;
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.submenu-arrow {
  font-size: .75rem;
  opacity: .7;
  transition: transform .18s ease, opacity .18s ease;
}

.dropdown-submenu:hover > .dropdown-submenu-toggle .submenu-arrow,
.dropdown-submenu.show > .dropdown-submenu-toggle .submenu-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.dropdown-submenu-menu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-top: 0;
  margin-left: .35rem;
  min-width: 285px;
  display: none;
  overflow: visible;
}

.dropdown-submenu:hover > .dropdown-submenu-menu,
.dropdown-submenu.show > .dropdown-submenu-menu {
  display: block;
}

.dropdown-submenu-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: -.45rem;
  width: .45rem;
  height: 100%;
}

/* Ajuste para telas menores */
@media (max-width: 991.98px) {
  .dropdown-menu-cadastros {
    max-height: none;
    overflow: visible;
  }

  .dropdown-submenu-menu {
    position: static;
    display: none;
    margin: .25rem 0 .5rem 1rem;
    min-width: auto;
    box-shadow: none;
    border-left: 1px solid rgba(255, 255, 255, .12);
  }

  .dropdown-submenu.show > .dropdown-submenu-menu {
    display: block;
  }

  .dropdown-submenu:hover > .dropdown-submenu-menu {
    display: none;
  }

  .dropdown-submenu.show:hover > .dropdown-submenu-menu {
    display: block;
  }

  .submenu-arrow {
    transform: rotate(90deg);
  }
}

/* =======================================================
   DENSIDADE VISUAL — COMPACTA
   Ativo quando: <html data-density="compact">
   ======================================================= */

:root[data-density="compact"] main.container {
  padding: 1.15rem !important;
  margin-top: .85rem !important;
  margin-bottom: 1.2rem !important;
  border-radius: 18px !important;
}

:root[data-density="compact"] .form-header,
:root[data-density="compact"] .page-header {
  padding: 1.15rem 1.25rem !important;
  margin-bottom: 1rem !important;
  border-radius: 16px !important;
}

:root[data-density="compact"] .form-header h1,
:root[data-density="compact"] .page-header h1 {
  font-size: 1.55rem !important;
}

:root[data-density="compact"] .form-card .card-body,
:root[data-density="compact"] .forms-card .card-body {
  padding: 1.25rem !important;
}

:root[data-density="compact"] .card-footer {
  padding: 1rem 1.25rem !important;
}

:root[data-density="compact"] .row.g-3 {
  --bs-gutter-x: .85rem;
  --bs-gutter-y: .85rem;
}

:root[data-density="compact"] .form-label {
  font-size: .78rem !important;
  margin-bottom: .35rem !important;
}

:root[data-density="compact"] .form-control,
:root[data-density="compact"] .form-select {
  padding: .55rem .75rem !important;
  min-height: 38px;
  font-size: .88rem !important;
  border-radius: 10px !important;
}

:root[data-density="compact"] .has-icon .form-control,
:root[data-density="compact"] .has-icon .form-select {
  padding-left: 3rem !important;
}

:root[data-density="compact"] .has-icon .input-icon {
  left: 1rem;
}

:root[data-density="compact"] .form-text {
  font-size: .76rem !important;
  margin-top: .35rem !important;
}

:root[data-density="compact"] .section-divider {
  margin: 1.2rem 0 !important;
}

:root[data-density="compact"] .section-divider::after {
  padding: .35rem 1rem !important;
  font-size: .72rem !important;
}

:root[data-density="compact"] .btn {
  padding: .48rem 1rem !important;
  font-size: .76rem !important;
}

:root[data-density="compact"] .navbar .nav-link,
:root[data-density="compact"] .dropdown-item {
  padding: .55rem .75rem !important;
  font-size: .88rem !important;
}

:root[data-density="compact"] .user-info {
  padding: .38rem .75rem !important;
}

:root[data-density="compact"] .chip {
  padding: .42rem .7rem !important;
}

:root[data-density="compact"] .plan-chip-title,
:root[data-density="compact"] .plan-chip-subtitle {
  font-size: .78rem !important;
}

:root[data-density="compact"] .table thead th,
:root[data-density="compact"] .table tbody td,
:root[data-density="compact"] .users-card .table-soft thead th,
:root[data-density="compact"] .users-card .table-soft tbody td,
:root[data-density="compact"] .itens-table-container .table-soft thead th,
:root[data-density="compact"] .itens-table-container .table-soft tbody td {
  padding: .55rem .7rem !important;
  font-size: .78rem !important;
}

:root[data-density="compact"] .badge {
  padding: .35rem .65rem !important;
  font-size: .66rem !important;
}

:root[data-density="compact"] .pagination {
  padding: .55rem !important;
}

:root[data-density="compact"] .page-item .page-link {
  padding: .35rem .7rem !important;
  font-size: .82rem !important;
}

/* =======================================================
   TAMANHO DA FONTE — INTERFACE
   Ativo quando: <html data-font-size="...">
   ======================================================= */

:root[data-font-size="small"] {
  font-size: 14px;
}

:root[data-font-size="default"] {
  font-size: 16px;
}

:root[data-font-size="medium"] {
  font-size: 17px;
}

:root[data-font-size="large"] {
  font-size: 18px;
}

/* Ajustes finos para elementos que usam px/rem muito específicos */

:root[data-font-size="small"] .form-header h1,
:root[data-font-size="small"] .page-header h1 {
  font-size: 1.75rem !important;
}

:root[data-font-size="medium"] .form-header h1,
:root[data-font-size="medium"] .page-header h1 {
  font-size: 2.15rem !important;
}

:root[data-font-size="large"] .form-header h1,
:root[data-font-size="large"] .page-header h1 {
  font-size: 2.3rem !important;
}

:root[data-font-size="small"] .form-label,
:root[data-font-size="small"] .dropdown-item,
:root[data-font-size="small"] .nav-link,
:root[data-font-size="small"] .form-control,
:root[data-font-size="small"] .form-select,
:root[data-font-size="small"] .btn {
  font-size: .84rem !important;
}

:root[data-font-size="medium"] .form-label,
:root[data-font-size="medium"] .dropdown-item,
:root[data-font-size="medium"] .nav-link,
:root[data-font-size="medium"] .form-control,
:root[data-font-size="medium"] .form-select,
:root[data-font-size="medium"] .btn {
  font-size: .98rem !important;
}

:root[data-font-size="large"] .form-label,
:root[data-font-size="large"] .dropdown-item,
:root[data-font-size="large"] .nav-link,
:root[data-font-size="large"] .form-control,
:root[data-font-size="large"] .form-select,
:root[data-font-size="large"] .btn {
  font-size: 1.05rem !important;
}

:root[data-font-size="small"] .form-text {
  font-size: .76rem !important;
}

:root[data-font-size="medium"] .form-text {
  font-size: .9rem !important;
}

:root[data-font-size="large"] .form-text {
  font-size: .96rem !important;
}

:root[data-font-size="small"] .table thead th,
:root[data-font-size="small"] .table tbody td,
:root[data-font-size="small"] .users-card .table-soft thead th,
:root[data-font-size="small"] .users-card .table-soft tbody td {
  font-size: .76rem !important;
}

:root[data-font-size="medium"] .table thead th,
:root[data-font-size="medium"] .table tbody td,
:root[data-font-size="medium"] .users-card .table-soft thead th,
:root[data-font-size="medium"] .users-card .table-soft tbody td {
  font-size: .88rem !important;
}

:root[data-font-size="large"] .table thead th,
:root[data-font-size="large"] .table tbody td,
:root[data-font-size="large"] .users-card .table-soft thead th,
:root[data-font-size="large"] .users-card .table-soft tbody td {
  font-size: .96rem !important;
}

:root[data-font-size="small"] .badge {
  font-size: .68rem !important;
}

:root[data-font-size="medium"] .badge {
  font-size: .82rem !important;
}

:root[data-font-size="large"] .badge {
  font-size: .9rem !important;
}

.language-dropdown-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  cursor: default;
}

.language-dropdown-item:hover,
.language-dropdown-item:focus {
  background: transparent;
}

.language-dropdown-label {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-dropdown-link-color);
}

.language-dropdown-select {
  width: 100%;
  cursor: pointer;
}

.importacao-massa-info {
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.14);
  color: #dbeafe;
}

.importacao-massa-info i {
  color: #93c5fd;
}

[data-bs-theme="light"] .importacao-massa-info,
.theme-light .importacao-massa-info,
body.light .importacao-massa-info {
  border-color: rgba(29, 78, 216, 0.22);
  background: #eff6ff;
  color: #1e3a8a;
}

[data-bs-theme="light"] .importacao-massa-info i,
.theme-light .importacao-massa-info i,
body.light .importacao-massa-info i {
  color: #2563eb;
}