/* ═══════════════════════════════════════════════════════════════
   VAMOS APRENDER INGLÊS — Global Stylesheet
   Paleta: navy / crimson / gold / parch / ink
   Fontes:  Playfair Display · Source Sans 3 · Courier Prime
════════════════════════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── SKIP LINK (acessibilidade por teclado) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 0 0 4px 4px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.1s;
}
.skip-link:focus {
  top: 0;
}

/* ── VARIÁVEIS DE COR E TIPOGRAFIA ── */
:root {
  /* Cores principais */
  --navy:     #0a1e50;
  --navy-mid: #0d2460;
  --navy-dk:  #06112a;
  --crimson:  #8b1a1a;
  --crimson2: #a02020;
  --gold:     #c9a227;
  --gold-lt:  #ffc832;
  --parch:    #f5f0e8;
  --ink:      #2c1810;
  --ink-lt:   #5a4030;
  --muted:    #c8d8f8;

  /* Feedback */
  --green:    #1a6b2a;
  --green-lt: #d4edda;
  --red:      #8b1a1a;
  --red-lt:   #fde8e8;
}

/* ── BASE ── */
html {
  scroll-behavior: smooth;
  font-size: 135%; /* base 21.6px — escala todos os rem proporcionalmente */
}

body {
  background: var(--navy);
  font-family: 'Source Sans 3', sans-serif;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ════════════════════════════════════════════
   FOCUS GLOBAL (visível para navegação por teclado)
════════════════════════════════════════════ */
:focus-visible {
  outline: 3px solid var(--gold-lt);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ════════════════════════════════════════════
   NAV — Breadcrumb / barra de topo
════════════════════════════════════════════ */
.topnav {
  background: var(--navy-dk);
  border-bottom: 1px solid #1a3070;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}
.topnav a:hover { color: var(--gold-lt); }
.topnav .sep    { color: #2a4070; }
.topnav .current { color: #fff; font-size: 0.92rem; }

/* ════════════════════════════════════════════
   HERO — Cabeçalho das páginas de subseção
════════════════════════════════════════════ */
.hero {
  background: linear-gradient(160deg, var(--navy-mid) 0%, var(--navy-dk) 60%, #1a0808 100%);
  border-bottom: 3px solid var(--crimson);
  padding: 44px 28px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '1';
  position: absolute;
  right: 2%;
  top: -10px;
  font-family: 'Playfair Display', serif;
  font-size: 240px;
  font-weight: 900;
  color: #ffffff05;
  line-height: 1;
  pointer-events: none;
}

/* Badge de nível (Level 1 / Level 2 / Practice / Revision) */
.level-badge {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crimson);
  background: #8b1a1a22;
  border: 1px solid var(--crimson);
  padding: 4px 14px;
  border-radius: 2px;
  margin-bottom: 16px;
}

/* Título da section dentro do hero */
.hero-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.hero-section-title em { color: var(--gold-lt); font-style: italic; }

/* Título principal h1 */
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.hero h1 em { font-style: italic; color: var(--gold-lt); }

/* Frase de exemplo em destaque */
.hero-example {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--gold);
  margin-top: 8px;
}

/* ════════════════════════════════════════════
   LAYOUT — Área de conteúdo
════════════════════════════════════════════ */
.content-wrap {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  width: 100%;
}

/* ════════════════════════════════════════════
   CARDS — Intro e Exercício
════════════════════════════════════════════ */
.intro-card {
  background: var(--parch);
  border-radius: 3px;
  border-top: 4px solid var(--crimson);
  padding: 28px 32px;
  color: var(--ink);
  box-shadow: 0 4px 20px #00000033;
  margin-bottom: 6px;
}

.exercise-card {
  background: var(--parch);
  border-radius: 3px;
  border-left: 4px solid var(--gold);
  padding: 24px 32px;
  color: var(--ink);
  box-shadow: 0 4px 20px #00000033;
  margin-bottom: 28px;
}

/* Cabeçalho do exercício (número + título) */
.ex-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.ex-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--crimson);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.ex-title     { font-size: 1rem; font-weight: 700; color: var(--ink); }
.ex-title em  { font-style: italic; color: var(--crimson); }

/* ════════════════════════════════════════════
   TABELA GRAMATICAL
════════════════════════════════════════════ */
.grammar-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.93rem;
}
.grammar-table th {
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-family: 'Courier Prime', monospace;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
}
.grammar-table th.title-cell {
  background: var(--crimson);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-align: center;
}
.grammar-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #c9a22733;
  color: var(--ink);
}
.grammar-table tr:last-child td     { border-bottom: none; }
.grammar-table tr:nth-child(odd) td  { background: #f0ebe0; }
.grammar-table tr:nth-child(even) td { background: #f8f4ec; }

/* Badges +/−/? nas tabelas */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 4px;
}
.badge.pos { background: #1a6b2a; color: #fff; }
.badge.neg { background: #8b1a1a; color: #fff; }
.badge.que { background: #1a3a8b; color: #fff; }

/* Formas verbais destacadas na tabela */
.be-form { color: var(--crimson); font-weight: 700; font-style: italic; }

/* Linha de exemplos abaixo da tabela */
.grammar-examples-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 4px;
  font-style: italic;
  color: var(--ink-lt);
  font-size: 0.92rem;
}

/* ════════════════════════════════════════════
   TEXTOS INTRODUTÓRIOS
════════════════════════════════════════════ */
.intro-text {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 10px;
}
.intro-text strong { font-weight: 700; }
.intro-text em     { font-style: italic; color: var(--crimson); }

.intro-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-style: italic;
  color: var(--ink-lt);
  font-size: 0.9rem;
}

/* Contrações */
.contraction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0;
  font-style: italic;
  color: var(--crimson);
  font-weight: 700;
}

/* Pares frase → pergunta */
.qstate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.qstate-item {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink);
  margin-right: 8px;
}
.qword  { color: var(--crimson); font-weight: 700; }
.arrow  { color: var(--ink-lt); margin: 0 4px; }

/* Exemplos de negativos */
.neg-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-lt);
}

