/* =============================
🌐 RESET + BASE
============================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

::selection {
  background: rgba(217, 0, 255, 0.25);
  color: inherit;
}

/* Scrollbar — fina e roxa */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

body {
  background-image: url("../../assets/img/diversos/background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Dark mode background - Original */
body.dark {
  background-image: url("../../assets/img/diversos/backgroundescuro.png");
}

/* =============================
🧱 LAYOUT GLOBAL
============================= */
.main {
  margin-left: 70px;
  padding: 70px 24px 24px 24px;
}

/* =============================
🧾 FORMULÁRIOS (OUTRAS SEÇÕES)
============================= */
.form-grid {
  display: grid;
  gap: 10px;
  max-width: 500px;
}

input,
select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);


}

input,
select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);

  /* 🔒 Remove controles de aumentar/diminuir dos inputs numéricos */
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* =============================
🔘 BOTÕES
============================= */
button {
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg,
      #8a00cc,
      #b300ff,
      #d966ff);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(179, 0, 255, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(179, 0, 255, 0.45);
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(179, 0, 255, 0.3);
  filter: brightness(0.95);
}

.btn-secondary {
  background: linear-gradient(135deg,
      #f2ccff,
      #d966ff);
  color: #6b0099;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(179, 0, 255, 0.18);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(179, 0, 255, 0.28);
  filter: brightness(1.05);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(179, 0, 255, 0.18);
  filter: brightness(0.97);
}

.btn-danger {
  background: linear-gradient(135deg,
      #ef4444,
      #dc2626);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.45);
  filter: brightness(1.05);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.3);
  filter: brightness(0.95);
}

.btn-primary,
.btn-secondary,
.btn-danger {
  letter-spacing: 0.02em;
}

.btn-ghost {
  background: transparent;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 6px 10px;
}

/* =============================
🔝 HEADER
============================= */
.home-header {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: fixed;
  top: 0;
  margin-left: 80px;
  width: calc(100% - 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  z-index: 100;
}

/* 🏷️ BASE TÍTULO */
.home-title {
  text-align: right;
  pointer-events: auto;
  margin-left: auto;
  margin-right: 20px;
}

/* 🏷️ TÍTULO (Card Premium) */
.home-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-elevated);
  padding: 10px 24px;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  border: 1.5px solid var(--border-soft);
  letter-spacing: 0.05em;

  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-transform: uppercase;
}

.header-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.1);
  margin-right: -2px;
}

.home-title:hover h2 {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
  filter: brightness(1.05);
}

/* Removido sistema antigo de subtítulo */
.home-title p {
  display: none !important;
}

/* Label de seção — apenas no mobile (ocultado no desktop) */
#mobile-section-label {
  display: none;
}

.home-img {
  display: none;
}

/* 🏠 SIDEBAR LOGO TOOLTIP */
.sidebar-logo-link {
  position: relative;
  display: block;
}

.sidebar-logo-link .custom-tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  margin-left: 14px;
  transform: translateY(-50%) translateX(-10px);
  background: var(--primary);
  color: #fff !important;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  pointer-events: none;
}

.sidebar-logo-link:hover .custom-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}





.btn-whatsapp {
  display: flex;
  align-items: center;
  gap: 8px;

  background: linear-gradient(135deg,
      #1ebc5a,
      #25d366,
      #5be39d);

  color: #ffffff;
  padding: 8px 14px;
  border-radius: 99px;

  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;

  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.45);

  animation: pulse 1.6s infinite;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-whatsapp:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.6);
  filter: brightness(1.08);
}

.btn-whatsapp:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.4);
  filter: brightness(0.95);
}

.btn-whatsapp img {
  width: 20px;
  height: 20px;
}

/* 👤 PERFIL HEADER */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-profile {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-elevated);
}

.header-profile:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: var(--shadow-primary-soft);
}

.header-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* =============================
   🔔 POPUP GLOBAL (ROXO)
   ============================= */

.popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);

  background: linear-gradient(135deg,
      var(--primary),
      #8a00cc);

  color: #fff;

  padding: 14px 26px;
  border-radius: 999px;

  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;

  box-shadow:
    0 12px 32px rgba(179, 0, 255, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);

  z-index: 9999;
}

/* Estado visível */
.popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Halo roxo suave */
.popup::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: radial-gradient(circle,
      rgba(179, 0, 255, 0.45),
      transparent 70%);
  filter: blur(8px);
  opacity: 0.8;
  z-index: -1;
}

