/* =====================================================================
   A Liga dos Corretores — Design System
   Tipografia: Manrope (token --liga-font em liga-identidade.css) · Marca: índigo → violeta
   ===================================================================== */

:root {
  /* Marca */
  --brand-1: #513cfa;
  --brand-2: #513cfa;
  --brand-700: #4331d8;
  --brand-50: rgba(81, 60, 250, .08);
  --brand-100: rgba(81, 60, 250, .16);
  --grad: #513cfa;
  /* minimal: sem gradiente */

  /* Neutros (slate) */
  --ink: #0f172a;
  /* títulos / texto forte */
  --text: #475569;
  /* corpo */
  --muted: #64748b;
  --faint: #94a3b8;
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --border: rgba(15, 23, 42, .07);
  --border-strong: #d7dce6;

  /* Destaque neon (campo de resposta dissertativa) */
  --neon-edge: rgba(15, 23, 42, .9);
  --neon-glow-1: rgba(15, 23, 42, .22);
  --neon-glow-2: rgba(15, 23, 42, .10);

  /* Semânticos */
  --success: #15803d;
  --success-bg: #dcfce7;
  --success-bd: #bbf7d0;
  --warning: #a16207;
  --warning-bg: #fef9c3;
  --warning-bd: #fde68a;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-bd: #fecaca;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --star: #f59e0b;
  /* dourado das avaliações (estrelas) — único ponto de verdade */

  /* Compat (nomes antigos) */
  --erro-bg: var(--danger-bg);
  --erro-border: var(--danger-bd);
  --erro-ink: #b91c1c;

  /* Raios */
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --radius: 16px;

  /* Elevação */
  --sh-1: 0 1px 3px rgba(15, 23, 42, .06);
  --sh-2: 0 4px 12px -4px rgba(15, 23, 42, .08);
  --sh-3: 0 12px 28px -12px rgba(15, 23, 42, .12);
  --sh-brand: none;
  /* minimal: sem glow */
  --shadow: var(--sh-3);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--liga-font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--liga-font);
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

a {
  color: var(--brand-1);
}

::selection {
  background: var(--brand-100);
  color: var(--brand-700);
}

/* ===== Telas centrais (403 / 404 / erro) ===== */
.tela-central {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tela-central-card {
  max-width: 460px;
  width: 100%;
  text-align: center;
}
.tela-central-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: var(--r-lg);
  background: var(--brand-50);
  color: var(--brand-1);
}
.tela-central-ico svg { width: 34px; height: 34px; }
.tela-central-num {
  display: block;
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brand-1);
  margin-bottom: 6px;
}
.tela-central-card h2 { margin-bottom: 8px; }
.tela-central-acoes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

/* ===== Vitrine / catálogo público (cat-*, cd-*) =====
   Antes viviam em <style> inline nas views usando variáveis inexistentes (--acento, --borda,
   --card, --txt...), o que sempre caía nos fallbacks escuros e quebrava o modo claro. Agora
   usam os tokens reais do design system e respeitam claro/escuro. */
.cat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}
.cat-brand img { height: 60px; width: auto; display: block; }
.cat-topbar nav { display: flex; gap: 10px; align-items: center; }
.cat-btn {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  transition: background .15s, border-color .15s;
}
.cat-btn:hover { background: var(--surface-2); }
.cat-btn.pri { background: var(--brand-1); border-color: transparent; color: #fff; }
.cat-btn.pri:hover { background: var(--brand-700); }
.cat-main { max-width: 1180px; margin: 0 auto; }
.cat-sub { color: var(--muted); }
.cat-desc {
  color: var(--muted);
  font-size: .9rem;
  margin: 6px 0 10px;
  line-height: 1.4;
  min-height: 2.5em;
}
.cat-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.cat-rating { color: var(--star); font-weight: 600; }
.cat-rating .cnt { color: var(--muted); font-weight: 400; }
.cat-preco { font-weight: 700; color: var(--ink); }
.cat-vagas { font-size: .78rem; color: var(--muted); }
.curso-status.status-esgotado { background: var(--danger); color: #fff; }
.curso-status.status-matriculado { background: var(--success); color: #fff; }

/* Página do curso (landing pública) */
.cd-wrap { max-width: 1080px; margin: 0 auto; padding: 8px 24px 48px; }
.cd-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  margin-bottom: 16px;
}
.cd-voltar:hover { color: var(--ink); }
.cd-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.cd-capa {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--r-lg);
  background: var(--surface-2) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  margin-bottom: 20px;
}
.cd-titulo { font-size: 1.8rem; font-weight: 700; margin: 0 0 10px; }
.cd-desc { color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.cd-metabar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 16px 0 24px;
  color: var(--muted);
  font-size: .9rem;
}
.cd-metabar strong { color: var(--ink); }
.cd-card {
  position: sticky;
  top: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--sh-2);
}
.cd-preco { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; color: var(--ink); }
.cd-preco-obs { font-size: .8rem; color: var(--muted); margin-bottom: 16px; }
.cd-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  background: var(--brand-1);
  color: #fff;
  text-decoration: none;
  transition: background .15s;
}
.cd-cta:hover { background: var(--brand-700); }
.cd-cta.sec { background: transparent; border: 1px solid var(--border-strong); color: var(--ink); }
.cd-cta.off { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.cd-cta.off:hover { background: var(--surface-2); }
.cd-vagas { font-size: .84rem; color: var(--muted); margin-top: 12px; text-align: center; }
.cd-alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-bd);
  color: var(--erro-ink);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  font-size: .9rem;
}
.cd-reviews { margin-top: 40px; }
.cd-reviews h2 { font-size: 1.3rem; margin-bottom: 6px; }
.cd-res { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.cd-res .nota { font-size: 2rem; font-weight: 800; color: var(--star); }
.cd-res .de { color: var(--muted); }
.review { border-top: 1px solid var(--border); padding: 16px 0; }
.review .cab { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.review .nome { font-weight: 600; color: var(--ink); }
.review .estrelas { color: var(--star); font-size: .9rem; }
.review .estrelas .vazio { color: var(--border-strong); }
.review .data { color: var(--muted); font-size: .82rem; }
.review .txt { color: var(--text); line-height: 1.5; }
@media (max-width: 820px) { .cd-grid { grid-template-columns: 1fr; } }

/* Acessibilidade: foco visível */
:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 2px;
  border-radius: 6px;
}

button,
a,
input,
select,
textarea,
summary {
  outline: none;
}

/* Textareas com tamanho fixo — sem alça de redimensionar; rolagem interna se o texto passar */
textarea {
  resize: none;
  overflow-y: auto;
}

/* Controles nativos (dropdown do select, scrollbars) seguem o tema */
:root {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
}

/* Garante texto legível nas opções do <select> em modo escuro */
[data-theme="dark"] select option,
[data-theme="dark"] select optgroup {
  background-color: var(--surface);
  color: var(--ink);
}

/* Logo (marca + wordmark) */
.logo-mark {
  width: 30px;
  height: auto;
  flex-shrink: 0;
}

.topbar-logo,
.brand-logo,
.form-logo-mobile {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

/* Lockup por tema: a versão em fundo verde no tema claro, a sem fundo (texto
   branco) no escuro. Só uma das duas <img> fica visível de cada vez. */
img.logo-tema-escuro {
  display: none;
}

[data-theme="dark"] img.logo-tema-claro {
  display: none;
}

[data-theme="dark"] img.logo-tema-escuro {
  display: block;
}

.logo-tema-claro {
  border-radius: var(--r-sm);
}

/* =================== Login =================== */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  /* minimal: flat */
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Auth minimal: painel de marca some — vira coluna única centralizada */
.brand-panel {
  display: none;
}

.form-panel {
  display: block;
  padding: 0;
}

.form-card {
  width: 100%;
  max-width: 100%;
}

/* Logo centralizado no topo (coluna única) */
.form-logo-mobile {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

/* lockup empilhado (marca + "A LIGA / DOS CORRETORES") — precisa de altura
   suficiente para a linha "DOS CORRETORES" continuar legível */
.form-logo-img {
  display: block;
  width: auto;
  height: 92px;
  max-width: 100%;
}

.topbar-logo span,
.sidebar-logo span {
  font-size: 14px;
  line-height: 1.2;
}

.form-header {
  text-align: center;
}

.form-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.form-header p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* Rótulo do campo com link à direita (ex.: Senha · Esqueceu a senha?) */
.campo-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

.campo-label-row label {
  margin-bottom: 0;
}

/* =================== Campos =================== */
.campo {
  margin-bottom: 18px;
}

.campo label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 12px 15px;
  font-size: 15px;
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}

.campo textarea {
  resize: none;
  overflow-y: auto;
  min-height: 96px;
}

/* Checklist de força de senha (feedback ao vivo — public/js/senha.js) */
.senha-regras {
  list-style: none;
  margin: 9px 0 2px;
  padding: 0;
  display: grid;
  gap: 5px;
  font-size: .8rem;
}
.senha-regras li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  transition: color .15s;
}
.senha-regras li::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: center / 10px no-repeat;
  transition: background-color .15s, border-color .15s;
}
.senha-regras li.ok { color: var(--success); }
.senha-regras li.ok::before {
  border-color: var(--success);
  background-color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.campo select {
  cursor: pointer;
}

.campo input::placeholder,
.campo textarea::placeholder {
  color: var(--faint);
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--brand-1);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(81, 60, 250, .14);
}

/* Senha com olho */
.campo-senha {
  position: relative;
}

.campo-senha input {
  padding-right: 46px;
}

.btn-olho {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  opacity: .65;
  color: var(--faint);
  transition: opacity .15s, background .15s;
}

.btn-olho svg {
  display: block;
  width: 18px;
  height: 18px;
}

.btn-olho:hover {
  opacity: 1;
  background: var(--brand-50);
}

.campo-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.lembrar {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
}

.esqueci {
  color: var(--brand-1);
  text-decoration: none;
  font-weight: 600;
}

.esqueci:hover {
  text-decoration: underline;
}

/* =================== Botões =================== */
.btn-entrar,
.btn-primario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--grad);
  font-family: inherit;
  white-space: nowrap;
  box-shadow: var(--sh-brand);
  transition: transform .14s, box-shadow .2s, filter .2s;
}