/* Chips de adjetivos */
.adj-list  { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.adj-chip  { background: var(--navy); color: var(--gold-lt); padding: 3px 10px; border-radius: 2px; font-size: 0.82rem; font-style: italic; }
.adj-examples { font-style: italic; font-size: 0.88rem; color: var(--ink-lt); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 14px; }

/* Question words */
.qword-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.qword-chip { color: var(--crimson); font-weight: 700; font-style: italic; font-size: 1rem; }
.contract-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0; font-style: italic; color: var(--ink-lt); }

/* ════════════════════════════════════════════
   LINHA DE EXEMPLO (dentro do exercício)
════════════════════════════════════════════ */
.example-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0 10px;
  border-bottom: 1px dashed #c9a22755;
  margin-bottom: 12px;
  font-style: italic;
  color: var(--ink-lt);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.ex-marker { color: var(--crimson); font-weight: 700; font-size: 1rem; }
.ex-answer { color: var(--crimson); font-weight: 700; font-style: italic; text-decoration: underline dotted; }

/* ════════════════════════════════════════════
   LINHAS DE QUESTÃO
════════════════════════════════════════════ */
.q-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #c9a22722;
  position: relative;
  flex-wrap: wrap;
}
.q-row:last-of-type { border-bottom: none; }

.q-num   { width: 22px; flex-shrink: 0; color: var(--ink-lt); font-size: 0.85rem; font-weight: 600; }
.q-label { flex: 1; font-size: 0.95rem; color: var(--ink); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.q-hint  { font-style: italic; color: var(--ink-lt); font-size: 0.85rem; }
.q-reply { font-style: italic; color: var(--ink-lt); font-size: 0.85rem; margin-left: 4px; }

/* ════════════════════════════════════════════
   INPUTS DE RESPOSTA
════════════════════════════════════════════ */
.fill-input {
  border: none;
  border-bottom: 2px solid var(--crimson);
  background: transparent;
  color: var(--ink);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  padding: 1px 4px;
  width: 90px;
  outline: none;
  touch-action: manipulation;
  transition: border-bottom-color 0.15s;
}
.fill-input:focus-visible {
  outline: 2px solid var(--gold-lt);
  outline-offset: 2px;
  border-bottom-color: var(--gold);
}
.fill-input:focus         { border-bottom-color: var(--gold); }
.fill-input.wide          { width: 150px; }
.fill-input.sentence      { width: 100%; max-width: 420px; display: block; margin-top: 6px; }
.fill-input.correct-ans   { border-bottom-color: var(--green) !important; background: #d4edda55; }
.fill-input.wrong-ans     { border-bottom-color: var(--red) !important;   background: #fde8e855; }

/* ════════════════════════════════════════════
   FEEDBACK DE CORREÇÃO (texto abaixo do input)
════════════════════════════════════════════ */
.correction { display: none; font-size: 0.9rem; font-weight: 700; margin-top: 4px; width: 100%; }
.correction.show-ok    { display: block; color: var(--green); }
.correction.show-wrong { display: block; color: var(--red); }

/* ════════════════════════════════════════════
   EXERCÍCIO COM IMAGENS (Grupo 6)
════════════════════════════════════════════ */
.image-questions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 8px;
}
.img-q-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f0ebe0;
  border-radius: 3px;
  padding: 12px;
  border: 1px solid #c9a22733;
}
.img-q-item img {
  width: 100%;
  max-width: 180px;
  height: auto;
  border-radius: 2px;
  align-self: center;
}
.img-q-label {
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.img-q-item.example-img {
  opacity: 0.85;
  border-style: dashed;
}

/* ════════════════════════════════════════════
   CAIXA DE PALAVRAS (Word Box — Grupo 7)
════════════════════════════════════════════ */
.word-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #eee8d8;
  border: 1px solid #c9a22755;
  border-radius: 3px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.word-box span {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 2px 6px;
  background: #f5f0e8;
  border-radius: 2px;
}

/* ════════════════════════════════════════════
   SEÇÃO DE PONTUAÇÃO (Score)
════════════════════════════════════════════ */
.score-section {
  margin-top: 40px;
  padding: 28px;
  background: var(--parch);
  border-radius: 3px;
  border-top: 4px solid var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 20px #00000033;
  text-align: center;
}

/* Botão "Check my answers" */
.btn-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--crimson);
  color: #fff;
  border: none;
  padding: 14px 36px;
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s;
}
.btn-check:hover        { background: var(--crimson2); }