/* Brilho interno sutil */
.popup::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0.25),
      transparent 60%);
  pointer-events: none;
}

#popup-confirm {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}

#popup-confirm.ativo {
  display: flex;
}

/* =============================
🪟 POPUP CONFIRM (TEMA CLARO)
============================= */

#popup-confirm {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);

  opacity: 0;
  pointer-events: none;
  /* transition: opacity 0.25s ease; REMOVIDO */
}

#popup-confirm.ativo {
  opacity: 1;
  pointer-events: all;
}

/* =============================
📦 CARD
============================= */

#popup-confirm .popup-card {
  width: 100%;
  max-width: 500px;
  padding: 26px 28px;

  background: #ffffff;
  border-radius: 18px;

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);

  /* transform: translateY(10px) scale(0.97); REMOVIDO PARA TIRAR ANIMAÇÃO */
  /* opacity: 0; REMOVIDO */
  /* transition: all 0.25s ease; REMOVIDO */

  color: #2b0a3d;
  font-family: "Inter", system-ui, sans-serif;
}


/* =============================
🧠 TÍTULO
============================= */

#popup-confirm .popup-card h3 {
  margin: 0 0 14px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2b0a3d;
  letter-spacing: 0.2px;
}

/* =============================
📄 MENSAGEM / CONTEÚDO
============================= */

#popup-confirm #popup-mensagem {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #5e4b6b;
}

/* Inputs dentro do popup — mesmo padrão da aba Adicionar */
#popup-confirm #popup-mensagem input,
#popup-confirm #popup-mensagem select,
#popup-confirm #popup-mensagem textarea {
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: var(--text-heading);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

#popup-confirm #popup-mensagem input:focus,
#popup-confirm #popup-mensagem select:focus,
#popup-confirm #popup-mensagem textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  background: var(--bg-elevated);
}

/* Campos dentro do form de edição — estrutura igual ao Adicionar */
#popup-confirm .popup-edit-form .campo {
  margin-bottom: 16px;
}

#popup-confirm .popup-edit-form .campo:last-child {
  margin-bottom: 0;
}

/* Linha 2 colunas (Descrição + Valor) */
#popup-confirm .edit-linha {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

#popup-confirm .edit-linha .campo {
  margin-bottom: 0;
}

/* Remove margin-top do input quando dentro de .campo (label já cria o gap) */
#popup-confirm .popup-edit-form .campo input,
#popup-confirm .popup-edit-form .campo select {
  margin-top: 0;
}

/* Labels no padrão Adicionar */
#popup-confirm .popup-edit-form .campo label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-left: 4px;
  margin-bottom: 8px;
}

/* =============================
🔘 AÇÕES
============================= */

#popup-confirm .popup-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Botão cancelar */
#popup-confirm .btn-secondary {
  background: #f1ecf6;
  color: #6a4c80;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#popup-confirm .btn-secondary:hover {
  background: #e8e0f1;
  color: #2b0a3d;
}

/* Botão confirmar */
#popup-confirm .btn-danger {
  background: linear-gradient(135deg, #8a00cc, #b300ff);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(138, 0, 204, 0.25);
  transition: all 0.2s ease;
}

#popup-confirm .btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(138, 0, 204, 0.35);
}


/* =============================
🌑 DARK MODE — POPUP
============================= */

body.dark #popup-confirm .popup-card {
  background: #1e1e1e;
  /* var(--bg-elevated) no dark */
  color: #f5f5f5;
  /* var(--text-heading) no dark */
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark #popup-confirm .popup-card h3 {
  color: #f5f5f5;
}

body.dark #popup-confirm #popup-mensagem {
  color: #cccccc;
}

/* Dark mode para inputs agora é tratado pelas CSS variables (--bg-soft, --primary, etc.) */

/* Botão Cancelar no Dark Mode */
body.dark #popup-confirm .btn-secondary {
  background: #333333;
  color: #e8e8e8;
}

body.dark #popup-confirm .btn-secondary:hover {
  background: #444444;
}


/* =============================
📄 SEÇÕES
============================= */
.secao {
  display: none;
  margin-top: 8px;
}

.secao.ativa {
  display: block;
}