.btn-entrar {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.btn-primario {
  padding: 11px 18px;
  font-size: 14px;
  text-decoration: none;
}

.btn-entrar:hover,
.btn-primario:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

.btn-entrar:active,
.btn-primario:active {
  transform: translateY(0);
}

.btn-bloco {
  width: 100%;
  margin-top: 8px;
}

.btn-voltar {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: color .15s;
}

.btn-voltar:hover {
  color: var(--brand-1);
}

.form-footer {
  margin-top: 28px;
  text-align: center;
}

.form-footer p {
  font-size: 12px;
  color: var(--faint);
}

/* Confirmação "email enviado" */
.confirma-box {
  text-align: center;
  padding: 10px 0 6px;
}

.confirma-ico {
  font-size: 46px;
  margin-bottom: 10px;
}

.confirma-box h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.confirma-box p {
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.6;
}

.confirma-box .muted {
  color: var(--muted);
  font-size: 14px;
}

/* =================== Topbar =================== */
/* Rodapé "A LIGA DOS CORRETORES" do partial notify: só faz sentido na comunidade (#liga-studio). */
.dashboard-page .l-app-footer { display: none; }

.dashboard-page {
  min-height: 100dvh;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-logo {
  font-family: var(--liga-font);
  font-weight: 700;
  font-size: 18px;
  color: #1a3c29;
  /* verde escuro da marca (logo) — tema claro */
  text-decoration: none;
}

[data-theme="dark"] .topbar-logo {
  color: #6ecf98;
  /* verde claro derivado do #1a3c29, legível no fundo escuro */
}

.btn-sair {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-1);
  background: var(--brand-50);
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.btn-sair:hover {
  background: var(--brand-100);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-nav>a,
.nav-drop>summary {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
  cursor: pointer;
  white-space: nowrap;
}

.topbar-nav>a:hover,
.nav-drop>summary:hover {
  color: var(--ink);
}

.topbar-nav>a.ativo,
.nav-drop>summary.ativo {
  color: var(--ink);
}

.topbar-nav form {
  margin-left: 8px;
}

/* Botão hambúrguer (mobile) */
.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  padding: 6px;
  border-radius: var(--r-sm);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* Dropdown "Administração" */
.nav-drop {
  position: relative;
}

.nav-drop>summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
}

.nav-drop>summary::-webkit-details-marker {
  display: none;
}

.nav-drop .chev {
  width: 15px;
  height: 15px;
  transition: transform .2s;
}

.nav-drop[open]>summary {
  color: var(--ink);
}

.nav-drop[open] .chev {
  transform: rotate(180deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 196px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  padding: 7px;
  z-index: 60;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  transition: background .12s, color .12s;
}

.nav-menu a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-menu a.ativo {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}

/* Ações à direita da topbar (notificações + avatar + sair) — estilo CM School */
.topbar-acoes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.topbar-nav-sair {
  display: none;
}

/* o "Sair" da direita cobre o desktop; este é só p/ o menu mobile */
.topbar-ico {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition: background .14s, color .14s;
}

.topbar-ico:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.topbar-ico.ativo {
  color: var(--ink);
  background: var(--surface-2);
}

.topbar-ico svg {
  width: 20px;
  height: 20px;
}

.topbar-ico .notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  margin: 0;
}

.conta-link {
  display: inline-flex;
  align-items: center;
  border-radius: 50%;
  padding: 2px;
  text-decoration: none;
}

.conta-link.ativo {
  box-shadow: 0 0 0 2px var(--brand-1);
}

.topbar-tema {
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.topbar-tema .ico-sol {
  display: none;
}

[data-theme="dark"] .topbar-tema .ico-lua {
  display: none;
}

[data-theme="dark"] .topbar-tema .ico-sol {
  display: block;
}

/* ===== Caixa de busca no topo ===== */
.topbar-busca {
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-busca .ico-busca {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}

.topbar-busca input {
  width: 230px;
  max-width: 32vw;
  padding: 9px 14px 9px 38px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.topbar-busca input::placeholder {
  color: var(--faint);
}

.topbar-busca input:focus {
  border-color: var(--brand-1);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-50);
}

/* ===== Dropdown da conta (avatar) ===== */
.conta-drop>summary {
  padding: 3px 6px 3px 7px;
  gap: 4px;
  color: var(--muted);
}

.conta-drop .chev {
  width: 14px;
  height: 14px;
}

.conta-menu {
  min-width: 210px;
}

.conta-menu form {
  margin: 4px 0 0;
  padding-top: 5px;
  border-top: 1px solid var(--border);
}

.conta-menu form button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.conta-menu form button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* Busca: caixa só no desktop; no mobile é o link "Buscar" dentro do menu */
.nav-mobile-only {
  display: none;
}

@media (max-width: 860px) {
  .topbar-busca {
    display: none;
  }

  .topbar-nav .nav-mobile-only {
    display: block;
  }

  /* mantém o menu da conta flutuante mesmo no mobile (sobrepõe a regra genérica de .nav-drop/.nav-menu) */
  .topbar-acoes .conta-drop {
    position: relative;
  }

  .topbar-acoes .conta-drop .conta-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 210px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-3);
    padding: 7px;
  }
}

/* =================== Sidebar (admin) =================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 248px;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  overflow-y: auto;
  transition: transform .25s ease;
}

/* Tema verde da área de administração — sobrescreve a marca (roxa) só dentro da sidebar/topbar admin */
.sidebar,
.adm-topbar {
  --brand-1: #16a34a;
  --brand-100: rgba(22, 163, 74, .16);
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .adm-topbar {
  --brand-1: #22c55e;
  --brand-100: rgba(34, 197, 94, .22);
}

.sidebar-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--liga-font);
  font-weight: 700;
  font-size: 18px;
  color: var(--brand-1);
  text-decoration: none;
  padding: 6px 10px 18px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.sidebar-conta {
  flex: none;
}

/* link "Minha conta" no rodapé, logo acima do "Sair" — não estica */
.sidebar-group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--faint);
  padding: 16px 12px 6px;
}

/* Barra dividindo os grupos de assuntos da sidebar admin (Cursos / Geral / Comunidade) */
.sidebar-group:not(:first-of-type) {
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.sidebar-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sidebar-group svg {
  width: 13px;
  height: 13px;
  color: var(--faint);
  flex-shrink: 0;
}

.sidebar-voltar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-voltar svg {
  width: 16px;
  height: 16px;
}

.sidebar-voltar:hover {
  color: var(--ink);
}

.sidebar-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 14px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.sidebar-titulo svg {
  width: 18px;
  height: 18px;
  color: var(--brand-1);
  flex-shrink: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  transition: background .14s, color .14s;
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  color: var(--faint);
  transition: color .14s;
  flex-shrink: 0;
}

.sidebar-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.sidebar-nav a:hover svg {
  color: var(--brand-1);
}

.sidebar-nav a.ativo {
  background: var(--brand-100);
  color: var(--brand-1);
  font-weight: 600;
  border-left: 2px solid var(--brand-1);
}

.sidebar-nav a.ativo svg {
  color: var(--brand-1);
}

.sidebar-sair {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.sidebar-sair button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  transition: background .14s, color .14s;
}

.sidebar-sair button svg {
  width: 20px;
  height: 20px;
}

.sidebar-sair button:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Top bar do admin (só no mobile) */
.adm-topbar {
  display: none;
}

.sidebar-scrim {
  display: none;
}

/* Cabeçalho da sidebar: logo + botão de recolher */
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.sidebar-head .sidebar-logo {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Botões de recolher (na sidebar) e abrir (flutuante) — visíveis só no desktop */
.sidebar-fechar,
.sidebar-abrir {
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--r-sm);
  padding: 6px;
  transition: background .14s, color .14s;
}

.sidebar-fechar {
  margin-top: 4px;
}

.sidebar-fechar:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.sidebar-fechar svg,
.sidebar-abrir svg {
  width: 20px;
  height: 20px;
  display: block;
}

.sidebar-abrir {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-3);
}

.sidebar-abrir:hover {
  background: var(--surface-2);
}

/* Navegação principal agora é topbar horizontal — sem offset lateral */
.com-sidebar {
  padding-left: 0;
}

.com-sidebar .painel {
  padding-top: 30px;
}

/* Desktop: permite recolher a sidebar e libera a largura do conteúdo */
@media (min-width: 961px) {
  .sidebar-fechar {
    display: inline-flex;
  }

  html.sidebar-fechada .sidebar {
    transform: translateX(-100%);
  }

  html.sidebar-fechada .com-sidebar {
    padding-left: 0;
  }

  html.sidebar-fechada .sidebar-abrir {
    display: inline-flex;
  }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--sh-3);
  }

  .sidebar.aberto {
    transform: translateX(0);
  }

  .com-sidebar {
    padding-left: 0;
  }

  .adm-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .adm-topbar .topbar-logo {
    font-family: var(--liga-font);
    font-weight: 700;
    color: var(--brand-1);
  }

  .adm-topbar .sidebar-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--ink);
    padding: 4px;
  }

  .adm-topbar .sidebar-toggle svg {
    width: 24px;
    height: 24px;
  }

  .sidebar-scrim.visivel {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 45;
  }
}

/* =================== Conteúdo / página =================== */
.dashboard-content {
  padding: 40px 32px;
  display: flex;
  justify-content: center;
}

.page-box {
  width: 100%;
  max-width: 960px;
  background: var(--surface);
  padding: 30px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  border: 1px solid var(--border);
}

.page-box-form {
  max-width: 640px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 25px;
}

.muted {
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

/* Atalhos no dashboard */
.atalhos {
  margin-top: 22px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.atalho {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-width: 240px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .14s;
}

.atalho:hover {
  border-color: var(--brand-1);
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
}

.atalho-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  color: var(--brand-1);
  background: var(--brand-50);
}

.atalho-ico svg {
  width: 24px;
  height: 24px;
}

.atalho-txt {
  display: flex;
  flex-direction: column;
}

.atalho-txt strong {
  font-weight: 600;
}

.atalho-txt small {
  color: var(--muted);
  font-size: 13px;
}

/* Welcome */
.welcome-card {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  padding: 38px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  border: 1px solid var(--border);
}

.welcome-card h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.welcome-card p {
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.6;
}

.welcome-card .muted {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 14px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* =================== Painel (dashboard) =================== */
.painel {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 32px;
  width: 100%;
}

.painel-head h1 {
  font-size: 27px;
}

.painel-head p {
  margin-top: 4px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 22px 0 10px;
}

.kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}

/* minimal: tiles = número + rótulo, sem quadradinho de ícone */
.kpi-ico {
  display: none;
}

.kpi-ico svg {
  width: 24px;
  height: 24px;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-num {
  font-family: var(--liga-font);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-lbl {
  font-size: 13px;
  color: var(--muted);
}

.painel-sub {
  font-size: 16px;
  margin: 26px 0 14px;
  color: var(--ink);
}

.sub-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ver-todos {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-1);
  text-decoration: none;
}

.ver-todos svg {
  width: 15px;
  height: 15px;
  transition: transform .15s;
}

.ver-todos:hover svg {
  transform: translateX(3px);
}

.acoes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.acao-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--sh-1);
  transition: transform .16s, box-shadow .18s, border-color .18s;
}

.acao-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
  border-color: var(--border-strong);
}

.acao-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  color: var(--brand-1);
  background: var(--brand-50);
}

.acao-ico svg {
  width: 23px;
  height: 23px;
}

.acao-txt {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.acao-txt strong {
  font-weight: 600;
  font-size: 15px;
}

.acao-txt small {
  color: var(--muted);
  font-size: 13px;
}

.acao-seta {
  width: 18px;
  height: 18px;
  color: var(--faint);
  flex-shrink: 0;
  transition: transform .16s, color .16s;
}

.acao-card:hover .acao-seta {
  color: var(--brand-1);
  transform: translateX(3px);
}

/* =================== Tabelas =================== */
.tabela-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tabela thead {
  background: var(--surface-2);
}

.tabela th {
  text-align: left;
  padding: 13px 16px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}

.tabela td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.tabela tbody tr:last-child td {
  border-bottom: none;
}

.tabela tbody tr {
  transition: background .12s;
}

.tabela tbody tr:hover {
  background: var(--surface-2);
}

.tabela .vazio {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

/* Filtros acima da tabela (admin cursos) */
.tbl-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
}

.tbl-busca,
.tbl-select {
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
}

.tbl-busca {
  flex: 1;
  min-width: 220px;
}

.tbl-select {
  cursor: pointer;
}

.tbl-busca:focus,
.tbl-select:focus {
  outline: none;
  border-color: var(--brand-1);
}

/* Célula do curso: thumbnail + nome */
.tc-curso {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--surface-2) center/cover no-repeat;
}

.tc-nome {
  font-weight: 600;
  color: var(--ink);
}

/* Badge de status */
.tc-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.tc-badge.pub {
  background: var(--success-bg);
  color: var(--success);
}

.tc-badge.rasc {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Ações da linha */
.tc-acoes {
  white-space: nowrap;
  text-align: right;
}

.tc-link {
  color: var(--brand-1);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
}

.tc-link + .tc-link {
  margin-left: 16px;
}

.tc-link:hover {
  text-decoration: underline;
}

/* <button class="tc-link"> (ação que precisa de POST) fica igual ao link: sem o fundo cinza do navegador. */
button.tc-link {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

/* Formulários de ação (desativar, excluir) ficam na linha, com o mesmo respiro entre as ações. */
.tc-acoes form {
  display: inline;
  margin-left: 16px;
}

.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.tag-admin {
  background: #ede9fe;
  color: #6d28d9;
}

.tag-aluno {
  background: var(--info-bg);
  color: var(--info);
}

/* Ações em tabela */
.col-acoes {
  width: 1%;
  white-space: nowrap;
}

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

.acoes form {
  margin: 0;
}

.btn-acao {
  display: inline-block;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--brand-1);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}

.btn-acao:hover {
  background: var(--brand-50);
  border-color: var(--brand-1);
}

.btn-acao-perigo {
  color: var(--danger);
}

.btn-acao-perigo:hover {
  background: var(--danger-bg);
  border-color: var(--danger-bd);
}

.voce {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.link-curso {
  color: var(--brand-1);
  text-decoration: none;
  font-weight: 600;
}

.link-curso:hover {
  text-decoration: underline;
}

/* =================== Alertas (fallback) =================== */
.alert-erro {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-bd);
  color: var(--erro-ink);
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-sucesso {
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  color: var(--success);
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}

/* =================== Form helpers =================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bloco-senha {
  margin: 6px 0 18px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.bloco-titulo {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* =================== Cards de curso =================== */
.cards-cursos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.card-curso {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow .18s, transform .16s, border-color .18s;
}

.card-curso:hover {
  box-shadow: var(--sh-3);
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.card-capa {
  position: relative;
  height: 134px;
  background: var(--surface-2);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--brand-1);
}

.card-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--sh-1);
}

.card-status.pub {
  background: var(--success-bg);
  color: var(--success);
}

.card-status.rasc {
  background: var(--warning-bg);
  color: var(--warning);
}

.card-corpo {
  padding: 16px 18px 18px;
}

.card-corpo h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.card-preco {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-1);
  margin-bottom: 14px;
}

.card-acoes {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* =================== Hub do aluno (Meus cursos) =================== */
.hub-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hub-stat {
  font-size: 14px;
  color: var(--muted);
}

.hub-stat strong {
  color: var(--ink);
  font-weight: 700;
  font-family: var(--liga-font);
}

.estado-vazio {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.estado-vazio svg {
  width: 54px;
  height: 54px;
  color: var(--faint);
  margin-bottom: 12px;
}

.estado-vazio h3 {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 6px;
}

.estado-vazio p {
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

.cursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(282px, 1fr));
  gap: 18px;
}

.curso-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--sh-1);
  transition: transform .16s, box-shadow .18s, border-color .18s;
}

.curso-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  border-color: var(--border-strong);
}

