.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--servcom-white);
  border-bottom: 1px solid var(--servcom-gray-200);
  box-shadow: var(--servcom-shadow);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

/* --- Menu do usuário (dropdown) --- */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border: 1px solid var(--servcom-gray-200);
  border-radius: 999px;
  background: var(--servcom-white);
  color: var(--servcom-navy);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.user-menu-trigger:hover,
.user-menu.is-open .user-menu-trigger {
  border-color: color-mix(in srgb, var(--servcom-blue) 40%, var(--servcom-gray-200));
  background: var(--servcom-blue-light);
  box-shadow: 0 6px 18px rgba(30, 111, 217, 0.12);
}

.user-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(145deg, var(--servcom-blue), #4d9cf0);
  flex-shrink: 0;
}

.user-menu-avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
}

.user-menu-trigger-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
}

.user-menu-shortname {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--servcom-navy);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-caption {
  font-size: 0.72rem;
  color: var(--servcom-gray-500);
}

.user-menu-chevron {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--servcom-gray-500);
  transition: transform 0.2s ease;
}

.user-menu-chevron svg {
  width: 16px;
  height: 16px;
}

.user-menu.is-open .user-menu-chevron {
  transform: rotate(180deg);
  color: var(--servcom-blue);
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 300;
  width: min(280px, calc(100vw - 2rem));
  padding: 0.5rem;
  border-radius: 14px;
  background: var(--servcom-white);
  border: 1px solid var(--servcom-gray-200);
  box-shadow:
    0 4px 6px rgba(26, 43, 74, 0.04),
    0 18px 40px rgba(26, 43, 74, 0.14);
  transform-origin: top right;
  animation: userMenuIn 0.18s ease;
}

.user-menu-panel[hidden] {
  display: none !important;
}

@keyframes userMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-menu-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--servcom-blue-light), #f8fbff);
}

.user-menu-profile-text {
  min-width: 0;
}

.user-menu-name {
  display: block;
  font-size: 0.92rem;
  color: var(--servcom-navy);
  line-height: 1.25;
}

.user-menu-email {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--servcom-gray-500);
  word-break: break-word;
}

.user-menu-divider {
  height: 1px;
  margin: 0.35rem 0.25rem;
  background: var(--servcom-gray-200);
}

.user-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-menu-action {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--servcom-navy);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-menu-action:hover {
  background: var(--servcom-gray-100);
}

.user-menu-action-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--servcom-gray-100);
  color: var(--servcom-blue);
  flex-shrink: 0;
}

.user-menu-action-icon svg {
  width: 17px;
  height: 17px;
}

.user-menu-action--danger {
  color: var(--servcom-danger);
}

.user-menu-action--danger .user-menu-action-icon {
  background: #fef2f2;
  color: var(--servcom-danger);
}

.user-menu-action--danger:hover {
  background: #fef2f2;
}

@media (max-width: 720px) {
  .user-menu-trigger-text { display: none; }
  .user-menu-trigger { padding: 0.3rem; border-radius: 50%; }
  .user-menu-chevron { display: none; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--servcom-navy);
  text-decoration: none;
  flex-shrink: 0;
}

.brand img.logo-full {
  height: 30px;
  width: auto;
  max-width: min(168px, 38vw);
  display: block;
}

.hero {
  padding: 3rem 0 2rem;
  background: linear-gradient(135deg, var(--servcom-white) 0%, var(--servcom-blue-light) 100%);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hero p {
  margin: 0;
  color: var(--servcom-gray-700);
  max-width: 60ch;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  padding: 2rem 0 4rem;
}

.module-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 240px;
  gap: 1.75rem;
  padding: 0 0 4rem;
  align-items: start;
}

.reading-column {
  min-width: 0;
}

@media (max-width: 1180px) {
  .module-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .module-aside { display: none; }
}

@media (max-width: 860px) {
  .module-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
}

.sidebar, .module-aside, .content-panel {
  background: var(--servcom-white);
  border: 1px solid var(--servcom-gray-200);
  border-radius: var(--servcom-radius);
  box-shadow: var(--servcom-shadow);
}

.sidebar {
  padding: 1rem;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  max-height: calc(100vh - var(--header-height) - 2rem);
  overflow: auto;
}

.module-aside {
  padding: 1.25rem;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.content-panel {
  padding: 2rem;
  min-height: 60vh;
}

.content-panel-wide {
  padding: 2.25rem 2.75rem;
}

.module-toolbar {
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: var(--servcom-gray-500);
  font-size: 0.9rem;
}

.quiz-panel { padding: 2rem; }

.footer-note {
  text-align: center;
  color: var(--servcom-gray-500);
  font-size: 0.85rem;
  padding: 2rem 0 3rem;
}

.sidebar-module-meta h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.sidebar-module-meta p {
  margin: 0 0 1rem;
  color: var(--servcom-gray-500);
  font-size: 0.85rem;
}

.aside-note {
  font-size: 0.85rem;
  color: var(--servcom-gray-500);
  margin-top: 0.75rem;
}

.module-page main {
  background:
    radial-gradient(circle at top right, rgba(30, 111, 217, 0.08), transparent 28%),
    radial-gradient(circle at 20% 40%, rgba(77, 156, 240, 0.05), transparent 24%),
    var(--servcom-gray-50);
}

/* ── Grupos de trilha (dashboard) ─────────────────────────────────────── */
.trail-group {
  margin-bottom: 3rem;
}

.trail-group-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--servcom-gray-200);
  margin-bottom: 0.25rem;
}

.trail-group-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--servcom-blue), #4d9cf0);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.trail-group-title {
  margin: 0 0 0.2rem;
  font-size: 1.25rem;
  color: var(--servcom-navy);
}

.trail-group-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--servcom-gray-500);
}

/* ── Visualizador de PDF (módulos tipo "pdf") ─────────────────────────── */
.pdf-module-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem 0 4rem;
}

.pdf-module-header {
  background: var(--servcom-white);
  border: 1px solid var(--servcom-gray-200);
  border-radius: var(--servcom-radius);
  box-shadow: var(--servcom-shadow);
  padding: 1.75rem 2rem;
}

.pdf-module-meta {
  max-width: 720px;
}

.pdf-module-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--servcom-navy);
}

.pdf-module-sub {
  margin: 0;
  color: var(--servcom-gray-500);
  font-size: 0.95rem;
}

.pdf-viewer-wrap {
  background: var(--servcom-white);
  border: 1px solid var(--servcom-gray-200);
  border-radius: var(--servcom-radius);
  box-shadow: var(--servcom-shadow);
  overflow: hidden;
}

.pdf-iframe {
  display: block;
  width: 100%;
  height: calc(100vh - var(--header-height) - 260px);
  min-height: 520px;
  border: none;
}

@media (max-width: 720px) {
  .pdf-iframe { min-height: 380px; }
  .pdf-module-header { padding: 1.25rem; }
}