h1 {
  margin-bottom: 6px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

/* =============================
📌 SIDEBAR — ESTRUTURAL
============================= */
/* 🔒 Impede arrastar imagens e selecionar texto na sidebar */
.sidebar,
.sidebar * {
  -webkit-user-drag: none;

  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 80px;
  height: 100vh;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  z-index: 5000;
  overflow: visible;
}

.sidebar-header {
  padding: 20px;

  display: flex;
  justify-content: center;
}

.sidebar-logo {
  max-width: 48px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 6px;

}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--bg);
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-item::after {
  content: "";
  position: absolute;
  bottom: 0px;
  left: 50%;

  width: 0;
  height: 3px;

  background: linear-gradient(90deg,
      #c933ff,
      #d966ff,
      #8a00cc);

  border-radius: 6px;
  transform: translateX(-50%);
  transition:
    width 0.35s ease,
    box-shadow 0.35s ease,
    opacity 0.2s ease;

  box-shadow: 0 0 0 rgba(179, 0, 255, 0);
  opacity: 0;
}

.sidebar-item.active::after {
  width: 42px;
  /* 🔥 ajuste se quiser maior */
  opacity: 1;
  box-shadow: 0 0 12px rgba(179, 0, 255, 0.6);
}

.sidebar-item img {
  width: 36px;
  height: 36px;
  transition: transform 0.3s ease, filter 0.2s ease;
}

.sidebar-item.active img {
  transform: scale(1.5);
  filter: drop-shadow(0 0 6px rgba(179, 0, 255, 0.6));
}


.sidebar-item span {
  position: absolute;
  left: 100%;
  margin-left: 14px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.sidebar-item:hover span {
  opacity: 1;
  transform: translateX(0);
}



.sidebar-item.active span {
  background: var(--primary);
}

.sidebar-logout {
  margin-top: auto;
  margin-bottom: 16px;
  transform: scale(1);

  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.25s ease;
}

.sidebar-logout img {
  width: 60px;
  height: 60px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logout:hover {
  background: rgba(255, 80, 80, 0);
}

.sidebar-logout:hover span {
  background: #e74c3c;
}

.sidebar-logout:hover img {
  transform: scale(1.08);
}

/* =============================
📂 SIDEBAR GROUPS + SUBMENUS
============================= */

.sidebar-group {
  position: relative;
  display: flex;
  justify-content: center;
}

.sidebar-submenu {
  position: absolute;
  left: 70px;
  /* Encosta na sidebar (que tem 80px mas itens são centralizados) - Ajuste Fino: 80px */
  left: 80px;
  top: 50%;
  transform: translateY(-50%) translateX(-10px);

  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 140px;
}

/* Seta indicativa (opcional, estilo popover) */
.sidebar-submenu::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent var(--bg-elevated) transparent transparent;
}

/* Mostrar submenu quando ativo */
.sidebar-group.active .sidebar-submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* Botões do submenu */
.sidebar-subitem {
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;

  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-subitem svg {
  opacity: 0.7;
  transition: transform 0.2s;
}

.sidebar-subitem:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.sidebar-subitem:hover svg {
  opacity: 1;
  transform: translateX(2px);
}

/* =========================
   LOADING GLOBAL (CENTRALIZADO)
   ========================= */

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(4px);
}

/* 🔥 centro REAL */
.loading-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background: var(--bg-elevated);
  padding: 28px 36px;
  border-radius: 18px;
  text-align: center;

  box-shadow: var(--shadow-primary-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* texto */
.loading-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-subtle);
}

/* spinner */
.loading-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

/* =============================
🔒 BLOQUEIO DE ASSINATURA (SUBSCRIPTION GUARD)
============================= */
body.subscription-locked .secao:not(#fatura) {
  display: none !important;
}

/* Ocultar visualmente itens da sidebar que não sejam da Fatura
   Mante-los no DOM para não quebrar scripts, mas invisíveis/inativos */
body.subscription-locked .sidebar-item:not([data-target="fatura"]):not([data-group="fatura-group"]):not(.sidebar-logout),
body.subscription-locked .sidebar-group:not(:has([data-group="fatura-group"]))>.sidebar-item:not([data-group="fatura-group"]) {
  opacity: 0.5 !important;
  pointer-events: none !important;
  /* 🔥 Permite hover */
  cursor: not-allowed !important;
  filter: grayscale(1) !important;
  position: relative;
}



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

/* Garantir que o grupo Fatura fique normal */
body.subscription-locked .sidebar-item[data-group="fatura-group"],
body.subscription-locked .sidebar-subitem[data-target="fatura"] {
  opacity: 1 !important;
  pointer-events: auto !important;
  filter: none !important;
  cursor: pointer !important;
}

/* =============================
🔒 MENSAGEM DE BLOQUEIO (Overlay)
============================= */
#subscription-lock-message {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* ⬇️ Centralizar - antes era flex-end */
  position: fixed;
  /* Garante que fique sobre tudo */
  inset: 0;
  /* Mobile: sem offset (sidebar vira bottom bar) */
  padding: 0;
  z-index: 9998;
  /* Abaixo do loader e popup */
  background: rgba(0, 0, 0, 0.6);
  /* Fundo escuro */
  backdrop-filter: blur(3px);
  /* animation: fadeIn 0.3s ease; REMOVIDO */
}

