* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Cor da barra no Firefox, combinando com o tema do Painel de Controle. */
  scrollbar-color: #14b8a6 #071827;
  scrollbar-width: thin;
}

/* Barra de rolagem estilizada para Chrome, Edge e navegadores WebKit. */
html::-webkit-scrollbar {
  width: 13px;
}

html::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #06111f, #0b2b3a);
  border-left: 1px solid rgba(103, 232, 249, 0.16);
}

html::-webkit-scrollbar-thumb {
  min-height: 70px;
  background: linear-gradient(180deg, #22d3ee, #14b8a6 52%, #2563eb);
  border: 3px solid #071827;
  border-radius: 999px;
  box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.24);
}

html::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #67e8f9, #22c55e 52%, #3b82f6);
}

body {
  min-height: 100vh;
  color: #e2e8f0;
  background: #07111f;
  font-family: "DM Sans", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Cabecalho principal do Painel de Controle. */
.panel-page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(7, 17, 31, 0.9);
  border-bottom: 1px solid rgba(103, 232, 249, 0.16);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.panel-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(34, 211, 238, 0.18), transparent 30%),
    radial-gradient(circle at 86% 20%, rgba(15, 118, 110, 0.2), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #0f172a 46%, #083344 100%);
}

.panel-hero {
  min-height: 78vh;
  padding: 64px clamp(18px, 4vw, 56px);
  display: flex;
  flex-direction: column;
}

.panel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  /* Mais largura no desktop evita que os links fiquem espremidos ou quebrem de linha. */
  width: min(1500px, 100%);
  margin: 0 auto;
}

.panel-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.panel-brand > i {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7, #0f766e);
  border-radius: 50%;
  font-size: 24px;
}

.panel-brand strong,
.panel-brand small {
  display: block;
}

.panel-brand strong {
  color: #ffffff;
  font-size: 20px;
  text-transform: uppercase;
}

.panel-brand small {
  margin-top: 2px;
  color: #67e8f9;
  font-size: 13px;
  font-weight: 800;
}

/* Texto central do cabecalho, reforcando que a pagina e uma area restrita. */
.panel-header-title {
  display: grid;
  gap: 2px;
  text-align: center;
}

.panel-header-title span {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-header-title strong {
  color: #ffffff;
  font-size: 15px;
}

.panel-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.panel-nav-links [hidden] {
  display: none;
}

.panel-nav-links a,
.panel-nav-links button,
.panel-hero-actions a,
.panel-locked a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 8px;
  color: #ecfeff;
  background: rgba(8, 47, 73, 0.62);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.panel-nav-links a,
.panel-nav-links button {
  white-space: nowrap;
}

/* O botao hamburguer fica oculto no desktop. */
.panel-menu-toggle {
  display: none;
  width: 46px;
  height: 42px;
  padding: 9px;
  border: 1px solid rgba(103, 232, 249, 0.35);
  border-radius: 9px;
  background: rgba(8, 47, 73, 0.72);
  cursor: pointer;
}

.panel-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  margin: 4px 0;
  border-radius: 999px;
  background: #ecfeff;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Quando aberto, as tres linhas formam o X de fechamento. */
.panel-menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.panel-menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.panel-menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.panel-nav-links a:hover,
.panel-nav-links button:hover,
.panel-hero-actions a:hover,
.panel-locked a:hover {
  transform: translateY(-1px);
  background: rgba(15, 118, 110, 0.78);
  border-color: rgba(167, 243, 208, 0.55);
}

.panel-hero-content,
.panel-locked {
  width: min(920px, 100%);
  margin: auto 0;
  padding-top: 72px;
}

.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 12px;
  color: #a7f3d0;
  background: rgba(15, 118, 110, 0.18);
  border: 1px solid rgba(167, 243, 208, 0.22);
  border-radius: 999px;
  font-weight: 900;
}

.panel-hero h1,
.panel-locked h1 {
  max-width: 820px;
  color: #ffffff;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
}

/* Boas-vindas em uma linha, com tamanho menor e duas cores no nome dinamico. */
.panel-hero .panel-welcome-title {
  display: flex;
  align-items: baseline;
  gap: 0.22em;
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(24px, 4.2vw, 60px);
  line-height: 1.08;
  white-space: nowrap;
}

.panel-welcome-label {
  color: #f8fafc;
}