.curso-capa {
  position: relative;
  height: 152px;
  background: var(--surface-2);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.curso-capa .ph {
  width: 46px;
  height: 46px;
  color: #818cf8;
}

.curso-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  box-shadow: var(--sh-1);
}

.status-done {
  color: var(--success);
}

.status-prog {
  color: var(--brand-1);
}

.status-new {
  color: var(--muted);
}

.curso-corpo {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.curso-corpo h3 {
  font-size: 16px;
  line-height: 1.35;
}

.curso-prog {
  display: flex;
  align-items: center;
  gap: 11px;
}

.curso-prog .barra-progresso {
  flex: 1;
  margin: 0;
}

.curso-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-1);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

.curso-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 2px;
}

.curso-aulas {
  font-size: 13px;
  color: var(--muted);
}

.curso-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-1);
}

.curso-cta svg {
  width: 15px;
  height: 15px;
  transition: transform .16s;
}

.curso-card:hover .curso-cta svg {
  transform: translateX(3px);
}

.prog-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.curso-card-static:hover {
  transform: none;
  box-shadow: var(--sh-1);
  border-color: var(--border);
}

.trilha-capa {
  background: var(--surface-2) !important;
}

.trilha-capa .ph {
  color: var(--brand-1);
}

/* =================== Gestão do curso =================== */
.secao-titulo {
  font-size: 18px;
  margin: 28px 0 14px;
}

.secao-titulo-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secao-titulo-linha .secao-titulo {
  margin: 0;
}

.form-inline {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.form-inline input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}

.form-inline input:focus {
  outline: none;
  border-color: var(--brand-1);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(81, 60, 250, .12);
}

.modulo {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 16px;
  background: var(--surface);
}

.modulo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modulo-head h3 {
  font-size: 16px;
}

.lista-aulas {
  list-style: none;
  margin: 0 0 12px;
}

.lista-aulas li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Precisa quebrar linha: o .trocar-video usa flex-basis:100% para ocupar
     uma linha só dele. Sem o wrap ele fica na mesma linha e espreme o
     título e os botões da aula. */
  flex-wrap: wrap;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  font-size: 14px;
  background: var(--surface-2);
}

.aula-info {
  display: flex;
  align-items: center;
  gap: 9px;
}

.aula-vazia {
  color: var(--muted);
  font-style: italic;
  border-style: dashed !important;
  background: transparent !important;
}

.btn-link-perigo {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
}

.btn-link-perigo:hover {
  text-decoration: underline;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-1);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Título editável com dois cliques (módulos e itens do curso) */
.editavel {
  cursor: text;
  border-radius: 4px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background .15s;
}

.editavel:hover {
  background: var(--brand-100);
}

.editar-inline {
  font: inherit;
  color: var(--ink);
  width: min(320px, 60vw);
  max-width: 100%;
  padding: 2px 7px;
  border: 1.5px solid var(--brand-1);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.editar-inline:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(81, 60, 250, .14);
}

.add-aula summary,
.add-questao summary {
  cursor: pointer;
  color: var(--brand-1);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 0;
  list-style: none;
}

.add-aula summary::-webkit-details-marker,
.add-questao summary::-webkit-details-marker {
  display: none;
}

.add-questao summary {
  font-size: 15px;
}

.add-questao {
  margin-top: 18px;
}

.form-aula,
.form-questao {
  margin-top: 12px;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.form-aula .campo,
.form-questao .campo {
  margin-bottom: 14px;
}

.select-tipo {
  width: 100%;
  padding: 12px 15px;
  font-size: 15px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-family: inherit;
  cursor: pointer;
}

.select-tipo:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(81, 60, 250, .12);
}

/* =================== Métricas (relatórios) =================== */
.filtros-relatorio {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}

.filtros-relatorio .campo {
  margin: 0;
}

.filtros-relatorio input[type="date"] {
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
}

.metricas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.metrica {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-align: center;
  background: var(--surface);
}

.metrica-num {
  display: block;
  font-family: var(--liga-font);
  font-size: 34px;
  font-weight: 700;
  color: var(--brand-1);
  font-variant-numeric: tabular-nums;
}

.metrica-lbl {
  font-size: 13px;
  color: var(--muted);
}

/* =================== Materiais =================== */
.form-material {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.form-material input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
}

.form-material input[type="file"] {
  font-size: 13px;
}

.lista-materiais {
  list-style: none;
}

.lista-materiais li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  font-size: 14px;
  background: var(--surface-2);
}

.lista-materiais small {
  font-weight: 400;
}

.side-materiais {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.side-materiais h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.side-materiais ul {
  list-style: none;
}

.side-materiais li {
  margin-bottom: 6px;
}

.side-materiais a {
  color: var(--brand-1);
  text-decoration: none;
  font-size: 14px;
}

.side-materiais a:hover {
  text-decoration: underline;
}

/* =================== Chips =================== */
.chips-cat {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  background: var(--surface-2);
  transition: border-color .15s, background .15s;
}

.chip-cat input {
  cursor: pointer;
}

.chip-cat:hover {
  border-color: var(--brand-1);
  background: var(--brand-50);
}

.filtro-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip-filtro {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}

.chip-filtro:hover {
  border-color: var(--brand-1);
  color: var(--brand-1);
}

.chip-filtro.ativo {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh-brand);
}

.lista-trilha {
  margin: 8px 0 0;
  list-style: none;
  counter-reset: trilha;
}

.lista-trilha li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  font-size: 14px;
  background: var(--surface-2);
}

.lista-trilha li::before {
  counter-increment: trilha;
  content: counter(trilha);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 700;
  font-size: 12px;
}

.lista-trilha li>.trilha-curso-nome {
  flex: 1;
}

/* =================== Avaliação =================== */
.bloco-config {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
}

.questao {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 14px;
  background: var(--surface);
}

.questao-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.questao-head h3 {
  font-size: 16px;
}

.lista-alts {
  list-style: none;
  margin-top: 10px;
}

.card-preview-admin {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.card-preview-lado {
  flex: 1;
  min-width: 0;
}

.card-preview-lado img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: block;
}

.card-preview-lado p {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.lista-alts li {
  padding: 8px 13px;
  border-radius: var(--r-sm);
  margin-bottom: 5px;
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.lista-alts li.correta {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
  border-color: var(--success-bd);
}

/* Ordem correta das questões de embaralhamento/ranking (editor e revisão). */
.lista-ordem {
  list-style: decimal inside;
}

.bloco-vf {
  margin-bottom: 14px;
}

.vf-opcoes {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.alt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.alt-row input[type="text"] {
  flex: 1;
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}

.alt-row input[type="text"]::placeholder {
  color: var(--faint);
}

.alt-check {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--brand-1);
}

/* Prova (aluno) */
.questao-aluno {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  background: var(--surface);
}

.q-enunciado {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--ink);
}

.q-dica {
  font-size: 12px;
  color: var(--brand-1);
  margin-bottom: 10px;
}

/* Destaque neon reutilizável — toda atividade nova aplica a classe
   campo-destaque na sua caixa de resposta e herda isto automaticamente.
   :hover/:focus/:focus-within cobrem mouse, teclado e clique; uma classe de
   estado aplicada via JS cobre interações que não passam pelo foco do
   navegador — bloco-escolhido enquanto arrasta um bloco de ordenação,
   conectar-ativo enquanto desenha a linha (origem) ou paira sobre um alvo
   válido (destino) no Conectar. */
.campo-destaque {
  transition: border-color .16s, box-shadow .16s;
}

.campo-destaque:hover,
.campo-destaque:focus,
.campo-destaque:focus-within,
.campo-destaque.bloco-escolhido,
.campo-destaque.conectar-ativo {
  border-color: var(--neon-edge);
  box-shadow:
    0 0 0 1px var(--neon-edge),
    0 0 14px 2px var(--neon-glow-1),
    0 0 30px 8px var(--neon-glow-2);
}

.alt-opcao {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14px;
}

.alt-opcao input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-1);
}

/* Blocos arrastáveis (embaralhamento / ranking) */
.blocos-ordem {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.blocos-ordem.em-linha {
  flex-wrap: wrap;
}

.blocos-ordem.empilhado {
  flex-direction: column;
}

.blocos-ordem li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px;
  cursor: grab;
  touch-action: none; /* sem isto o toque rola a página em vez de arrastar */
  transition: border-color .16s, box-shadow .16s;
}

.blocos-ordem li:active {
  cursor: grabbing;
}

.blocos-ordem.empilhado li {
  justify-content: space-between;
}