/* Botão "Voltar à tela anterior" */
.btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 13px 28px;
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s;
  margin-left: 12px;
}
.btn-voltar:hover { background: var(--navy); color: #fff; }

/* Botão "Refazer exercícios" */
.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--crimson);
  border: 2px solid var(--crimson);
  padding: 10px 28px;
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s;
  margin-left: 12px;
}
.btn-retry:hover { background: var(--crimson); color: #fff; }
.btn-check:focus-visible { outline: 3px solid var(--gold-lt); outline-offset: 4px; }

/* Resultado */
.score-display       { display: none; margin-top: 24px; }
.score-display.show  { display: block; }
.score-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 900;
  color: var(--crimson);
  line-height: 1;
}
.score-pct  { font-size: 1.1rem; color: var(--ink-lt); margin-top: 6px; }
.score-bar-wrap {
  height: 12px;
  background: #e0d8c8;
  border-radius: 6px;
  overflow: hidden;
  margin: 16px auto;
  max-width: 400px;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--crimson), var(--gold));
  border-radius: 6px;
  transition: width 0.8s ease;
}
.score-msg { font-size: 1rem; color: var(--ink); margin-top: 8px; font-style: italic; }

/* ════════════════════════════════════════════
   NAVEGAÇÃO INFERIOR (prev / all / next)
════════════════════════════════════════════ */
.bottom-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s;
}
.btn-prev                { background: var(--navy-mid); color: var(--muted); border: 1px solid #1a3070; }
.btn-prev:hover          { background: #1a3580; color: #fff; }
.btn-all                 { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn-all:hover           { background: var(--gold); color: var(--ink); }
.btn-next                { background: var(--crimson); color: #fff; border: 1px solid var(--crimson); }
.btn-next:hover          { background: var(--crimson2); }
.btn-nav:focus-visible   { outline: 3px solid var(--gold-lt); outline-offset: 3px; }

/* ════════════════════════════════════════════
   RODAPÉ
════════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  color: #3a5080;
  border-top: 1px solid #1a3070;
}
footer a       { color: #3a5080; text-decoration: none; }
footer a:hover { color: var(--gold); }

/* ════════════════════════════════════════════
   RESPONSIVO
════════════════════════════════════════════ */
@media (max-width: 600px) {
  .intro-card,
  .exercise-card      { padding: 20px 16px; }
  .image-questions    { grid-template-columns: 1fr; }
  .bottom-nav         { flex-direction: column; }
  .btn-nav            { justify-content: center; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-check,
  .btn-nav,
  .score-bar-fill     { transition: none; }
}

/* ════════════════════════════════════════════
   USER BADGE — cabeçalho com usuário logado
════════════════════════════════════════════ */
.topnav {
  /* já definido acima; estendemos aqui com justify-content */
  justify-content: space-between;
}
.topnav-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

#userBadge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ub-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.95rem;
  color: var(--gold-lt);
  font-weight: 600;
}
.ub-admin {
  font-size: 0.85rem;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 2px 8px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.ub-admin:hover { background: var(--gold); color: var(--ink); }
.ub-logout {
  font-size: 0.85rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid #2a4070;
  border-radius: 2px;
  padding: 2px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
}
.ub-logout:hover { background: var(--crimson); color: #fff; border-color: var(--crimson); }

/* ════════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════════ */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
}
.login-box {
  background: var(--parch);
  border-radius: 4px;
  border-top: 4px solid var(--crimson);
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px #00000055;
  color: var(--ink);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
}
.login-logo p {
  font-size: 0.85rem;
  color: var(--ink-lt);
  margin-top: 4px;
}

/* Grupo de campo */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 18px;
}
.field-group label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-lt);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field-group input {
  padding: 10px 12px;
  border: 1.5px solid #c9c0b0;
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  touch-action: manipulation;
}
.field-group input:focus-visible {
  border-color: var(--crimson);
  outline: 2px solid var(--gold-lt);
  outline-offset: 1px;
}
.field-group input::placeholder { color: #b0a898; }

.field-hint {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-lt);
  margin-top: 4px;
}

/* Erro inline */
.form-error {
  font-size: 0.85rem;
  color: var(--crimson);
  font-weight: 600;
  min-height: 20px;
  margin-bottom: 8px;
}
.form-success {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
  min-height: 20px;
  margin-bottom: 8px;
}

/* Botão principal de login / submit */
.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--crimson);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s;
  margin-top: 4px;
}
.btn-login:hover        { background: var(--crimson2); }
.btn-login:focus-visible { outline: 3px solid var(--gold-lt); outline-offset: 3px; }

/* Links de apoio (esqueci senha / cadastro) */
.form-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #ddd8cc;
}
.form-links a {
  font-size: 0.82rem;
  color: var(--crimson);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.form-links a:hover { color: var(--crimson2); text-decoration: underline; }

/* Divisor visual */
.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.form-divider hr { flex: 1; border: none; border-top: 1px solid #ddd8cc; }
.form-divider span { font-size: 0.9rem; color: #a09888; }

/* Botão secundário (voltar / cancelar) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: transparent;
  border: 1.5px solid #c9c0b0;
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-lt);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  touch-action: manipulation;
}
.btn-secondary:hover { border-color: var(--crimson); color: var(--crimson); }

/* ════════════════════════════════════════════
   ADMIN PANEL
════════════════════════════════════════════ */
.admin-wrap {
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 36px 24px 64px;
  width: 100%;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.admin-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: #fff;
}
.btn-new-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s;
}
.btn-new-user:hover { background: var(--gold-lt); }

/* Tabela de usuários */
.users-table-wrap {
  background: var(--parch);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 24px #00000033;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  color: var(--ink);
}
.users-table thead th {
  background: var(--navy);
  color: var(--gold-lt);
  padding: 12px 14px;
  text-align: left;
  font-family: 'Courier Prime', monospace;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.users-table tbody tr:nth-child(odd)  { background: #f5f0e8; }
.users-table tbody tr:nth-child(even) { background: #ede8e0; }
.users-table tbody tr:hover           { background: #e8e0d0; }
.users-table td { padding: 11px 14px; border-bottom: 1px solid #ddd8cc; vertical-align: middle; }
.users-table tr:last-child td { border-bottom: none; }

.badge-role {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-role.admin   { background: var(--crimson); color: #fff; }
.badge-role.student { background: var(--navy); color: var(--muted); }

.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.84rem;
  font-weight: 700;
}
.badge-status.active   { background: #d4edda; color: var(--green); }
.badge-status.inactive { background: #fde8e8; color: var(--red); }

.table-actions { display: flex; gap: 8px; }
.btn-tbl {
  padding: 4px 12px;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  touch-action: manipulation;
  transition: opacity 0.15s;
}
.btn-tbl:hover { opacity: 0.8; }
.btn-tbl.edit     { background: var(--navy); color: #fff; }
.btn-tbl.deactive { background: var(--crimson); color: #fff; }
.btn-tbl.activate { background: var(--green); color: #fff; }

/* Modal de criação/edição */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #00000088;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--parch);
  border-radius: 4px;
  border-top: 4px solid var(--crimson);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px #00000066;
  color: var(--ink);
  position: relative;
}
.modal-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 20px;
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink-lt);
  line-height: 1;
  touch-action: manipulation;
}
.modal-close:hover { color: var(--crimson); }

@media (max-width: 600px) {
  .login-box  { padding: 28px 20px; }
  .admin-wrap { padding: 20px 12px 40px; }
  .users-table thead { display: none; }
  .users-table td { display: block; padding: 6px 12px; }
  .users-table td::before {
    content: attr(data-label) ': ';
    font-weight: 700;
    color: var(--ink-lt);
    font-size: 0.9rem;
  }
}