.panel-welcome-user {
  color: #67e8f9;
  text-shadow: 0 8px 28px rgba(34, 211, 238, 0.2);
}

.panel-hero p,
.panel-locked p {
  max-width: 680px;
  margin-top: 22px;
  color: #cbd5e1;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.65;
}

.panel-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.panel-locked {
  text-align: left;
}

.panel-locked > i {
  display: inline-flex;
  margin-bottom: 18px;
  color: #67e8f9;
  font-size: 54px;
}

.panel-locked a {
  margin-top: 26px;
}

.panel-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 70px 0;
}

.panel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 0;
}

.panel-stats article,
.panel-video-card,
.panel-content-grid a {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 8px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.2);
}

.panel-stats article {
  min-height: 150px;
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.panel-stats i {
  color: #67e8f9;
  font-size: 28px;
}

.panel-stats strong {
  color: #ffffff;
  font-size: 20px;
}

.panel-stats span {
  color: #cbd5e1;
  line-height: 1.5;
}

.panel-section-heading {
  margin-bottom: 26px;
}

.panel-section-heading span {
  color: #67e8f9;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 13px;
}

.panel-section-heading h2 {
  margin-top: 8px;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 48px);
}

.panel-video-grid,
.panel-content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.panel-video-card {
  overflow: hidden;
}

.panel-video-card video,
.panel-video-empty {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #020617;
}

/* Faz os videos preencherem todo o retangulo 16:9 sem distorcer a imagem. */
.panel-video-card video {
  height: auto;
  object-fit: cover;
  object-position: center;
}

.panel-video-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #67e8f9;
  font-weight: 900;
}

.panel-video-empty i {
  font-size: 42px;
}

.panel-video-card div:not(.panel-video-empty) {
  padding: 18px;
}

.panel-video-card span {
  color: #67e8f9;
  font-size: 13px;
  font-weight: 900;
}

.panel-video-card h3 {
  margin-top: 8px;
  color: #ffffff;
  font-size: 22px;
}

.panel-video-card p {
  margin-top: 10px;
  color: #cbd5e1;
  line-height: 1.55;
}

.panel-content-grid a {
  min-height: 170px;
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.panel-content-grid a:hover {
  transform: translateY(-3px);
  border-color: rgba(103, 232, 249, 0.44);
  background: rgba(14, 116, 144, 0.2);
}

.panel-content-grid i {
  color: #67e8f9;
  font-size: 30px;
}

.panel-content-grid strong {
  color: #ffffff;
  font-size: 20px;
}

.panel-content-grid small {
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.5;
}

/* Texto complementar usado nos cabecalhos das novas areas internas. */
.panel-section-heading > p {
  max-width: 720px;
  margin-top: 12px;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1.65;
}

/* AREA DE DOWNLOADS: cards seguem a paleta azul, ciano e verde do painel. */
.panel-downloads-section {
  position: relative;
}

.panel-download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.panel-download-card {
  position: relative;
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.19), rgba(30, 41, 59, 0.86));
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel-download-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #22d3ee, #10b981, #2563eb);
}

.panel-download-card:hover {
  transform: translateY(-5px);
  border-color: rgba(103, 232, 249, 0.48);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.panel-download-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #0891b2, #0f766e);
  border-radius: 9px;
  font-size: 26px;
  box-shadow: 0 14px 25px rgba(6, 182, 212, 0.2);
}

.panel-download-info {
  flex: 1;
}

.panel-download-info span,
.panel-post-card small {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-download-info h3,
.panel-post-card h3 {
  margin-top: 8px;
  color: #ffffff;
  font-size: 21px;
}

.panel-download-info p,
.panel-post-card p {
  margin-top: 10px;
  color: #cbd5e1;
  line-height: 1.55;
}

.panel-download-card > a {
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #ffffff;
  background: linear-gradient(90deg, #0e7490, #0f766e);
  border-radius: 7px;
  font-weight: 900;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.panel-download-card > a:hover {
  filter: brightness(1.14);
  transform: translateY(-2px);
}

/* IMAGENS DE TECNOLOGIA: miniaturas leves com download direto do arquivo original. */
.panel-images-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.panel-image-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.panel-image-card:hover {
  transform: translateY(-5px);
  border-color: rgba(103, 232, 249, 0.48);
}

.panel-image-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #020617;
}

.panel-image-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.76));
  pointer-events: none;
}