/* Botões ↑/↓ (←/→) criados pelo ordenar-atividade.js: alternativa ao arrastar pelo teclado. */
.bloco-mover-grupo {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.bloco-mover {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.bloco-mover:hover:not(:disabled) {
  border-color: var(--neon-edge);
}

.bloco-mover:focus-visible {
  outline: 2px solid var(--neon-edge);
  outline-offset: 2px;
}

.bloco-mover:disabled {
  opacity: .35;
  cursor: default;
}

/* Avisos só para leitor de tela (resultado de mover bloco / ligar par pelo teclado). */
.blocos-ordem-status,
.conectar-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Escala Likert */
.likert {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  align-items: stretch;
}

.likert-ponto {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: center;
}

.likert-num {
  font-weight: 700;
  font-size: 15px;
}

.likert-rotulo {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.25;
}

/* Em tela estreita, 5 caixas lado a lado espremem o rótulo até ficar ilegível.
   A escala vira uma coluna: número à esquerda, rótulo ao lado. */
@media (max-width: 560px) {
  .likert {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .likert-ponto {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    text-align: left;
  }

  .likert-rotulo {
    font-size: 13px;
  }
}

/* Conectar (pareamento conceito × descrição) */
.conectar-wrap {
  position: relative;
  display: flex;
  gap: 32px;
  margin-top: 4px;
}

.conectar-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.conectar-linha {
  stroke: var(--success);
  stroke-width: 2;
  stroke-linecap: round;
}

.conectar-linha-temp {
  stroke: var(--muted);
  stroke-dasharray: 5 4;
}

.conectar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.conectar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
  touch-action: none; /* sem isto o toque rola a página em vez de arrastar a linha */
}

.conectar-col-desc .conectar-item {
  cursor: pointer; /* recebe a linha arrastada ou o clique depois de escolher o conceito */
}

/* Conceito escolhido no modo clique/teclado (conectar-atividade.js), à espera da descrição. */
.conectar-item.conectar-selecionado {
  background: var(--surface-2);
  outline: 2px dashed var(--neon-edge);
  outline-offset: 3px;
}

.conectar-texto {
  flex: 1;
  min-width: 0;
}

.conectar-ancora {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  transition: background .14s, border-color .14s;
}

.conectar-item.pareado .conectar-ancora {
  background: var(--success);
  border-color: var(--success);
}

.conectar-contador {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 620px) {
  .conectar-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .conectar-col-desc .conectar-item {
    flex-direction: row-reverse;
  }
}

/* Distribuição de respostas no relatório da atividade */
.dist-linha {
  display: grid;
  grid-template-columns: minmax(90px, 1.4fr) 3fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
}

.dist-rotulo {
  color: var(--faint);
  overflow-wrap: anywhere;
}

.dist-rotulo.correta {
  color: var(--success);
  font-weight: 600;
}

.dist-barra {
  height: 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dist-preenchida {
  display: block;
  height: 100%;
  background: var(--brand-1);
}

.dist-preenchida.ok { background: var(--success); }
.dist-preenchida.fail { background: var(--danger); }

.dist-valor {
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Células da tabela aluno × questão */
.cel-ok { color: var(--success); font-weight: 700; text-align: center; }
.cel-fail { color: var(--danger); font-weight: 700; text-align: center; }
.cel-neutra { text-align: center; }

@media (max-width: 560px) {
  .dist-linha {
    grid-template-columns: 1fr auto;
  }

  .dist-barra {
    grid-column: 1 / -1;
  }
}

/* Badge da fila de correção no menu do admin */
.badge-pendentes {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Contador de caracteres da dissertativa */
.contador-texto {
  text-align: right;
  margin-top: 4px;
}

.contador-texto.no-limite {
  color: var(--danger);
  font-weight: 600;
}

/* Carrossel de Cards interativos (frente/verso com imagem) */
.cards-carrossel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 8px 0 24px;
}

.cards-enunciado {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  margin: 0;
  max-width: 420px;
}

.cards-deck {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 420px;
}

.card-slide {
  position: absolute;
  inset: 0;
  transform: translate(0, 0) scale(1);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: transform .4s cubic-bezier(.22, .9, .32, 1), opacity .3s ease;
}

.card-slide.eh-atual {
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

.card-slide.eh-proximo {
  opacity: .85;
  transform: translate(16px, 16px) scale(.94);
  z-index: 2;
}

.card-slide.eh-proximo2 {
  opacity: .5;
  transform: translate(30px, 30px) scale(.89);
  z-index: 1;
}

.card-flip3d {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4, .2, .2, 1);
}

.card-flip3d.virado {
  transform: rotateY(180deg);
}

.card-face-3d {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border-radius: 22px;
  backface-visibility: hidden;
  color: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .2);
  overflow: hidden;
  text-align: center;
}

.card-face-3d img {
  max-width: 65%;
  max-height: 50%;
  object-fit: contain;
  margin-bottom: 16px;
  pointer-events: none;
}

.card-face-verso {
  transform: rotateY(180deg);
}

.card-legenda {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.card-rodape {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  opacity: .85;
}

.card-rodape svg {
  width: 18px;
  height: 18px;
}

.card-autoaval {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.card-autoaval .btn-acao {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
}

.card-autoaval .btn-acao.escolhido {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
  font-weight: 700;
}

/* Paleta rotativa por posição — sem o professor escolher cor manualmente */
.card-cor-0 .card-face-3d { background: linear-gradient(155deg, #d1615e, #b1443f); }
.card-cor-1 .card-face-3d { background: linear-gradient(155deg, #9c6b52, #7c5038); }
.card-cor-2 .card-face-3d { background: linear-gradient(155deg, #dfab3f, #bd8a24); }
.card-cor-3 .card-face-3d { background: linear-gradient(155deg, #4f8f8a, #386e69); }
.card-cor-4 .card-face-3d { background: linear-gradient(155deg, #5b6fa8, #414d84); }

.cards-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cards-seta {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .14s, color .14s;
}

.cards-seta svg {
  width: 20px;
  height: 20px;
}

.cards-seta:hover {
  background: var(--brand-100);
  color: var(--brand-1);
}

.cards-seta-next {
  background: var(--brand-1);
  color: #fff;
}

.cards-seta-next:hover {
  background: var(--brand-700);
  color: #fff;
}

.cards-seta:disabled {
  opacity: .35;
  cursor: default;
}

.cards-seta:disabled:hover {
  background: var(--surface-2);
  color: var(--muted);
}

.cards-seta-next:disabled:hover {
  background: var(--brand-1);
  color: #fff;
}

.cards-pontos {
  display: flex;
  gap: 8px;
}

.cards-ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border-strong);
  cursor: pointer;
  padding: 0;
  transition: background .14s, transform .14s;
}

.cards-ponto.ativo {
  background: var(--brand-1);
  transform: scale(1.3);
}

@media (max-width: 460px) {
  .cards-deck {
    height: 360px;
  }
}

/* Resposta dissertativa do aluno, na tela de correção e na revisão.
   `pre-wrap` preserva os parágrafos que o aluno escreveu. */
.resposta-aluno {
  white-space: pre-wrap;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.6;
}

/* Resposta dissertativa */
textarea.dissertativa {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

/* Revisão das respostas */
.revisao-box {
  margin-top: 18px;
}

.revisao-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  background: var(--surface);
}

.revisao-item.ok {
  border-left-color: var(--success);
}

.revisao-item.erro {
  border-left-color: var(--danger);
}

.revisao-marca {
  font-weight: 700;
  margin-right: 4px;
}

.revisao-item.ok .revisao-marca {
  color: var(--success);
}

.revisao-item.erro .revisao-marca {
  color: var(--danger);
}

/* Questão sem gabarito: não tem certo nem errado, então não ganha cor de acerto. */
.revisao-item.neutra {
  border-left-color: var(--border-strong);
}

.revisao-item.neutra .revisao-marca {
  color: var(--faint);
}

/* Prazo de envio no cabeçalho da atividade. Destacado de propósito: perder o prazo
   é irreversível, então não pode ficar com a mesma cara de um texto auxiliar. */
.prazo-aviso {
  margin-top: 4px;
  color: var(--danger);
  font-weight: 500;
}

/* Correção manual de uma dissertativa (nota + comentário do professor) */
.correcao-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--brand-1);
  background: var(--brand-50);
  border-radius: var(--r-sm);
}

.correcao-nota {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-1);
}

.revisao-colunas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.revisao-rotulo {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* Resultado */
.resultado-ico {
  margin-bottom: 12px;
  color: var(--faint);
}

.resultado-ico svg {
  width: 54px;
  height: 54px;
}

.resultado-ico.ok {
  color: var(--brand-1);
}

.nota-grande {
  font-family: var(--liga-font);
  font-size: 58px;
  font-weight: 700;
  margin: 10px 0 4px;
  font-variant-numeric: tabular-nums;
}

.nota-grande.ok {
  color: var(--success);
}

.nota-grande.fail {
  color: var(--danger);
}

.medalha {
  display: inline-block;
  padding: 5px 14px;
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

/* Comparativo pré × final (evolução) */
.comparativo {
  margin: 24px auto 4px;
  max-width: 360px;
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.comparativo-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

.comparativo-barras {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}

.comp-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 84px;
}

.comp-bar {
  width: 46px;
  height: 110px;
  border-radius: var(--r-sm);
  background: var(--border);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.comp-fill {
  width: 100%;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: height .5s ease;
  min-height: 4px;
}

.comp-pre {
  background: var(--faint);
}

.comp-fim {
  background: var(--brand-1);
}

.comp-valor {
  font-family: var(--liga-font);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.comp-rotulo {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.comp-seta {
  font-size: 22px;
  color: var(--faint);
  padding-bottom: 40px;
}

.comp-delta {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.comp-delta.ok {
  color: var(--success);
}

/* Desempenho */
.resumo-medalhas {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 22px;
}

.medalha-grande {
  font-size: 38px;
}

.resumo-medalhas div {
  display: flex;
  flex-direction: column;
}

.resumo-medalhas strong {
  font-size: 17px;
  color: var(--ink);
}

.resumo-medalhas small {
  color: var(--muted);
}

/* Desempenho — cards por curso */
.curso-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.curso-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-1);
}

.cc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cc-titulo {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
}

.cc-titulo:hover {
  color: var(--brand-1);
}

.cc-prog {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cc-prog .barra-progresso {
  margin: 0;
}

.cc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.cc-stat-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--faint);
}

.cc-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cc-stat-val.vazio {
  color: var(--faint);
  font-weight: 600;
}

.cc-stat-sub {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
}

.cc-evo {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cc-evo-pre {
  color: var(--faint);
}

.cc-evo-seta {
  color: var(--faint);
}

.cc-evo-fim {
  color: var(--brand-1);
}

.cc-evo-delta {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.cc-evo-delta.ok {
  color: var(--success);
}

.cc-acoes {
  display: flex;
  gap: 8px;
}

.cc-acoes .btn-acao {
  flex: 1;
  text-align: center;
}

/* =================== Barra de progresso =================== */
.barra-progresso {
  height: 9px;
  background: #e6e9f2;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.barra-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 999px;
  transition: width .4s ease;
}

/* =================== Player =================== */
.player-wrap {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px;
}

.player-main {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sh-2);
  border: 1px solid var(--border);
}

.player-topo {
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.player-topo h1 {
  font-size: 23px;
  margin: 8px 0;
}

.aula-titulo {
  font-size: 19px;
  margin-bottom: 16px;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #0b1020;
  margin-bottom: 20px;
  box-shadow: var(--sh-2);
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-frame video {
  object-fit: contain;
  background: #000;
}

.aula-conteudo {
  white-space: pre-wrap;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 20px;
}

.aula-acoes {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Anotações do aluno (dentro do player-main) */
.anotacoes {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.anot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.anot-head h3 {
  font-size: 15px;
  margin: 0;
}

.anot-status {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color .15s;
}

.anot-status.ok {
  color: var(--success);
}

.anot-status.erro {
  color: var(--danger);
}

.anot-dica {
  font-size: 12.5px;
  color: var(--muted);
  margin: 5px 0 12px;
}

.anot-texto {
  width: 100%;
  height: 150px;
  resize: none;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.anot-texto:focus {
  outline: none;
  border-color: var(--brand-1);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(81, 60, 250, .12);
}

.anot-texto::placeholder {
  color: var(--faint);
}

.modulo-acoes {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.drag-handle,
.modulo-handle {
  cursor: grab;
  color: var(--faint);
  user-select: none;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1;
}

.drag-handle:active,
.modulo-handle:active {
  cursor: grabbing;
}

.sortable-ghost {
  opacity: .4;
}

.sortable-chosen {
  box-shadow: var(--sh-2);
}

.modulo-head h3 {
  margin-right: auto;
}

.lista-aulas li .aula-info {
  margin-right: auto;
}

.aviso-box {
  padding: 16px;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-bd);
  border-radius: var(--r-md);
  margin-bottom: 18px;
}

.player-side {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-2);
  border: 1px solid var(--border);
  align-self: start;
  position: sticky;
  top: 24px;
}

.player-side h3 {
  font-size: 15px;
  margin-bottom: 14px;
}

/* Menu de conteúdo — trilha (timeline) */
.mod-bloco {
  margin-bottom: 6px;
  padding: 4px;
  border-radius: var(--r-md);
  transition: background .15s;
}

.mod-bloco.mod-atual {
  background: var(--surface-2);
}

.mod-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
}

.mod-anel {
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: conic-gradient(var(--brand-1) calc(var(--pct, 0) * 1%), var(--border-strong) 0);
  display: grid;
  place-items: center;
  color: var(--brand-1);
}

.mod-anel::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--surface);
}

.mod-bloco.mod-atual .mod-anel::before {
  background: var(--surface-2);
}

.mod-anel.completo {
  background: var(--brand-1);
  color: #fff;
}

.mod-anel.completo::before {
  display: none;
}

.mod-pct {
  position: relative;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.mod-anel svg {
  position: relative;
  width: 15px;
  height: 15px;
}

.mod-titulo {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.mod-trilha {
  list-style: none;
  position: relative;
  margin: 2px 0 6px 16px;
  padding: 0;
}

.mod-trilha::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border);
}

.trilha-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 8px 7px 0;
}

.trilha-ponto {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--faint);
  display: grid;
  place-items: center;
  color: #fff;
  transition: border-color .14s, background .14s, box-shadow .14s;
}

.mod-bloco.mod-atual .trilha-ponto {
  background: var(--surface-2);
}

.trilha-item.feito .trilha-ponto {
  background: var(--brand-1);
  border-color: var(--brand-1);
}

.trilha-item.feito .ponto-check {
  width: 10px;
  height: 10px;
}

.trilha-item.ativo .trilha-ponto {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px var(--brand-50);
}

.trilha-item.travado .trilha-ponto {
  border-color: var(--border-strong);
}

.trilha-nome {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  transition: color .12s;
}

a.trilha-nome:hover {
  color: var(--ink);
}

.trilha-item.feito .trilha-nome {
  color: var(--muted);
}

.trilha-item.ativo .trilha-nome {
  color: var(--brand-1);
  font-weight: 600;
}

.trilha-travado {
  color: var(--faint);
  cursor: not-allowed;
}

.quiz-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: var(--brand-1);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--sh-brand);
  transition: filter .15s, transform .05s;
}

.quiz-pill:hover {
  filter: brightness(1.08);
}

.quiz-pill:active {
  transform: translateY(1px);
}

.quiz-pill svg {
  width: 14px;
  height: 14px;
}

.aula-ico {
  font-size: 14px;
}

.side-avaliacao {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.aval-bloqueada {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--r-sm);
  text-align: center;
}

/* =================== Responsivo =================== */
@media (max-width: 860px) {
  .player-wrap {
    grid-template-columns: 1fr;
  }

  .player-side {
    order: -1;
    position: static;
  }
}

@media (max-width: 860px) {
  .topbar {
    padding: 12px 18px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .topbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--sh-2);
    padding: 12px 16px;
  }

  .topbar-nav.aberto {
    display: flex;
  }

  .topbar-nav>a,
  .nav-drop>summary {
    padding: 11px 12px;
  }

  .nav-drop {
    position: static;
  }

  .nav-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 2px 0 2px 12px;
    min-width: 0;
    margin-top: 4px;
    border-left: 2px solid var(--border);
  }

  .topbar-nav form {
    margin: 6px 0 0;
  }

  .topbar-sair-desktop {
    display: none;
  }

  /* no mobile o "Sair" vai p/ dentro do menu */
  .topbar-nav-sair {
    display: block;
  }

  .topbar-nav form.btn-sair,
  .topbar-nav .btn-sair {
    width: 100%;
  }

  .dashboard-content {
    padding: 24px 16px;
  }

  .painel {
    padding: 24px 16px;
  }

  .page-box {
    padding: 22px 18px;
  }
}

@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
  }

  .form-inline {
    flex-direction: column;
  }

  .atalho {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 880px) {
  .login-page {
    padding: 20px;
  }
}

/* =================== Modo escuro =================== */
[data-theme="dark"] {
  --brand-1: #6d5cff;
  --brand-2: #6d5cff;
  --brand-700: #b3a8ff;
  --brand-50: rgba(109, 92, 255, .12);
  --brand-100: rgba(109, 92, 255, .22);
  --grad: #6d5cff;

  --ink: #ffffff;
  --text: #a5aab8;
  --muted: #7a7f8e;
  --faint: #5a5f6e;
  --bg: #0e0f13;
  --surface: #16171d;
  --surface-2: #2a2c36;
  --border: rgba(255, 255, 255, .07);
  --border-strong: #343744;

  --neon-edge: rgba(255, 255, 255, .95);
  --neon-glow-1: rgba(255, 255, 255, .45);
  --neon-glow-2: rgba(255, 255, 255, .18);

  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, .12);
  --success-bd: rgba(34, 197, 94, .28);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, .12);
  --warning-bd: rgba(245, 158, 11, .28);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, .12);
  --danger-bd: rgba(239, 68, 68, .28);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, .16);
  --erro-ink: #f87171;

  --sh-1: none;
  /* minimal: no dark, cards se destacam pelo tom */
  --sh-2: 0 6px 16px -4px rgba(0, 0, 0, .4);
  --sh-3: 0 16px 36px -12px rgba(0, 0, 0, .5);
  --shadow: var(--sh-3);
}

/* Ajustes de componentes com cores fixas (claras) no modo escuro */
[data-theme="dark"] .topbar,
[data-theme="dark"] .adm-topbar {
  background: rgba(14, 15, 19, .85);
}

[data-theme="dark"] .card-capa,
[data-theme="dark"] .curso-capa {
  background-image: none;
  background-color: #1e202a;
}

[data-theme="dark"] .trilha-capa {
  background: #1e202a !important;
}

[data-theme="dark"] .metrica,
[data-theme="dark"] .resumo-medalhas {
  background: #16171d;
}

[data-theme="dark"] .curso-status {
  background: #121317;
}

[data-theme="dark"] .tag-admin {
  background: rgba(124, 58, 237, .24);
  color: #c4b5fd;
}

/* SweetAlert2 no escuro */
[data-theme="dark"] .swal2-popup {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .swal2-title {
  color: var(--ink);
}

[data-theme="dark"] .swal2-html-container {
  color: var(--text);
}

/* Modal de denúncia (SweetAlert2 com campos do app) */
.den-popup {
  border-radius: var(--r-lg);
  padding: 26px 26px 22px;
}

.den-popup .swal2-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  padding: 0 0 4px;
}

.den-html.swal2-html-container {
  margin: 14px 0 4px;
}

.den-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.den-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 8px;
}

.den-opc {
  color: var(--faint);
  font-weight: 500;
}

.den-campo {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}

.den-campo:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px var(--brand-50);
}

.den-textarea {
  min-height: 96px;
  resize: none;
}

.den-actions.swal2-actions {
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* Botão de alternar tema (sol/lua) */
.tema-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  transition: background .14s, color .14s;
}

.tema-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.tema-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tema-btn .ico-sol,
.tema-btn .t-claro {
  display: none;
}

[data-theme="dark"] .tema-btn .ico-sol,
[data-theme="dark"] .tema-btn .t-claro {
  display: inline;
}

[data-theme="dark"] .tema-btn .ico-lua,
[data-theme="dark"] .tema-btn .t-escuro {
  display: none;
}

/* Toggle flutuante no login */
.tema-flutua {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  box-shadow: var(--sh-1);
}

.tema-flutua:hover {
  color: var(--brand-1);
}

.tema-flutua svg {
  width: 20px;
  height: 20px;
}

.tema-flutua .ico-sol {
  display: none;
}

[data-theme="dark"] .tema-flutua .ico-sol {
  display: block;
}

[data-theme="dark"] .tema-flutua .ico-lua {
  display: none;
}

/* Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* =================== Quiz por vídeo =================== */
.quiz-barra {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  flex-wrap: wrap;
}

/* Botão Quiz flutuando no canto superior direito do vídeo */
.player-video {
  position: relative;
}

.quiz-flutua {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}

.btn-quiz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--r-md);
  background: var(--brand-1);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--sh-brand);
  transition: filter .15s, transform .05s;
}

