/* PierView · Sidebar de perfil (tema claro, compartilhada) */
.profile-sidebar-overlay {
  --ps-bg: #ffffff;
  --ps-surface: #f4f7fb;
  --ps-hover: #eef2f7;
  --ps-border: #d3dce8;
  --ps-border-strong: #b8c4d3;
  --ps-text: #0b1220;
  --ps-text-dim: #3b4a5f;
  --ps-text-faint: #5b6b80;
  --ps-primary: #2563eb;
  --ps-success: #059669;
  --ps-danger: #dc2626;
  --ps-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  position: fixed; inset: 0; z-index: 90;
  display: flex; justify-content: flex-end;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-family: var(--ps-font);
}
.profile-sidebar-overlay.aberto { opacity: 1; visibility: visible; }

.profile-sidebar {
  width: 100%; max-width: 380px;
  height: 100%; height: 100dvh;
  background: var(--ps-bg);
  border-left: 1px solid var(--ps-border);
  box-shadow: -20px 0 50px -20px rgba(15, 23, 42, 0.35);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: var(--ps-text);
}
.profile-sidebar-overlay.aberto .profile-sidebar { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .profile-sidebar-overlay, .profile-sidebar { transition: none; }
}
.profile-sidebar a:focus-visible,
.profile-sidebar button:focus-visible {
  outline: 2px solid var(--ps-primary); outline-offset: 2px; border-radius: 6px;
}

/* Topo */
.profile-sidebar-topo {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; background: var(--ps-bg);
  border-bottom: 1px solid var(--ps-border);
}
.profile-sidebar-topo .rotulo {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ps-text-faint);
}
.profile-sidebar-fechar {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ps-bg); border: 1px solid var(--ps-border-strong);
  color: var(--ps-text-dim);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.profile-sidebar-fechar:hover { background: var(--ps-hover); color: var(--ps-text); }

/* Corpo */
.profile-sidebar-corpo { padding: 26px 22px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.profile-sidebar-identidade { text-align: center; }
.profile-sidebar-avatar {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 12px;
  background: #eff6ff; border: 1px solid #bfdbfe;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.profile-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-sidebar-avatar .fallback { font-weight: 700; font-size: 26px; color: var(--ps-primary); }
.profile-sidebar-nome { font-weight: 700; font-size: 17px; color: var(--ps-text); margin: 0 0 2px; letter-spacing: -0.01em; }
.profile-sidebar-email { font-size: 13px; color: var(--ps-text-faint); margin: 0; word-break: break-all; }

/* Card do plano */
.profile-sidebar-plano-card {
  background: var(--ps-surface); border: 1px solid var(--ps-border);
  border-radius: 12px; padding: 16px 18px;
}
.profile-sidebar-plano-card.carregando { opacity: 0.6; }
.profile-sidebar-plano-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.profile-sidebar-plano-status .ponto { width: 6px; height: 6px; border-radius: 50%; }
.profile-sidebar-plano-status.ativo { color: var(--ps-success); }
.profile-sidebar-plano-status.ativo .ponto { background: #10b981; }
.profile-sidebar-plano-status.inativo { color: var(--ps-text-faint); }
.profile-sidebar-plano-status.inativo .ponto { background: var(--ps-text-faint); }
.profile-sidebar-plano-nome { font-weight: 600; font-size: 15px; color: var(--ps-text); margin: 8px 0 2px; }
.profile-sidebar-plano-meta { font-size: 12.5px; color: var(--ps-text-dim); margin: 0; }

/* Ações do card: "Gerenciar" e "Cancelar" lado a lado, mesmo tamanho */
.profile-sidebar-plano-acoes {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 16px; margin-top: 12px;
}
.profile-sidebar-plano-acoes:not(:has(> :not([hidden]))) { display: none; }
.btn-plano-link,
.btn-plano-cancelar-sidebar {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; padding: 0; background: none; border: 0; cursor: pointer;
  font: 600 13px/1.3 var(--ps-font);
  text-decoration: none;
}
.btn-plano-link { color: var(--ps-primary); }
.btn-plano-cancelar-sidebar { color: var(--ps-danger); font-weight: 500; }
.btn-plano-link:hover,
.btn-plano-cancelar-sidebar:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-plano-link[hidden],
.btn-plano-cancelar-sidebar[hidden] { display: none !important; }

/* Links */
.profile-sidebar-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-sidebar-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--ps-text-dim);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.profile-sidebar-links a:hover { background: var(--ps-hover); color: var(--ps-text); }

/* Rodapé */
.profile-sidebar-rodape {
  position: sticky; bottom: 0;
  padding: 16px 22px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--ps-bg); border-top: 1px solid var(--ps-border);
}
.profile-sidebar-sair {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13.5px var(--ps-font); color: #b91c1c;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 10px; padding: 12px; cursor: pointer;
  transition: background 0.15s ease;
}
.profile-sidebar-sair:hover { background: #fee2e2; }
.profile-sidebar-sair:disabled { opacity: 0.6; cursor: not-allowed; }