/* Desktop: compensar sidebar lateral de 80px */
@media (min-width: 900px) {
  #subscription-lock-message {
    padding-left: 80px;
  }
}

#subscription-lock-message .lock-content {
  background: linear-gradient(135deg, #fff5f5, #ffebee);
  /* Fundo avermelhado claro */
  border: 2px solid #ef9a9a;
  /* Borda vermelha suave */
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 90%;
  text-align: center;
  position: relative;

  /* Animação suave de entrada REMOVIDA */
  /* animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); */
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#subscription-lock-message .lock-icon-large {
  font-size: 42px;
  margin-bottom: 15px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#subscription-lock-message h2 {
  color: #c62828;
  /* Vermelho forte */
  margin-bottom: 8px;
  font-size: 1.6rem;
}

#subscription-lock-message p {
  color: #b71c1c;
  /* Texto vermelho escuro/vinho */
  font-weight: 500;
}

#subscription-lock-message .lock-subtext {
  font-size: 0.95em;
  opacity: 0.9;
  margin-top: 8px;
  margin-bottom: 20px;
  color: #c0392b;
}

/* Botão Vermelho para combinar */
#subscription-lock-message .btn-primary {
  background: linear-gradient(135deg, #ef5350, #d32f2f);
  box-shadow: 0 6px 15px rgba(211, 47, 47, 0.35);
  border: none;
}

#subscription-lock-message .btn-primary:hover {
  background: linear-gradient(135deg, #e57373, #ef5350);
  box-shadow: 0 8px 20px rgba(211, 47, 47, 0.45);
  transform: translateY(-2px);
}

.mt-4 {
  margin-top: 1.5rem;
}

/* REGRAS DE VISIBILIDADE */

/* 1. Mostrar mensagem apenas quando bloqueado */
body.subscription-locked #subscription-lock-message {
  display: flex;
}

/* 2. MAS ESCONDER se a Fatura estiver ativa (pois aí o usuário já foi redirecionado) */
/* Usando :has() para detectar se #fatura tem a classe .ativa */
body.subscription-locked:has(#fatura.ativa) #subscription-lock-message {
  display: none !important;
}

/* Fallback JS (se :has não funcionar em algum browser antigo,
   o JS do subscription-guard remove o bloqueio visual se necessário,
   mas o ideal é o CSS cuidar disso) */

/* 3. Desabilitar barra de pesquisa (desktop e mobile) e "Ver Perfil" quando bloqueado */
body.subscription-locked .header-search-container,
body.subscription-locked #mobile-search-btn,
body.subscription-locked #dropdown-ver-perfil {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

body.subscription-locked .header-search-container input,
body.subscription-locked #mobile-search-btn {
  pointer-events: none;
}

/* ============================================================
   🟣 LISTRA ROXA GLOBAL — TOPO DE TODOS OS CARDS DO LAYOUT
   Aplica o gradiente primário no topo de cada card principal.
   ============================================================ */

/* Garante position:relative + overflow:hidden nos que ainda não têm */
.metrica-card,
.cartao-imagem,
.salario-editor,
.chart-card,
.tp-resumo-card,
.tp-entrada-card,
.dg-metric-card,
.dg-grupo-card,
.dg-onde-card,
.meta-card,
.meta-central-card,
.card-resumo-meta,
.card-resumo,
.metric-card,
.happiness-card {
  position: relative;
  overflow: hidden;
}

/* Stripe roxa no topo */
.metrica-card::before,
.cartao-imagem::before,
.salario-editor::before,
.chart-card::before,
.tp-resumo-card::before,
.tp-entrada-card::before,
.dg-metric-card::before,
.dg-grupo-card::before,
.dg-onde-card::before,
.meta-card::before,
.meta-central-card::before,
.card-resumo-meta::before,
.card-resumo::before,
.metric-card::before,
.happiness-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 1;
  pointer-events: none;
}