.btn-quiz:hover {
  filter: brightness(1.07);
}

.btn-quiz:active {
  transform: translateY(1px);
}

.btn-quiz svg {
  width: 18px;
  height: 18px;
}

.quiz-contagem {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quiz-dica {
  font-size: 13px;
}

/* Modal */
.quiz-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.quiz-modal[hidden] {
  display: none;
}

.quiz-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
}

.quiz-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 28px 26px;
}

.quiz-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .14s, color .14s;
}

.quiz-x:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.quiz-passo {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--faint);
}

.quiz-enunciado {
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
  margin: 8px 0 18px;
  padding-right: 24px;
}

.quiz-alts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}

.quiz-alt:hover:not(:disabled) {
  border-color: var(--brand-1);
  background: var(--brand-50);
  color: var(--ink);
}

.quiz-alt:disabled {
  cursor: default;
}

.quiz-alt.correta {
  border-color: var(--success-bd);
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
}

.quiz-alt.errada {
  border-color: var(--danger-bd);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
}

.quiz-alt.inativa {
  opacity: .55;
}

.quiz-marca {
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-feedback {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
}

.quiz-feedback[hidden] {
  display: none;
}

.quiz-feedback.ok {
  color: var(--success);
}

.quiz-feedback.erro {
  color: var(--danger);
}

.quiz-acoes {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}

.quiz-resumo {
  text-align: center;
  padding: 10px 0;
}

.quiz-resumo-ico {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
}

.quiz-resumo h3 {
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 6px;
}

.quiz-resumo-nota {
  color: var(--muted);
  margin-bottom: 6px;
}

.quiz-resumo .quiz-acoes {
  justify-content: center;
}

/* =================== Minha conta =================== */
.conta-id {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.conta-avatar-form {
  margin: 0;
}

.conta-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.conta-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conta-avatar .avatar-iniciais {
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-100);
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.conta-avatar-edit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  box-shadow: var(--sh-2);
}

.conta-nome {
  font-size: 20px;
  margin: 0;
}

/* Botão de tema dentro da página Minha conta (não full-width como na sidebar) */
.tema-btn-conta {
  width: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

/* Avatar nos menus (sidebar/topo) */
.menu-avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

.menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =================== Trilha (linha do tempo) =================== */
.trilha-linha {
  position: relative;
  max-width: 820px;
  margin: 28px auto 8px;
}

/* Linha reta (usada só no mobile — no desktop fica escondida e o SVG em S assume). */
.trilha-track {
  display: none;
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: var(--border);
  border-radius: 3px;
}

.trilha-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: #16a34a;
  border-radius: 3px;
  transition: height .3s ease;
}

/* Curva em S (desktop) — trilho cinza + progresso verde ao longo do caminho. */
.trilha-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.trilha-svg-track,
.trilha-svg-fill {
  fill: none;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

.trilha-svg-track {
  stroke: var(--border);
}

.trilha-svg-fill {
  stroke: #16a34a;
  stroke-dasharray: 1;
  transition: stroke-dashoffset .3s ease;
}

/* cada passo tem altura FIXA → nós igualmente espaçados; nó e caixa posicionados em relação ao passo */
.trilha-passo {
  position: relative;
  height: 112px;
}

.trilha-no {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* nós acompanham a curva: levemente para os lados (mesmo lado da caixa), dentro do canal central */
.trilha-passo.lado-esq .trilha-no {
  left: 44%;
}

.trilha-passo.lado-dir .trilha-no {
  left: 56%;
}

.trilha-passo.feito .trilha-no {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.trilha-box {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--sh-2);
  transition: border-color .14s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.trilha-passo.lado-esq .trilha-box {
  left: 0;
}

.trilha-passo.lado-dir .trilha-box {
  right: 0;
}

.trilha-box:hover {
  border-color: var(--brand-1);
}

.trilha-box-txt {
  flex: 1;
  min-width: 0;
}

.trilha-box-capa {
  flex-shrink: 0;
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}

.trilha-box-titulo {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
}

.trilha-box-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.trilha-cert {
  text-align: center;
  margin: 20px 0 40px;
}

@media (max-width: 640px) {
  .trilha-svg {
    display: none;
  }

  /* mobile volta pra linha reta */
  .trilha-track {
    display: block;
    left: 18px;
  }

  .trilha-no,
  .trilha-passo.lado-esq .trilha-no,
  .trilha-passo.lado-dir .trilha-no {
    left: 18px;
  }

  .trilha-passo .trilha-box,
  .trilha-passo.lado-esq .trilha-box,
  .trilha-passo.lado-dir .trilha-box {
    left: 44px;
    right: 0;
    width: auto;
  }
}

/* Card de trilha clicável (leva para a linha do tempo) */
.curso-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Lista de usuários para matricular na trilha */
.lista-matricular {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.lista-matricular li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  font-size: 14px;
  background: var(--surface-2);
}

.lista-matricular form {
  margin: 0;
}

/* Busca interna */
.busca-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 24px;
}

.busca-form input[type="search"] {
  flex: 1 1 280px;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
}

.busca-form select {
  padding: 11px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}

.busca-form input[type="search"]:focus,
.busca-form select:focus {
  border-color: var(--brand-1);
  outline: none;
}

.busca-bloco {
  margin-bottom: 30px;
}

.busca-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  margin: 0 0 14px;
}

.busca-conta {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-1);
  background: var(--brand-50);
  border-radius: 999px;
  padding: 2px 9px;
}

.busca-trecho {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.busca-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.busca-item a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}

.busca-item a:hover {
  border-color: var(--brand-1);
  box-shadow: var(--sh-1);
}

.busca-item-tipo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand-1);
  background: var(--brand-50);
  border-radius: 999px;
  padding: 2px 8px;
}

.busca-item-titulo {
  font-weight: 600;
}

.busca-item-meta {
  color: var(--muted);
  font-size: 13px;
}

/* Notificações — badge no sininho da sidebar */
.notif-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
}

.notif-badge[hidden] {
  display: none;
}

/* respeita o atributo hidden (sem não-lidas, sem bolinha) */
/* Lista de notificações */
.notif-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.notif-item.nao-lida {
  border-color: var(--brand-1);
  background: var(--brand-50);
}

.notif-ico {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.notif-corpo {
  flex: 1;
  min-width: 0;
}

.notif-titulo {
  font-weight: 600;
  display: block;
}

a.notif-link {
  color: var(--ink);
  text-decoration: none;
}

a.notif-link:hover {
  color: var(--brand-1);
}

.notif-msg {
  margin: 3px 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.notif-data {
  font-size: 12px;
  color: var(--muted);
}

.notif-lida-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--success);
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
}

.notif-lida-btn:hover {
  background: var(--surface-2);
}

/* Preferências de notificação (tabela em /conta) */
.notif-prefs {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.notif-prefs th,
.notif-prefs td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.notif-prefs th:not(:first-child),
.notif-prefs td:not(:first-child) {
  text-align: center;
  width: 90px;
}

.notif-prefs thead th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.notif-prefs input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-1);
  cursor: pointer;
}

/* Gamificação — grade de conquistas */
.conquistas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 10px 0 30px;
}

.conquista {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 18px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
}

.conquista-emoji {
  font-size: 34px;
  line-height: 1;
}

.conquista-nome {
  font-weight: 600;
  font-size: 14px;
}

.conquista-desc {
  color: var(--muted);
  font-size: 12px;
}

.conquista.bloqueada {
  opacity: .55;
  filter: grayscale(1);
}

.conquista.bloqueada .conquista-emoji {
  filter: grayscale(1);
}

/* Feedback — widget de estrelas no player */
.feedback-box {
  margin: 22px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.fb-box-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.fb-box-head h3 {
  margin: 0;
  font-size: 15px;
}

.fb-media {
  font-size: 13px;
  color: var(--warning);
  font-weight: 600;
}

.estrelas {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 10px;
}

.estrela {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  padding: 0 2px;
  color: var(--border-strong);
  transition: color .12s, transform .12s;
}

.estrela.ativa {
  color: #f59e0b;
}

.estrela:hover {
  transform: scale(1.12);
}

.fb-comentario {
  display: block;
  width: 100%;
  height: 88px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 10px;
}

.fb-comentario:focus {
  border-color: var(--brand-1);
  outline: none;
  background: var(--surface);
}

/* Estado "já avaliado": nota trocável por clique + comentário enviado */
.fb-avaliado {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-avaliado .estrelas {
  margin-bottom: 0;
}

.fb-avaliado-dica {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.fb-avaliado-com {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--text);
  font-style: italic;
}

.fb-avaliado-msg {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
}

/* Feedback — painel admin (distribuição + comentários) */
.fb-distrib {
  display: grid;
  gap: 6px;
  max-width: 420px;
  margin: 6px 0 24px;
}

.fb-distrib-linha {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.fb-distrib-lbl {
  width: 34px;
  color: var(--muted);
}

.fb-distrib-barra {
  flex: 1;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.fb-distrib-fill {
  display: block;
  height: 100%;
  background: #f59e0b;
}

.fb-distrib-qtd {
  width: 28px;
  text-align: right;
  color: var(--muted);
}

.fb-coment-lista {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.fb-coment {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.fb-coment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.fb-coment-estrelas {
  color: #f59e0b;
  letter-spacing: 1px;
}

.fb-coment-vazias {
  color: var(--border-strong);
}

.fb-coment-autor {
  font-weight: 600;
}

.fb-coment-meta {
  color: var(--muted);
}

.fb-coment-data {
  margin-left: auto;
  color: var(--muted);
}

.fb-coment-texto {
  margin: 6px 0 0;
  font-size: 14px;
}

/* =====================================================================
   Comunidade — feed social (espaços · posts · ranking)
   ===================================================================== */
.com-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 296px;
  gap: 24px;
  align-items: start;
}

.com-col-titulo {
  font-family: var(--liga-font);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--faint);
  margin-bottom: 12px;
}

/* Avatares — iniciais sobre superfície neutra (a imagem, quando existe, cobre o fundo) */
.com-avatar {
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--text);
}

/* Coluna esquerda — espaços */
.com-espacos {
  position: sticky;
  top: 16px;
}

.com-espacos-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.com-espaco-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.com-espaco-item:hover {
  background: var(--surface-2);
}

.com-espaco-item.ativo {
  color: var(--ink);
  font-weight: 600;
}

.com-espaco-item.ativo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--verde-prog);
}

/* minimal: sidebar de espaços é texto puro — sem quadradinhos de ícone */
.com-espaco-ic {
  display: none;
}

.com-espaco-item.ativo .com-espaco-ic {
  color: var(--ink);
}

.com-espaco-badge {
  flex-shrink: 0;
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--success);
  border-radius: 999px;
}