.panel-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.panel-image-card:hover .panel-image-preview img {
  transform: scale(1.055);
}

.panel-image-details {
  padding: 18px;
}

.panel-image-details span {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-image-details h3 {
  margin-top: 7px;
  color: #ffffff;
  font-size: 19px;
}

.panel-image-details a {
  min-height: 42px;
  margin-top: 16px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  background: linear-gradient(90deg, #0369a1, #0f766e);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
  transition: filter 0.2s ease;
}

.panel-image-details a:hover {
  filter: brightness(1.16);
}

/* MEUS CERTIFICADOS: galeria interna com imagem completa e acoes separadas. */
.panel-certificates-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.panel-certificate-card {
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(30, 64, 175, 0.14));
  border: 1px solid rgba(103, 232, 249, 0.17);
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.panel-certificate-card:hover {
  transform: translateY(-5px);
  border-color: rgba(103, 232, 249, 0.48);
}
/* Painel Certificate-PREVIEW HEIGTH 230PX */
.panel-certificate-preview {
  height: 265px;
  padding: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(130deg, #eef6fb, #ffffff);
}

.panel-certificate-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
}

.panel-certificate-card:hover .panel-certificate-preview img {
  transform: scale(1.025);
}

.panel-certificate-info {
  padding: 20px;
}

.panel-certificate-info > span {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-certificate-info h3 {
  min-height: 50px;
  margin-top: 8px;
  color: #ffffff;
  font-size: 20px;
}

.panel-certificate-info > div {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.panel-certificate-info a {
  min-height: 42px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #ffffff;
  background: rgba(14, 116, 144, 0.72);
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
  transition: background 0.2s ease, transform 0.2s ease;
}

.panel-certificate-info a:last-child {
  background: linear-gradient(90deg, #0f766e, #047857);
}

.panel-certificate-info a:hover {
  background: #0369a1;
  transform: translateY(-2px);
}

/* CONTROLE ADMINISTRATIVO: lista protegida para editar e excluir usuários. */
.panel-admin-section { background: linear-gradient(145deg, rgba(7,26,61,.96), rgba(15,118,110,.2)); border: 1px solid rgba(34,211,238,.2); border-radius: 14px; }
/* ESPACAMENTO DO CABECALHO ADMIN: separa subtitulo, titulo, paragrafo e lista. */
.panel-admin-section .panel-section-heading { margin: 0 0 54px; padding-top: 20px; }
.panel-admin-section .panel-section-heading > span { display: block; margin: 0 0 18px 56px; }
.panel-admin-section .panel-section-heading > h2 { margin: 0 0 24px 56px; line-height: 1.12; }
.panel-admin-section .panel-section-heading > p { margin: 0 0 0 56px; line-height: 1.7; }
.panel-admin-list { display: grid; gap: 14px; }
.panel-admin-user { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; align-items: center; padding: 16px; background: rgba(15,23,42,.72); border: 1px solid rgba(125,211,252,.18); border-radius: 12px; }
/* ADMIN EM DESTAQUE: permanece no topo e recebe identidade visual propria. */
.panel-admin-user.is-admin {
  background: linear-gradient(115deg, rgba(8,47,73,.96), rgba(15,118,110,.34));
  border-color: rgba(103,232,249,.72);
  box-shadow: 0 14px 34px rgba(6,182,212,.16), inset 4px 0 0 #22d3ee;
}
.panel-admin-user.is-admin .panel-admin-user-id {
  background: linear-gradient(135deg,#f59e0b,#0891b2 54%,#0f766e);
  box-shadow: 0 0 0 4px rgba(103,232,249,.16), 0 12px 28px rgba(6,182,212,.28);
}
.panel-admin-role-badge {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  padding: 5px 10px;
  color: #ecfeff;
  background: linear-gradient(90deg,#0284c7,#0f766e);
  border: 1px solid rgba(165,243,252,.48);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 8px 18px rgba(2,132,199,.2);
}
.panel-admin-user-id { display: grid; place-items: center; width: 52px; height: 52px; color: #ecfeff; background: linear-gradient(135deg,#0284c7,#0f766e); border-radius: 50%; font-weight: 900; }
.panel-admin-user-id { overflow: hidden; }
.panel-admin-user-id img { width: 100%; height: 100%; object-fit: cover; }
/* Avatar padrao exibido quando o usuario ainda nao enviou foto. */
.panel-admin-user-id--default {
  position: relative;
  overflow: visible;
  isolation: isolate;
  font-size: 28px;
  border: 1px solid rgba(236,254,255,.42);
  box-shadow: 0 16px 30px rgba(2,132,199,.28), inset 0 0 0 2px rgba(255,255,255,.12);
}
/* Camada interna que cria volume no avatar padrao sem usar imagem externa. */
.panel-admin-user-id--default::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 0 20px rgba(255,255,255,.16);
}
/* Reflexo superior para deixar o icone com aparencia mais polida. */
.panel-admin-user-id--default::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 11px;
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.34);
  transform: rotate(-28deg);
}
/* Cores do avatar padrao feminino. */
.panel-admin-user-id--female { background: radial-gradient(circle at 32% 24%, #f9a8d4 0 12%, transparent 28%), linear-gradient(135deg,#be185d 0%,#7c3aed 48%,#0891b2 100%); }
/* Cores do avatar padrao masculino. */
.panel-admin-user-id--male { background: radial-gradient(circle at 32% 24%, #bae6fd 0 12%, transparent 28%), linear-gradient(135deg,#0284c7 0%,#1d4ed8 48%,#0f766e 100%); }
.panel-admin-user-id--default i { line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.28)); }
/* Selo com o ID do usuario sobreposto ao avatar padrao. */
.panel-admin-user-number {
  position: absolute;
  right: -8px;
  bottom: -8px;
  min-width: 30px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  color: #ecfeff;
  background: linear-gradient(135deg,#071a3d,#0f172a);
  border: 1px solid rgba(125,211,252,.58);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
  font-size: 11px;
  font-weight: 900;
}
.panel-admin-fields { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
.panel-admin-text-field { display: grid; gap: 5px; color: #93c5fd; font-size: 11px; font-weight: 800; }
.panel-admin-fields input { width: 100%; min-height: 42px; padding: 0 11px; color: #e0f2fe; background: #071a3d; border: 1px solid rgba(125,211,252,.24); border-radius: 8px; }
.panel-admin-avatar-field { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin-top: 10px; cursor: pointer; }
.panel-admin-avatar-field input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.panel-admin-avatar-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; color: #fff; background: linear-gradient(135deg,#0284c7,#0f766e); border: 1px solid rgba(103,232,249,.36); border-radius: 9px; box-shadow: 0 10px 22px rgba(2,132,199,.2); transition: transform .22s ease, filter .22s ease, box-shadow .22s ease; }
.panel-admin-avatar-button i { font-size: 15px; }
.panel-admin-avatar-field:hover .panel-admin-avatar-button { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 14px 28px rgba(2,132,199,.3); }
.panel-admin-avatar-name { max-width: 210px; overflow: hidden; color: #93c5fd; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.panel-admin-meta { margin-top: 8px; color: #93c5fd; font-size: 12px; }
.panel-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.panel-admin-actions button { min-height: 40px; padding: 0 12px; color: #fff; border: 0; border-radius: 8px; background: #0369a1; cursor: pointer; font-weight: 800; }
.panel-admin-actions .is-password { background: #0f766e; }
.panel-admin-actions .is-delete { background: #be123c; }
.panel-admin-actions button:disabled { opacity: .48; cursor: not-allowed; }
.panel-admin-feedback { min-height: 22px; margin-bottom: 14px; color: #a7f3d0; font-weight: 800; transition: opacity .35s ease; }

/* POSTS MAIS VISTOS: ranking visual com cards de acesso rapido. */
.panel-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.panel-post-card {
  position: relative;
  min-height: 300px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.22), transparent 42%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 118, 110, 0.18));
  border: 1px solid rgba(148, 163, 184, 0.17);
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.panel-post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(103, 232, 249, 0.48);
}

.panel-post-card > i {
  color: #67e8f9;
  font-size: 38px;
}

.panel-post-rank {
  position: absolute;
  top: 16px;
  right: 18px;
  color: rgba(255, 255, 255, 0.12);
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
}

.panel-post-card > div {
  flex: 1;
}

.panel-post-card > strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #67e8f9;
  font-size: 14px;
}

.panel-post-card > strong i {
  transition: transform 0.2s ease;
}

.panel-post-card:hover > strong i {
  transform: translate(3px, -3px);
}

/* Rodape do Painel de Controle com credito do portfolio. */
.panel-page-footer {
  padding: 22px clamp(18px, 4vw, 56px);
  color: #cbd5e1;
  background: #050b14;
  border-top: 1px solid rgba(103, 232, 249, 0.14);
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

.panel-page-footer span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

/* Chat com avatar no canto esquerdo, seguindo o componente da pagina principal. */
.footer-chat { position: fixed; left: 24px; bottom: 24px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
/* CORRECAO MOBILE 04/10/2026: a caixa invisivel do chat bloqueava
   Trajetoria, Mais vistos, Admin, Atalhos e Sair no menu do painel. */
.footer-chat,
.whatsapp-widget {
  /* A caixa transparente dos widgets nao deve interceptar a pagina. */
  pointer-events: none;
}

.footer-chat__button,
.footer-chat.is-open .footer-chat__panel,
.whatsapp-button {
  /* Mantem o toque nos botoes e no conteudo do chat quando aberto. */
  pointer-events: auto;
}
.footer-chat__panel { width: min(320px, calc(100vw - 48px)); padding: 16px; color: #e0f2fe; background: linear-gradient(145deg, rgba(7, 26, 61, .98), rgba(18, 63, 120, .96)); border: 1px solid rgba(125, 211, 252, .26); border-radius: 18px; box-shadow: 0 18px 38px rgba(0, 0, 0, .28); opacity: 0; visibility: hidden; transform: translateY(16px) scale(.96); transform-origin: bottom left; transition: opacity .28s ease, visibility .28s ease, transform .28s ease; }
.footer-chat.is-open .footer-chat__panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.footer-chat__header { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid rgba(219, 234, 254, .16); }
.footer-chat__header img { width: 48px; height: 48px; object-fit: cover; border: 2px solid #38bdf8; border-radius: 50%; }
.footer-chat__header strong, .footer-chat__header span { display: block; }
.footer-chat__header strong { color: #fff; font-size: 1rem; }
.footer-chat__header span { color: #a7f3d0; font-size: .86rem; font-weight: 700; }
.footer-chat__body p { margin: 0 0 10px; color: #dbeafe; font-size: .95rem; line-height: 1.55; }
.footer-chat__action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 6px; color: #fff; font-weight: 800; border-radius: 12px; background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 12px 24px rgba(22, 163, 74, .24); transition: transform .25s ease, filter .25s ease; }
.footer-chat__action:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.06); }
.footer-chat__button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; padding: 0; cursor: pointer; border: 0; border-radius: 50%; background: linear-gradient(135deg, #38bdf8, #2563eb); box-shadow: 0 16px 30px rgba(37, 99, 235, .34); transition: transform .25s ease, box-shadow .25s ease; }
.footer-chat__button:hover { transform: translateY(-3px) scale(1.03); }
.footer-chat__button img { width: 52px; height: 52px; object-fit: cover; border: 2px solid rgba(255,255,255,.72); border-radius: 50%; }
.footer-chat__button i { position: absolute; right: -4px; bottom: -3px; display: grid; place-items: center; width: 28px; height: 28px; color: #fff; font-size: .98rem; border: 2px solid #071a3d; border-radius: 50%; background: #22c55e; }

/* Seta flutuante acima do avatar esquerdo, afastada do WhatsApp da direita. */
.panel-scroll-top { position: fixed; left: 32px; bottom: 105px; z-index: 1100; display: grid; place-items: center; width: 48px; height: 48px; color: #ecfeff; border: 1px solid rgba(103, 232, 249, .46); border-radius: 15px; background: linear-gradient(135deg, #0284c7, #0f766e); box-shadow: 0 14px 28px rgba(2, 132, 199, .3); cursor: pointer; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(12px) rotate(-8deg); transition: opacity .25s ease, visibility .25s ease, transform .25s ease; }
.panel-scroll-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) rotate(0); }
.panel-scroll-top:hover { transform: translateY(-4px); background: linear-gradient(135deg, #22d3ee, #0f766e); }
.panel-scroll-top i { font-size: 24px; }

/* TELA DE MOBILE */
@media (max-width: 900px) {
  .panel-page-header {
    z-index: 2147483000;
  }

  body.panel-menu-open {
    overflow: hidden;
  }

  /* Oculta os widgets durante a navegacao no menu mobile.
     !important vence o display inline definido pelo script do WhatsApp. */
  body.panel-menu-open .footer-chat,
  body.panel-menu-open .whatsapp-widget,
  body.panel-menu-open .panel-scroll-top {
    display: none !important;
  }

  .panel-nav {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
  }

  /* No mobile, o botao aparece ao lado da marca e controla todos os links. */
  .panel-menu-toggle {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  .panel-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: calc(100vh - var(--panel-header-height, 140px));
    max-height: calc(100dvh - var(--panel-header-height, 140px));
    padding: 12px 18px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #07111f;
    flex-direction: column;
    justify-content: flex-start;
  }

  .panel-nav-links.is-open {
    display: flex;
    animation: panelMenuReveal 0.25s ease both;
  }

  .panel-header-title {
    grid-column: 1 / -1;
    text-align: left;
  }

  .panel-nav-links a,
  .panel-nav-links button {
    width: 100%;
    min-height: 44px;
    flex: 0 0 auto;
  }

  .panel-stats,
  .panel-video-grid,
  .panel-content-grid,
  .panel-download-grid,
  .panel-certificates-grid,
  .panel-posts-grid {
    grid-template-columns: 1fr;
  }
  .panel-images-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* CONTROLE ADMIN NO MOBILE: campos e botoes se reorganizam sem cortes. */
  .panel-admin-user { grid-template-columns: 52px 1fr; }
  .panel-admin-fields { grid-template-columns: 1fr; }
  .panel-admin-actions { grid-column: 1 / -1; justify-content: stretch; }
  .panel-admin-actions button { flex: 1 1 130px; }
  .panel-admin-section .panel-section-heading { padding-left: 0; padding-right: 0; }
  .panel-admin-section .panel-section-heading > span { margin-left: 26px; }
  .panel-admin-section .panel-section-heading > h2 { margin-left: 26px; }
  .panel-admin-section .panel-section-heading > p { margin-left: 26px; margin-right: 26px; }
  .panel-admin-avatar-field { align-items: flex-start; flex-direction: column; }

  /* CERTIFICADOS NO MOBILE: mantém a proporção real da imagem sem invadir o título e os botões. */
  .panel-certificate-preview {
    height: auto;
  }

  .panel-certificate-preview img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
}

/* Entrada suave do menu responsivo sem interferir na rolagem da pagina. */
@keyframes panelMenuReveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .panel-page-header {
    position: sticky;
  }

  .panel-hero {
    padding-left: 18px;
    padding-right: 18px;
  }

  .panel-images-grid {
    grid-template-columns: 1fr;
  }

  /* CONTROLE ADMIN EM CELULAR: cartão vertical, campos amplos e ações confortáveis. */
  .panel-admin-section {
    padding-left: 10px;
    padding-right: 10px;
  }

  .panel-admin-section .panel-section-heading > span,
  .panel-admin-section .panel-section-heading > h2,
  .panel-admin-section .panel-section-heading > p {
    margin-left: 14px;
    margin-right: 14px;
  }

  .panel-admin-user {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 14px;
  }

  .panel-admin-user-id {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    font-size: 17px;
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.3);
  }

  .panel-admin-fields {
    width: 100%;
    gap: 12px;
  }

  .panel-admin-fields input {
    min-height: 46px;
    font-size: 14px;
  }

  .panel-admin-avatar-field {
    width: 100%;
    gap: 8px;
  }

  .panel-admin-avatar-button {
    width: 100%;
    min-height: 46px;
  }

  .panel-admin-avatar-name {
    max-width: 100%;
    padding-left: 3px;
  }

  .panel-admin-meta {
    line-height: 1.55;
  }

  .panel-admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 10px;
  }

  .panel-admin-actions button {
    width: 100%;
    min-height: 46px;
    padding: 6px 10px;
  }

  .panel-admin-actions .is-delete {
    grid-column: 1 / -1;
  }

  /* Ajusta os tres controles flutuantes sem encobrir o conteudo no celular. */
  .footer-chat { left: 12px; bottom: 18px; }
  .footer-chat__button { width: 56px; height: 56px; }
  .footer-chat__button img { width: 46px; height: 46px; }
  .panel-scroll-top { left: 18px; bottom: 88px; width: 44px; height: 44px; }
}