/* As bolinhas usam display: grid, que anula o atributo hidden. */
.com-espaco-badge[hidden] {
  display: none;
}

.com-espaco-ic svg {
  width: 16px;
  height: 16px;
}

.com-espacos-sub {
  margin: 14px 8px 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .6;
}

.com-esp-curso-badge {
  font-size: .72rem;
  font-weight: 600;
  opacity: .75;
  margin-right: 4px;
  white-space: nowrap;
}

.com-gerenciar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r-md);
  transition: background .15s, color .15s;
}

.com-gerenciar-link:hover {
  background: var(--surface-2);
  color: var(--brand-1);
}

.com-gerenciar-link svg {
  width: 15px;
  height: 15px;
}

.com-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Coluna central */
.com-centro {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.com-centro-head h1 {
  font-family: var(--liga-font);
  font-size: 25px;
  letter-spacing: -.01em;
  color: var(--ink);
}

.com-centro-head p {
  font-size: 14px;
  margin-top: 3px;
}

/* Composer */
.com-composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.com-composer-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.com-composer-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.com-composer-fields {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.com-composer-titulo,
.com-composer-corpo {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.com-composer-titulo {
  font-weight: 600;
}

.com-composer-corpo {
  height: 84px;
  resize: none;
  line-height: 1.55;
}

.com-composer-titulo:focus,
.com-composer-corpo:focus {
  border-color: var(--brand-1);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.com-composer-rodape {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding-left: 52px;
}

.com-composer-acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.com-anexo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.com-anexo:hover,
.com-anexo.ativo {
  border-color: var(--brand-1);
  color: var(--brand-1);
  background: var(--brand-50);
}

.com-anexo svg {
  width: 16px;
  height: 16px;
}

/* botão-toggle (Link/Enquete) reaproveita o chip .com-anexo */
.com-link-toggle,
.com-enquete-toggle {
  font-family: inherit;
}

.com-anexo-nome {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.com-composer-rodape .com-publicar {
  margin-left: auto;
  background: var(--verde-acao);
}

.com-composer-rodape .com-publicar:hover {
  background: var(--verde-acao-700);
}

.com-composer-dica {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 16px;
  font-size: 14px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
}

.com-composer-dica svg {
  width: 18px;
  height: 18px;
  color: var(--brand-1);
  flex-shrink: 0;
}

/* Feed */
.com-feed {
  display: grid;
  gap: 16px;
}

.com-vazio {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.com-vazio svg {
  width: 26px;
  height: 26px;
  color: var(--brand-1);
  background: var(--brand-50);
  padding: 15px;
  border-radius: 50%;
  box-sizing: content-box;
  margin-bottom: 14px;
}

/* Post */
.com-post {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}

.com-post-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.com-post-head .menu-avatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.com-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.com-post-autor {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.com-post-sub {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--faint);
}

/* Tag "Membro" (plano ativo) logo abaixo do nome: posts, comentários e perfil. */
#liga-studio .com-tag-membro {
  font-size: 10.5px;
  line-height: 1.2;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  align-self: center;
}
#liga-studio .com-post-membro { flex-basis: 100%; line-height: 1; }
#liga-studio .com-comentario-autor .com-tag-membro { margin-left: 6px; vertical-align: 1px; }
#liga-studio .pf-texto .com-tag-membro { margin-top: 6px; }

.com-post-sub::before {
  content: "·";
  color: var(--faint);
}

.com-post-espaco {
  color: var(--faint);
}

.com-post-ponto {
  color: var(--faint);
}

.com-post-titulo {
  font-family: var(--liga-font);
  font-size: 17px;
  color: var(--ink);
  margin: 2px 0 6px;
}

.com-post-corpo {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

.com-post-corpo.expandido {
  display: block;
  -webkit-line-clamp: unset;
}

.com-ver-mais {
  display: inline-block;
  margin-top: 5px;
  background: none;
  border: none;
  padding: 0;
  color: var(--verde-prog);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* respeita o atributo hidden (só aparece quando o texto está de fato cortado) */
.com-ver-mais[hidden] {
  display: none;
}

.com-ver-mais:hover {
  text-decoration: underline;
}

.com-post-img {
  display: block;
  max-width: 100%;
  margin-top: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.com-post-video {
  position: relative;
  margin-top: 12px;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.com-post-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.com-post-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.com-post-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
}

.com-post-video-play svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.com-post-video-titulo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.com-post-acoes {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.com-acao {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}

.com-acao svg {
  width: 17px;
  height: 17px;
  transition: transform .15s;
}

.com-acao:hover {
  background: var(--surface-2);
  color: var(--text);
}

.com-acao:active {
  transform: scale(.94);
}

.com-curtir.curtido {
  color: var(--brand-1);
  background: none;
}

/* Ações de moderação (sinalizar/remover): discretas, empurradas à direita */
.com-denunciar {
  margin-left: auto;
}

.com-mod {
  color: var(--faint);
  padding: 6px;
}

.com-mod svg {
  width: 15px;
  height: 15px;
}

.com-curtir.curtido svg {
  fill: var(--brand-1);
  transform: scale(1.05);
}

/* Comentários */
.com-comentarios {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.com-comentarios-lista {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.com-comentario {
  display: flex;
  gap: 9px;
}

.com-comentario .menu-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.com-comentario-corpo {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
  padding: 8px 12px;
  min-width: 0;
}

.com-comentario-autor {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.com-comentario-texto {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.com-comentario-tempo {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 3px;
}

.com-comentar-form {
  display: flex;
  gap: 8px;
}

.com-comentar-input {
  flex: 1;
  min-width: 0;
  padding: 9px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.com-comentar-input:focus {
  border-color: var(--brand-1);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.com-comentar-enviar {
  flex-shrink: 0;
}

/* Carregar mais */
.com-mais-wrap {
  display: flex;
  justify-content: center;
}

.com-carregar-mais {
  min-width: 200px;
  padding: 10px 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, color .15s, background .15s;
}

.com-carregar-mais:hover {
  border-color: var(--brand-1);
  color: var(--brand-1);
  background: var(--brand-50);
}

/* Coluna direita — ranking */
.com-ranking {
  position: sticky;
  top: 16px;
  /* minimal: widget da coluna direita sem card — direto no fundo */
}

.com-agenda-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color .14s, background .14s;
}

.com-agenda-link svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Matriculado em algum curso: ícone verde, sinalizando acesso liberado à Agenda */
.com-agenda-link.com-agenda-liberada svg {
  color: var(--success);
}

.com-agenda-link:hover {
  border-color: var(--brand-1);
  background: var(--brand-50);
}

/* Menu da Agenda (Encontros / Rotina de Aprendizado) */
.agenda-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
  max-width: 720px;
}

.agenda-opcao {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}

.agenda-opcao:hover {
  border-color: var(--brand-1);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.agenda-opcao-ic {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--brand-100);
  color: var(--brand-1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.agenda-opcao-ic svg {
  width: 24px;
  height: 24px;
}

.agenda-opcao-texto {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agenda-opcao-texto strong {
  font-size: 15.5px;
}

.agenda-opcao-texto small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

/* Sem matrícula em curso nenhum: só referência, sem funcionalidade ativa */
.agenda-opcao-bloqueada {
  opacity: .7;
  cursor: default;
}

.agenda-opcao-bloqueada:hover {
  border-color: var(--border);
  box-shadow: none;
}

.com-ranking-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.com-ranking-head .com-col-titulo {
  margin: 0;
}

.com-ranking-head svg {
  width: 17px;
  height: 17px;
  color: #f59e0b;
}

.com-ranking-vazio {
  font-size: 13.5px;
}

.com-ranking-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.com-ranking-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 8px;
  border-radius: var(--r-md);
  transition: background .15s;
}

.com-ranking-item:hover {
  background: var(--surface-2);
}

.com-ranking-pos {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--verde-prog);
}

.com-ranking-item .menu-avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.com-ranking-nome {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.com-pontos {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Próximos eventos (coluna direita, sem card — direto no fundo) */
.com-eventos {
  margin-top: 26px;
}

.com-eventos-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.com-evento-item {
  display: grid;
  gap: 2px;
  text-decoration: none;
}

.com-evento-quando {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-link, var(--brand-1));
}

.com-evento-titulo {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.com-evento-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.com-ver-agenda {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-1);
  text-decoration: none;
}

.com-ver-agenda:hover {
  text-decoration: underline;
}

/* Foco visível (acessibilidade) */
.com-espaco-item:focus-visible,
.com-acao:focus-visible,
.com-ver-mais:focus-visible,
.com-carregar-mais:focus-visible,
.com-anexo:focus-visible,
.com-gerenciar-link:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 2px;
}

/* Admin — gerenciar espaços */
.com-esp-novo {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.com-espacos-admin {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.com-esp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.com-esp-item.oculto {
  opacity: .6;
}

.com-esp-item .drag-handle {
  cursor: grab;
  color: var(--faint);
  font-size: 16px;
}

.com-esp-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.com-esp-ic {
  width: 46px;
  text-align: center;
  padding: 7px 4px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
}

.com-esp-nome {
  width: 180px;
  padding: 7px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}

.com-esp-desc {
  flex: 1;
  min-width: 140px;
  padding: 7px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
}

.com-esp-ic:focus,
.com-esp-nome:focus,
.com-esp-desc:focus {
  border-color: var(--brand-1);
  outline: none;
  background: var(--surface);
}

.com-esp-vis {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.com-esp-count {
  font-size: 12.5px;
  white-space: nowrap;
}

.com-esp-del {
  margin-left: auto;
}

/* Responsivo */
@media (max-width: 1080px) {
  .com-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .com-ranking {
    display: none;
  }
}

@media (max-width: 760px) {
  .com-layout {
    grid-template-columns: 1fr;
  }

  .com-espacos {
    position: static;
  }

  .com-espacos-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }

  .com-espaco-item {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* =====================================================================
   Chat da comunidade — grupo geral + conversas privadas (DM)
   ===================================================================== */
.chat-painel {
  padding-top: 20px;
  padding-bottom: 20px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: calc(100dvh - 108px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

/* Coluna — lista de conversas */
.chat-lista {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
}

.chat-lista-head {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.chat-voltar-com {
  display: inline-block;
  font-size: 13px;
  margin-bottom: 10px;
}

.chat-lista-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-lista-titulo h1 {
  font-family: var(--liga-font);
  font-size: 19px;
  color: var(--ink);
}

.chat-acoes {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-nova-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: var(--verde-acao);
  border: none;
  padding: 9px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.chat-nova-btn:hover {
  background: var(--verde-acao-700);
}

.chat-nova-btn svg {
  width: 15px;
  height: 15px;
}

.chat-grupo-btn {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
}

.chat-grupo-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-1);
  color: var(--brand-1);
}

.chat-contatos,
.chat-grupo-novo {
  border-bottom: 1px solid var(--border);
  padding: 10px;
}

.chat-nova-form {
  display: grid;
  gap: 8px;
}

.chat-contato-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--r-md);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}

.chat-contato-btn:hover {
  background: var(--surface-2);
}

.chat-contato-btn .menu-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.chat-grupo-nome {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
}

.chat-grupo-nome:focus {
  border-color: var(--brand-1);
  outline: none;
  background: var(--surface);
}

.chat-contatos-busca {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
}

.chat-contatos-busca:focus {
  border-color: var(--brand-1);
  outline: none;
  background: var(--surface);
}

.chat-contatos-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}

.chat-contato-lbl {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.chat-contato-lbl:hover {
  background: var(--surface-2);
}

.chat-contato-lbl input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-1);
  flex-shrink: 0;
  cursor: pointer;
}

.chat-contato-lbl .menu-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.chat-contato-nome {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contatos-vazio {
  padding: 8px;
  font-size: 13px;
}

.chat-nova-acoes {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 4px;
}

/* Pop-up de novo grupo */
.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.chat-modal[hidden] {
  display: none;
}

.chat-modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .58);
}

.chat-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: chatModalIn .18s ease-out;
}

@keyframes chatModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.chat-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.chat-modal-head h2 {
  font-family: var(--liga-font);
  font-size: 18px;
  color: var(--ink);
}

.chat-modal-x {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.chat-modal-x:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.chat-modal-x svg {
  width: 20px;
  height: 20px;
}

.chat-modal-card .chat-nova-form {
  padding: 16px 18px;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.chat-modal-lista {
  max-height: 42vh;
}

.chat-conversas {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  align-content: flex-start;
}

.chat-conversas>li {
  flex: none;
}

.chat-conversa {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
}

.chat-conversa:hover {
  background: var(--surface-2);
}

.chat-conversa.ativa {
  background: var(--surface-2);
}

.chat-conversa.ativa .chat-conversa-nome {
  color: var(--ink);
}

.chat-conversa.nao-lida .chat-conversa-nome {
  color: var(--ink);
  font-weight: 700;
}

.chat-conversa.nao-lida .chat-conversa-previa {
  color: var(--text);
  font-weight: 500;
}

.chat-conversa-av {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.chat-conversa-av svg {
  width: 20px;
  height: 20px;
}

.chat-conversa-corpo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-conversa-topo {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chat-conversa-nome {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-conversa-tempo {
  font-size: 11px;
  color: var(--faint);
  flex-shrink: 0;
}

.chat-conversa-previa {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--success);
  border-radius: 999px;
}

.chat-badge[hidden] {
  display: none;
}

/* Coluna — thread */
.chat-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.chat-thread-head .menu-avatar {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.chat-thread-head .chat-conversa-av svg {
  width: 18px;
  height: 18px;
}

.chat-thread-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-thread-meta strong {
  font-size: 15px;
  color: var(--ink);
}

.chat-thread-sub {
  font-size: 12px;
  color: var(--muted);
}

.chat-voltar-mob {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: -6px;
  border-radius: 50%;
  color: var(--muted);
}

.chat-voltar-mob:hover {
  background: var(--surface-2);
}

.chat-voltar-mob svg {
  width: 22px;
  height: 22px;
}

.chat-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-2);
}

.chat-msgs-vazio {
  text-align: center;
  margin: auto;
  font-size: 14px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 78%;
  align-items: flex-end;
}

.chat-msg.meu {
  margin-left: auto;
  flex-direction: row-reverse;
}

.chat-msg-av {
  width: 28px;
  height: 28px;
  font-size: 11px;
  flex-shrink: 0;
}

.chat-bolha {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}

.chat-msg.meu .chat-bolha {
  background: var(--grad);
  border: none;
  color: #fff;
}

.chat-msg-autor {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-700);
  margin-bottom: 2px;
}

.chat-msg-texto {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-tempo {
  font-size: 10.5px;
  margin-top: 3px;
  align-self: flex-end;
  color: var(--faint);
}

.chat-msg.meu .chat-msg-tempo {
  color: rgba(255, 255, 255, .82);
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 11px 15px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.chat-input:focus {
  border-color: var(--brand-1);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.chat-enviar {
  flex-shrink: 0;
  background: var(--verde-acao);
}

.chat-enviar:hover {
  background: var(--verde-acao-700);
}

.chat-vazio {
  margin: auto;
}

@media (max-width: 760px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: calc(100dvh - 76px);
  }

  .chat-lista {
    border-right: none;
  }

  .chat-layout.tem-conversa .chat-lista {
    display: none;
  }

  .chat-layout:not(.tem-conversa) .chat-thread {
    display: none;
  }

  .chat-voltar-mob {
    display: grid;
  }

  .chat-msg {
    max-width: 86%;
  }
}

.com-seguir-btn {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--verde-acao);
  background: var(--verde-acao);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.com-seguir-btn.seguindo {
  background: transparent;
  color: var(--verde-prog);
}

.com-seguir-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.com-desafio {
  padding: 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  margin-bottom: 16px;
}

.com-desafio-head {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.com-desafio-desc {
  font-size: 0.8rem;
  margin: 0 0 8px;
}

.com-desafio-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--brand-100, #ede9fe);
  overflow: hidden;
}

.com-desafio-bar span {
  display: block;
  height: 100%;
  background: var(--brand-2, #7c3aed);
}

.com-desafio-num {
  font-size: 0.8rem;
  margin-top: 6px;
  color: var(--muted, #6b7280);
}

.agenda-calendario {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agenda-menu + .agenda-calendario {
  max-width: 720px;
  margin-top: 16px;
}

.agenda-calendario p {
  margin: 0;
  flex: 1 1 260px;
}

.agenda-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.agenda-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
}

.agenda-card-corpo {
  flex: 1;
  min-width: 0;
}

.agenda-imagem {
  flex-shrink: 0;
  width: 90px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
}

.agenda-passado {
  opacity: 0.92;
}

.agenda-ao-vivo {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.agenda-quando {
  font-size: 0.85rem;
  color: var(--brand-2, #7c3aed);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-selo {
  font-size: 0.7rem;
  background: var(--brand-100, #ede9fe);
  color: var(--brand-2, #7c3aed);
  padding: 2px 8px;
  border-radius: 999px;
}

.agenda-selo-vivo {
  background: var(--danger);
  color: #fff;
}

.agenda-titulo {
  margin: 6px 0 2px;
  font-size: 1.05rem;
}

.agenda-instrutor {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted, #6b7280);
}

.agenda-desc {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.agenda-gravacao {
  display: inline-block;
  text-decoration: none;
}

/* Confirmação de presença (RSVP) — Sim/Não/Talvez */
.agenda-rsvp {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 8px;
}

.agenda-rsvp-botoes {
  display: flex;
  gap: 6px;
}

.agenda-rsvp-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}

.agenda-rsvp-btn:hover {
  border-color: var(--brand-1);
  color: var(--ink);
}

.agenda-rsvp-btn:disabled {
  opacity: .6;
  cursor: default;
}

.agenda-rsvp-btn.ativa {
  background: var(--brand-1);
  border-color: var(--brand-1);
  color: #fff;
}

.agenda-rsvp-contagem {
  font-size: 12.5px;
  color: var(--faint);
}

/* Lista de confirmações (admin) */
.tabela-usuario {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selo-rsvp {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.selo-rsvp-sim {
  background: var(--success);
  color: #fff;
}

.selo-rsvp-nao {
  background: var(--danger);
  color: #fff;
}

.selo-rsvp-talvez {
  background: var(--surface-2);
  color: var(--muted);
}

.agenda-reuniao-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.evento-edit {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.evento-edit summary {
  cursor: pointer;
}

.evento-edit .evento-excluir {
  margin-top: 10px;
  padding: 0;
}

.evento-selo-ao-vivo {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
}

.evento-selo-alerta {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #7a4b00;
  background: #ffe7b3;
}

.evento-edit .aviso-box form {
  margin-top: 10px;
}

.evento-reuniao-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.evento-imagem-preview {
  display: block;
  width: 90px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  margin-bottom: 8px;
}

/* =================== Rotina de Aprendizado (Onda 3) =================== */

.painel-head-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rotina-mes-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.rotina-mes-label {
  min-width: 180px;
  text-align: center;
}

.rotina-grade-cabecalho,
.rotina-grade-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.rotina-grade-cabecalho {
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.rotina-dia {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .14s, background .14s;
}

.rotina-dia-link:hover {
  border-color: var(--brand-1);
}

.rotina-dia-vazio {
  border: none;
}

.rotina-dia-hoje {
  border-color: var(--border-strong);
  font-weight: 700;
}

.rotina-dia-selecionado {
  background: var(--brand-1);
  border-color: var(--brand-1);
  color: #fff;
}

.rotina-dia-ponto {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-1);
}

.rotina-dia-selecionado .rotina-dia-ponto {
  background: #fff;
}

.rotina-card {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.rotina-card-hora {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-1);
  white-space: nowrap;
  padding-top: 2px;
}

.rotina-card-corpo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rotina-card-acoes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

#dialog-rotina {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px;
  max-width: 480px;
  width: 92vw;
  background: var(--surface);
  color: var(--ink);
}

#dialog-rotina::backdrop {
  background: rgba(15, 23, 42, .5);
}

#dialog-rotina h2 {
  margin: 0 0 14px;
}

.dialog-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.com-post-anexo,
.com-post-link {
  display: inline-block;
  margin: 6px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--brand-1);
  font-size: 13.5px;
  word-break: break-all;
}

.com-link-editor {
  margin: 8px 0;
}

.com-composer-link {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.com-composer-link:focus {
  outline: none;
  border-color: var(--brand-1);
  background: var(--surface);
}

.com-enquete-add {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
}

.com-enquete-add:hover {
  border-color: var(--brand-1);
  color: var(--brand-1);
}

.com-enquete-editor {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.com-enquete-editor[hidden] {
  display: none;
}

.com-enquete-op {
  padding: 6px 8px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font: inherit;
}

.com-enquete {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.com-enquete-opcao {
  position: relative;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font: inherit;
  overflow: hidden;
}

.com-enquete-opcao.minha {
  border-color: var(--brand-2, #7c3aed);
  cursor: default;
}

/* só a minha não re-clica; as outras seguem clicáveis p/ trocar */
.com-enquete-barra {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--brand-100, #ede9fe);
  z-index: 0;
}

.com-enquete-txt,
.com-enquete-pct {
  position: relative;
  z-index: 1;
}

.com-enquete-pct {
  float: right;
  font-weight: 600;
}

/* Botão pequeno (compartilhar conquista, moderar feedback). Antes não tinha estilo próprio
   e caía no visual padrão do navegador. */
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn-mini:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-mini:active { transform: translateY(1px); }
.btn-mini svg { width: 15px; height: 15px; flex: 0 0 auto; }
/* Respiro acima do botão dentro do card de conquista */
.conquista .inline-form { margin-top: 8px; }

/* Botão compartilhar no LinkedIn (compõe com btn-acao/btn-primario/btn-mini) */
.btn-linkedin { background:#0a66c2; color:#fff; border-color:#0a66c2; }
.btn-linkedin:hover { background:#004182; border-color:#004182; }
.inline-form { display:inline; }

/* Página pública de credencial (compartilhamento no LinkedIn) */
.credencial-publica {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 50% -10%, var(--brand-50), transparent 60%),
    var(--bg);
}
.credencial-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 40px 36px;
  text-align: center;
}
.credencial-marca {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 18px;
}
.credencial-card h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 20px;
}
.credencial-nome {
  font-size: 1.25rem;
  color: var(--brand-2);
  margin-bottom: 4px;
}
.credencial-sub { color: var(--text); margin-bottom: 14px; }
.credencial-data { color: var(--muted); font-size: .95rem; }
.credencial-codigo { color: var(--faint); font-size: .85rem; margin-top: 2px; }
.credencial-publica .btn-linkedin {
  display: inline-block;
  margin-top: 26px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease;
}

.com-enquete-total {
  font-size: 0.8rem;
}
/* =====================================================================
   AJUSTES PEDIDOS — ago/2026
   A marca do sistema segue ROXA. O verde entra APENAS nos pontos abaixo,
   que são os que aparecem nos prints. Nada aqui vaza para comunidade,
   admin, dashboard, catálogo ou login.

   Dois verdes, porque um só não atende os dois usos:
     --verde-prog  acento sobre o fundo da página (texto, barra, anéis).
                   Escuro no tema claro, vivo no escuro — senão um dos
                   dois fica ilegível.
     --verde-acao  superfície preenchida com texto/ícone branco em cima.
                   Igual nos dois temas, senão o branco perde contraste.
   ===================================================================== */
:root {
  --verde-prog: #037c1a;
  --verde-acao: #037c1a;
  --verde-acao-700: #026314;
  --verde-halo: rgba(3, 124, 26, .18);
}

[data-theme="dark"] {
  --verde-prog: #01d56f;
  --verde-acao: #037c1a;
  --verde-acao-700: #04952a;
  --verde-halo: rgba(1, 213, 111, .24);
}

/* --- Item 1: card em Meus cursos (status, barra, %, "Continuar →") --- */
.status-prog,
.status-done,
.curso-pct,
.curso-cta {
  color: var(--verde-prog);
}

/* Barra de progresso: no card do curso E no topo do player. */
.barra-fill {
  background: var(--verde-prog);
}

/* --- Item 3: a trilha vai ficando verde conforme o aluno avança --- */
.mod-anel {
  background: conic-gradient(var(--verde-prog) calc(var(--pct, 0) * 1%), var(--border-strong) 0);
  color: var(--verde-prog);
}

.mod-anel.completo {
  background: var(--verde-acao);
  color: #fff;
}

.trilha-item.feito .trilha-ponto {
  background: var(--verde-acao);
  border-color: var(--verde-acao);
}

.trilha-item.ativo .trilha-ponto {
  border-color: var(--verde-prog);
  box-shadow: 0 0 0 4px var(--verde-halo);
}

.trilha-item.ativo .trilha-nome {
  color: var(--verde-prog);
}

/* --- Itens 4 e 9: só os três botões citados ---
   Modificador aplicado no HTML de "Concluir e avançar"/"Próxima aula",
   "Enviar respostas" e "Refazer avaliação". Os demais .btn-primario do
   sistema seguem roxos. */
.btn-primario.btn-verde {
  background: var(--verde-acao);
}

.btn-primario.btn-verde:hover {
  background: var(--verde-acao-700);
}

.btn-acao.btn-verde {
  border-color: var(--verde-acao);
  color: var(--verde-prog);
}

/* --- Item 9: caixas de seleção das alternativas (tela do aluno) ---
   Só as do aluno; o editor de alternativas do admin (.alt-check) segue roxo. */
.alt-opcao input {
  accent-color: var(--verde-prog);
}

/* --- Item 5: avaliação compacta da aula + botão de salvar --- */
.aula-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.aval-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
}

.aval-inline-notas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding-right: 10px;
}

.aval-inline-rot {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* A caixa grande de feedback espaça as estrelas por baixo; aqui a linha é apertada. */
.aval-inline .estrelas {
  margin-bottom: 0;
}

.aval-inline .estrela {
  font-size: 19px;
  padding: 0 1px;
}

.aval-salvar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: color .14s, transform .12s;
}

.aval-salvar svg {
  width: 21px;
  height: 21px;
}

.aval-salvar:hover {
  color: var(--ink);
}

.aval-salvar:active {
  transform: scale(.9);
}

/* Salva: marcador preenchido. Verde porque é o mesmo "feito" do progresso. */
.aval-salvar.salva {
  color: var(--verde-prog);
}

.aval-salvar.salva svg {
  fill: currentColor;
}

.aval-salvar:disabled {
  opacity: .55;
  cursor: default;
}

@media (max-width: 560px) {
  .aula-barra {
    align-items: stretch;
  }

  .aval-inline {
    justify-content: space-between;
  }
}

/* --- Item 8: quantidade de aulas do módulo e duração de cada vídeo --- */
.mod-qtd {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.trilha-tempo {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Item 6: tela de aulas salvas --- */
.salvos-curso {
  margin-bottom: 26px;
}

.salvos-curso-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.salvos-curso-head h2 {
  font-size: 17px;
}

.salvos-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.salvos-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .14s, transform .14s;
}

.salvos-link:hover {
  border-color: var(--verde-prog);
  transform: translateX(2px);
}

.salvos-ico {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--verde-halo);
  color: var(--verde-prog);
}

.salvos-ico svg {
  width: 18px;
  height: 18px;
}

.salvos-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.salvos-txt strong {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.salvos-txt .muted {
  font-size: 12.5px;
}

/* --- Item 7: recolher/expandir cada MÓDULO da lista de conteúdo ---
   O cabeçalho do módulo virou botão. Ele já era um flex com anel + título +
   contagem; aqui só zeramos a aparência nativa de <button> e acrescentamos a
   seta. O painel de conteúdo em si nunca some. */
.mod-head {
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background .14s;
}

.mod-head:hover {
  background: var(--surface-2);
}

.mod-head:focus-visible {
  outline: 2px solid var(--verde-prog);
  outline-offset: 2px;
}

/* A contagem de aulas encosta na seta, não na borda. */
.mod-head .mod-qtd {
  margin-left: auto;
}

.mod-chev {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: var(--faint);
  transition: transform .18s;
}

/* Recolhido: some a lista de aulas daquele módulo e a seta aponta para o lado. */
.mod-bloco.recolhido .mod-trilha {
  display: none;
}

.mod-bloco.recolhido .mod-chev {
  transform: rotate(-90deg);
}

/* --- Trocar o vídeo de uma aula existente (admin) --- */
.trocar-video {
  flex-basis: 100%;
  margin: 6px 0 2px 30px;
}

.trocar-video > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-1);
  list-style: none;
  width: fit-content;
}

.trocar-video > summary::-webkit-details-marker {
  display: none;
}

.trocar-video > summary::before {
  content: "↻ ";
}

.editar-aula > summary::before {
  content: "✎ ";
}

.trocar-video > summary:hover {
  text-decoration: underline;
}

.trocar-video .form-aula {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  max-width: 520px;
}

/* =================== Reunião ao vivo (LiveKit) =================== */
/* Página isolada (sem sidebar do site) — sempre escura, como qualquer app de chamada de vídeo. */
.reuniao-page {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0b0b0f;
  color: #fff;
  overflow: hidden;
  font-family: var(--liga-font);
}

.reuniao-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.reuniao-sair-link {
  display: flex;
  color: #fff;
}

.reuniao-sair-link svg {
  width: 20px;
  height: 20px;
}

.reuniao-titulo {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reuniao-main {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.reuniao-video-grid {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  overflow: hidden;
}

.reuniao-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #1c1c22;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reuniao-tile-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reuniao-tile-nome {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  font-size: 12px;
  font-weight: 600;
}

.reuniao-audio-oculto {
  display: none;
}

.reuniao-painel {
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
}

.reuniao-painel-abas {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

/* Abas do painel (role=tablist) ocupam o espaço ao lado do botão de fechar. */
.reuniao-abas {
  flex: 1;
  display: flex;
}

.reuniao-aba:focus-visible,
.reuniao-controle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.reuniao-controle:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Aviso de erro da sala (reuniao.js): visível, com "Tentar novamente" e link de volta. */
.reuniao-aviso {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(520px, calc(100% - 28px));
  padding: 16px 18px;
  border-radius: 12px;
  background: #2a1414;
  border: 1px solid #b91c1c;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}

.reuniao-aviso p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.reuniao-aviso-acoes {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.reuniao-aviso-voltar {
  color: #fff;
  text-decoration: underline;
}

.reuniao-chat-erro {
  color: #fca5a5;
}

.reuniao-aba {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, .6);
  padding: 12px;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.reuniao-aba.ativa {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--verde-prog);
}

.reuniao-painel-fechar {
  display: flex;
  background: none;
  border: none;
  color: rgba(255, 255, 255, .6);
  padding: 10px;
  cursor: pointer;
}

.reuniao-painel-fechar svg {
  width: 16px;
  height: 16px;
}

.reuniao-painel-conteudo {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.reuniao-chat-lista,
.reuniao-participantes-lista {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reuniao-chat-msg {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.reuniao-chat-msg strong {
  color: var(--verde-prog);
}

.reuniao-participante-item {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.reuniao-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.reuniao-chat-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font: inherit;
}

.reuniao-chat-input::placeholder {
  color: rgba(255, 255, 255, .4);
}

.reuniao-controles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.reuniao-controle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.reuniao-controle svg {
  width: 20px;
  height: 20px;
}

.reuniao-controle:hover {
  background: rgba(255, 255, 255, .18);
}

.reuniao-controle.ativo {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.reuniao-sair {
  width: auto;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}

.reuniao-sair:hover {
  background: #b91c1c;
}

@media (max-width: 700px) {
  .reuniao-painel {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 20;
    background: #0b0b0f;
  }

  .reuniao-video-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 480px) {
  .reuniao-controles { gap: 6px; padding: 8px; }
  .reuniao-controle { width: 40px; height: 40px; flex: 0 0 40px; }
  .reuniao-sair { padding: 0; }
  .reuniao-sair span { display: none; }
}

/* Usuários: perfis da equipe, selo e consulta somente leitura (gestor) */
.campos-leitura{border:0;padding:0;margin:0;min-width:0}
.campos-leitura[disabled] input,.campos-leitura[disabled] select{opacity:.75;cursor:default}
.campo-check{display:flex;align-items:center;gap:8px;margin-top:10px;font-weight:500}
.campo-check input{width:auto}
.tag-equipe{background:#e8eefc;color:#2747a3}
.selo-verificado{display:inline-flex;vertical-align:-3px;margin-left:3px;color:#1d9bf0;line-height:0}
.selo-verificado svg{width:16px;height:16px;flex:none}
.cx-head h1 .selo-verificado svg{width:22px;height:22px}
.agendada-reagendar{display:flex;gap:6px;align-items:center}
.agendada-reagendar input{width:auto;padding:4px 6px}
.agendadas-historico{margin:0;padding-left:18px;display:grid;gap:6px}

/* =================== Painel admin — dashboards (out/2026) =================== */
/* Usado por /usuarios, /admin/relatorios e /comunidade/admin/eventos (interessados). */
.page-box-larga {
  max-width: 1180px;
}

.metricas-compactas .metrica {
  padding: 14px;
}

.metricas-compactas .metrica-num {
  font-size: 26px;
}

.metrica-alerta .metrica-num {
  color: var(--danger);
}

a.metrica-link {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

a.metrica-link:hover {
  border-color: var(--brand-1);
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
}

a.metrica-link.ativo {
  border-color: var(--brand-1);
  background: var(--brand-50);
}

.secao-subtitulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 18px 0 10px;
}

.secao-contagem {
  font-size: 14px;
  font-weight: 500;
  margin-left: 8px;
}

.dash-aviso {
  text-align: left;
  padding: 14px 16px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-bd);
  color: var(--warning);
  border-radius: var(--r-md);
}

.dash-aviso code {
  font-size: 12px;
}

.dash-legenda {
  font-size: 12px;
  margin: 6px 0 0;
}

/* Hoje / 7 dias / 30 dias */
.dash-periodos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dash-periodo,
.dash-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.dash-periodo-titulo {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.dash-kv {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
}

.dash-kv-num {
  font-family: var(--liga-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-1);
  font-variant-numeric: tabular-nums;
  min-width: 56px;
}

.dash-kv-lbl {
  font-size: 13px;
  color: var(--muted);
}

/* Gráfico de barras em CSS (sem script): cada barra tem a altura em % inline */
.dash-barras {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding: 8px 4px 22px;
  border-bottom: 1px solid var(--border-strong);
  position: relative;
  margin-top: 8px;
}

.dash-barras-baixa {
  height: 110px;
}

.dash-barra {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  min-width: 0;
}

.dash-barra-fill {
  width: 100%;
  background: var(--brand-1);
  border-radius: 4px 4px 0 0;
  opacity: .85;
  transition: opacity .15s ease;
}

.dash-barra:hover .dash-barra-fill {
  opacity: 1;
}

.dash-barra-rotulo {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

/* Listas com barra horizontal (aparelhos, cidades, regiões) */
.dash-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin: 14px 0 20px;
}

.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 10px 0 20px;
}

.dash-card .secao-subtitulo {
  margin-top: 0;
}

.dash-lista {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-lista li {
  padding: 6px 0;
}

.dash-lista-linha {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}

.dash-lista-val {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dash-lista-barra {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.dash-lista-barra > div {
  height: 100%;
  background: var(--brand-1);
  border-radius: 999px;
}

.dash-lista-barra-mini {
  width: 90px;
  margin-top: 3px;
}

/* Ranking do chat */
.ranking-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ranking-pos.ranking-top {
  background: var(--brand-1);
  color: #fff;
}

.tabela-compacta td,
.tabela-compacta th {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Meta de usuários */
.meta-card {
  border-left: 4px solid var(--brand-1);
}

.meta-numeros {
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-numeros strong {
  font-family: var(--liga-font);
  font-size: 22px;
  color: var(--ink);
}

.meta-pct {
  margin-left: auto;
  font-weight: 700;
  color: var(--brand-1);
}

.meta-pct.ok,
.barra-fill.barra-ok {
  background: none;
  color: var(--success);
}

.barra-fill.barra-ok {
  background: var(--success);
}

.meta-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.meta-form .campo {
  margin: 0;
  flex: 1;
}

.meta-form input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
}

.filtros-usuarios input[type="search"] {
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  min-width: 220px;
}

@media (max-width: 640px) {
  .dash-barra-rotulo {
    display: none;
  }

  .meta-form {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Trilha administrativa */
.auditoria-caminho {
  font-size: 12px;
  word-break: break-all;
}

.selo-resultado {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.selo-ok {
  background: var(--success-bg);
  color: var(--success);
}

.selo-recusado {
  background: var(--warning-bg);
  color: var(--warning);
}

.selo-erro {
  background: var(--danger-bg);
  color: var(--danger);
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Conta excluída (anonimizada) na lista de usuários */
.tag-excluido {
  background: var(--surface-2);
  color: var(--muted);
}

tr.linha-excluida td {
  color: var(--muted);
}

/* =================== Relatórios hub =================== */
.rel-abas {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin: 4px 0 18px;
  scrollbar-width: thin;
}

.rel-abas a {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.rel-abas a:hover { color: var(--text); }

.rel-abas a.ativo {
  color: var(--brand-1);
  border-bottom-color: var(--brand-1);
}

.rel-exportar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rel-filtros .campo input[type="text"],
.rel-filtros .campo select {
  min-width: 160px;
}

.rel-filtros-nota {
  font-size: 12px;
  align-self: center;
  margin-left: auto;
}

.rel-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.rel-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.rel-area:hover { border-color: var(--brand-1); box-shadow: 0 4px 16px rgba(0, 0, 0, .06); }
.rel-area strong { font-size: 16px; }
.rel-area span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.rel-area em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--brand-1); margin-top: auto; }

.rel-nota { margin-top: 12px; font-size: .85rem; }

/* --- Matrícula em massa (admin) --- */
.lote-matricula {
  margin-bottom: 20px;
}

.lote-matricula > summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-1);
  width: fit-content;
}

.lote-matricula form,
.lote-resultado {
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.lote-resultado {
  margin: 0 0 16px;
}

.lote-matricula textarea,
.lote-resultado textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
}
