/* =========================================================
   Papo de Aprovado — Design System & Estilos
   Identidade Visual: Linear / Vercel / Stripe (Militar Moderno)
   Paleta: Preto, Grafite, Branco e Destaques em Dourado
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  /* Tema Claro (Light Mode) */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-hover: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #556b2f;
  
  --gold: #556b2f;
  --gold-glow: rgba(85, 107, 47, 0.2);
  --gold-gradient: linear-gradient(135deg, #718a42, #4f652d);
  --gold-light: rgba(85, 107, 47, 0.12);
  
  --silver: #64748b;
  --bronze: #b45309;
  
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.12);
  
  --radius: 14px;
  --radius-sm: 8px;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html[data-theme="dark"] {
  /* Tema Escuro - Padrão Militar Tech (Dark Mode) */
  --bg: #090a0f;
  --surface: #12151e;
  --surface-2: #191d2a;
  --surface-hover: #222738;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.09);
  --border-focus: #9ab66a;
  
  --gold: #a9c77a;
  --gold-glow: rgba(169, 199, 122, 0.22);
  --gold-gradient: linear-gradient(135deg, #91b85b, #607c37);
  --gold-light: rgba(169, 199, 122, 0.14);
  
  --silver: #94a3b8;
  --bronze: #d97706;
  
  --danger: #f87171;
  --danger-glow: rgba(248, 113, 113, 0.25);
  
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
}

/* Reset Básico & Tipografia */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: inherit;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover {
  opacity: 0.85;
}

.hidden {
  display: none !important;
}

/* ===== Componentes: Botões ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gold-gradient);
  color: #090a0f;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 14px -3px var(--gold-glow);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
  overflow: hidden;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -4px var(--gold-glow);
}

.btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--surface-2);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 15px -5px var(--gold-glow);
}

.btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 14px -3px var(--danger-glow);
}

.btn.danger:hover {
  box-shadow: 0 8px 22px -4px var(--danger-glow);
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn.block {
  width: 100%;
}

/* ===== Formulários ===== */
.input-group {
  margin-bottom: 14px;
}

input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 12px 0 6px;
}

/* ===== Tela de Login ===== */
#login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #1e2230 0%, #090a0f 70%);
  position: relative;
}

#login::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 158, 11, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 38px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--gold-gradient);
  color: #090a0f;
  font-size: 20px;
  flex: 0 0 auto;
  box-shadow: 0 4px 15px var(--gold-glow);
}

.login-card p.sub {
  color: var(--muted);
  margin: 8px 0 22px;
  font-size: 13.5px;
}

.erro {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 20px;
  text-align: center;
}

.dicas {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px;
  border: 1px dashed var(--border);
}

.dicas-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 4px;
}

/* ===== Layout Principal ===== */
#app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar .brand {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav button:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateX(3px);
}

.nav button.active {
  background: var(--surface-2);
  color: var(--gold);
  border-left: 3px solid var(--gold);
  font-weight: 700;
  box-shadow: inset 0 0 12px -3px var(--gold-glow);
}

.nav .sep {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 18px 14px 6px;
  font-weight: 800;
  opacity: 0.7;
}

.ico {
  width: 20px;
  text-align: center;
  flex: 0 0 auto;
  font-size: 15px;
}

/* Conteúdo Principal */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  backdrop-filter: blur(12px);
}

.topbar h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gold-gradient);
  display: grid;
  place-items: center;
  color: #090a0f;
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--border);
}

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--gold);
  transform: translateY(-1px);
}

#btnMenu {
  display: none;
}

.content {
  padding: 28px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Cards & Containers ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.card:hover {
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: var(--shadow-md);
}

.grid {
  display: grid;
  gap: 18px;
}

.g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.stat .lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat .val {
  font-size: 32px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--gold);
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
}

h3.tit {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--muted);
  font-size: 13.5px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.mt {
  margin-top: 20px;
}

/* Barra de Progresso */
.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--border);
}

.progress i {
  display: block;
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Listas & Badges */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  transition: border-color 0.2s, background-color 0.2s;
}

.item:hover {
  border-color: var(--gold);
  background-color: var(--surface-hover);
}

.item .t {
  font-weight: 700;
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.item .d {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.badge {
  background: var(--gold-light);
  color: var(--gold);
  border: 1px solid var(--border-focus);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.grey {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge.patente {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-weight: 800;
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: #ef4444;
}

.badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: #f59e0b;
}

/* ===== Calendário de Streak (30 Dias) ===== */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.streak-day {
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--muted);
  transition: all 0.2s ease;
}

.streak-day.ativo {
  background: var(--gold-gradient);
  color: #090a0f;
  border-color: transparent;
  box-shadow: 0 0 10px var(--gold-glow);
}

/* ===== Ranking & Pódio ===== */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: flex-end;
  margin-top: 20px;
}

.podium-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}

.podium-card:hover {
  transform: translateY(-4px);
}

.podium-card.first {
  border-color: var(--gold);
  box-shadow: 0 0 30px var(--gold-glow);
  transform: translateY(-10px);
}

.podium-card.second {
  border-color: var(--silver);
  box-shadow: 0 0 20px rgba(148, 163, 184, 0.15);
}

.podium-card.third {
  border-color: var(--bronze);
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.15);
}

.podium-crown {
  font-size: 32px;
  margin-bottom: 8px;
}

.podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--gold-gradient);
  display: grid;
  place-items: center;
  color: #090a0f;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 0 0 3px var(--surface-2);
}

.podium-card.first .podium-avatar { box-shadow: 0 0 0 4px var(--gold); }
.podium-card.second .podium-avatar { box-shadow: 0 0 0 4px var(--silver); }
.podium-card.third .podium-avatar { box-shadow: 0 0 0 4px var(--bronze); }

.podium-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.podium-rank {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  margin: 4px 0 12px;
}

.podium-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.podium-stats b {
  color: var(--text);
  font-family: var(--font-mono);
}

/* ===== Medalhas & Conquistas ===== */
.medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.medal-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s ease;
  position: relative;
}

.medal-card.bloqueada {
  opacity: 0.45;
  filter: grayscale(1);
}

.medal-card.em_andamento {
  border-color: rgba(245, 158, 11, 0.4);
}

.medal-card.conquistada {
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 4px 15px var(--gold-glow);
}

.medal-card:hover {
  transform: translateY(-2px);
}

.medal-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
}

.medal-card.conquistada .medal-icon {
  background: var(--gold-light);
  border-color: var(--gold);
  box-shadow: 0 0 15px var(--gold-glow);
}

.medal-title {
  font-weight: 800;
  font-size: 14px;
}

.medal-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.medal-status-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
}

.medal-card.conquistada .medal-status-tag {
  background: var(--gold-light);
  color: var(--gold);
}

.medal-card.em_andamento .medal-status-tag {
  background: var(--surface-2);
  color: var(--muted);
}

.medal-card.bloqueada .medal-status-tag {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

/* Tabelas */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

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

/* ===== Cronômetro ===== */
.timer {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--gold-glow);
  padding: 20px 0;
}

.timer.run {
  animation: timerPulse 2s infinite ease-in-out;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 25px var(--gold-glow); }
  50% { opacity: 0.75; text-shadow: 0 0 5px var(--gold-glow); }
}

/* ===== Gráficos de Barras ===== */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding-top: 16px;
}

.chart .bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart .bar i {
  width: 100%;
  max-width: 48px;
  background: var(--gold-gradient);
  border-radius: 8px 8px 4px 4px;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 4px;
  box-shadow: 0 2px 8px var(--gold-glow);
}

.chart .bar span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.chart .bar b {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--gold);
}

/* ===== Calendário ===== */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal .h {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  padding: 6px;
}

.cal .day {
  min-height: 80px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  overflow: hidden;
}

.cal .day:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  background: var(--surface-hover);
}

.cal .day.off {
  opacity: 0.3;
}

.cal .day.today {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.cal .day b {
  font-size: 13px;
  font-family: var(--font-mono);
}

.cal .ev {
  background: var(--gold-gradient);
  color: #090a0f;
  font-weight: 700;
  border-radius: 4px;
  padding: 3px 6px;
  margin-top: 4px;
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Quadro Branco ===== */
canvas#board {
  width: 100%;
  height: 480px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  touch-action: none;
  cursor: crosshair;
  box-shadow: var(--shadow-sm);
}

/* ===== Questões ===== */
.alt {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.alt:hover {
  border-color: var(--gold);
  background: var(--surface-hover);
}

.alt.sel {
  border-color: var(--gold);
  background: var(--gold-light);
  font-weight: 600;
}

.alt.ok {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

.alt.no {
  border-color: var(--danger);
  background: var(--danger-glow);
}

.feedback {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
}

.feedback.ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid #22c55e;
  color: var(--text);
}

.feedback.no {
  background: var(--danger-glow);
  border: 1px solid var(--danger);
  color: var(--text);
}

/* ===== Modais & Toasts ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 15, 0.75);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
  animation: fadeIn 0.2s ease-out;
}

.modal .box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tabs button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s ease;
  color: var(--muted);
}

.tabs button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tabs button.active {
  background: var(--gold-gradient);
  color: #090a0f;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--gold-glow);
}

.thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--gold);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  z-index: 99;
  box-shadow: 0 10px 30px var(--gold-glow);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsividade ===== */
@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    z-index: 50;
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  
  #btnMenu {
    display: grid;
  }
  
  .backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 10, 15, 0.7);
    backdrop-filter: blur(4px);
    z-index: 40;
  }

  .podium-grid {
    grid-template-columns: 1fr;
  }

  .podium-card.first {
    order: -1;
    transform: none;
  }

  .streak-grid {
    grid-template-columns: repeat(10, 1fr);
  }
  
  .timer {
    font-size: 52px;
  }
  
  .content {
    padding: 18px;
  }
  
  .cal .day {
    min-height: 60px;
  }
}

@media (max-width: 600px) {
  .g4, .g3, .g2 {
    grid-template-columns: 1fr;
  }

  .streak-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .topbar {
    padding: 12px 16px;
  }
  
  .content {
    padding: 14px;
  }
  
  .timer {
    font-size: 42px;
  }
  
  .cal .day {
    min-height: 48px;
    padding: 4px;
    font-size: 10.5px;
  }
}

/* Planos semanais, estados de interação e acabamento responsivo */
.weekly-plan, .admin-plan-preview { display: grid; gap: 18px; border-color: color-mix(in srgb, var(--gold) 24%, var(--border)); }
.weekly-plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.weekly-plan-heading .tit { margin: 9px 0 5px; }
.weekly-plan-total { min-width: 88px; display: grid; justify-items: center; gap: 2px; padding: 12px; border-radius: 16px; color: var(--gold); background: var(--gold-light); }
.weekly-plan-total strong { font-size: 25px; line-height: 1.1; }
.weekly-plan-total span, .weekly-plan-stats span { color: var(--muted); font-size: 12px; }
.weekly-plan-progress { height: 9px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.weekly-plan-progress span { display: block; height: 100%; border-radius: inherit; background: var(--gold-gradient); transition: width .35s ease; }
.weekly-plan-stats { gap: 10px; }
.weekly-plan-stats > div { display: grid; gap: 3px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.weekly-plan-stats b { font-size: 17px; }
.weekly-days, .admin-plan-activities { display: grid; gap: 12px; }
.weekly-day { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.weekly-day-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.weekly-day-heading h4 { margin: 0 0 3px; }
.weekly-activity { display: flex; align-items: flex-start; gap: 11px; padding: 12px 4px; border-top: 1px solid var(--border); cursor: pointer; }
.weekly-activity input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); }
.weekly-activity-main { display: grid; gap: 3px; }
.weekly-activity-main small { color: var(--muted); line-height: 1.55; }
.weekly-activity-actual { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.weekly-activity-actual label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.weekly-activity-actual input { width: 100px; padding: 6px 8px; font-size: 12px; }
.weekly-activity input:checked + .weekly-activity-main b { color: var(--muted); text-decoration: line-through; }
.weekly-plan-footnote { font-size: 12px; }
.weekly-plan-empty { display: flex; align-items: center; gap: 18px; padding: 24px; }
.weekly-plan-icon { display: grid; place-items: center; flex: 0 0 58px; height: 58px; border-radius: 18px; background: var(--gold-light); font-size: 26px; }
.weekly-plan-empty .tit { margin: 8px 0 4px; }
.admin-plan-preview { margin-top: 14px; }
.admin-plan-activity { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.admin-plan-day input, .admin-plan-day select { min-width: 0; width: 100%; }
.admin-plan-preview [data-publish-plan] { justify-self: start; }
.notice.success { padding: 14px 16px; border: 1px solid color-mix(in srgb, #2f855a 42%, var(--border)); border-radius: 12px; color: var(--text); background: color-mix(in srgb, #2f855a 12%, var(--surface)); }
button:disabled, .btn:disabled { cursor: not-allowed; opacity: .58; transform: none; box-shadow: none; }
button, .btn, .card, .weekly-day, input, select, textarea { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.card:hover { transform: translateY(-1px); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 72%, transparent); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--gold-glow); }
@media (max-width: 700px) {
  .weekly-plan-heading { gap: 10px; }
  .weekly-plan-stats { grid-template-columns: 1fr; }
  .weekly-plan-empty { align-items: flex-start; padding: 18px; }
  .weekly-day { padding: 12px; }
  .admin-plan-preview .grid.g2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== Marca com foto ===== */
.logo-foto {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  border: 2px solid var(--gold, #22c55e);
  box-shadow: 0 4px 15px var(--gold-glow, rgba(34,197,94,.35));
}
.logo-foto.sm { width: 34px; height: 34px; border-width: 1.5px; }
.hidden { display: none !important; }

/* ===== Conteúdo formatado (questões e resoluções) ===== */
.conteudo-rico { line-height: 1.65; font-size: 14.5px; word-break: break-word; }
.conteudo-rico img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.conteudo-rico iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; margin: 8px 0; }
.questao-imagem { display: block; max-width: 100%; max-height: 360px; border-radius: var(--radius-sm); margin: 10px 0; border: 1px solid var(--border); }

/* ===== Editor de texto rico ===== */
.editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 6px; }
.editor-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.editor-bar button, .editor-bar select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 9px; font-size: 12.5px; cursor: pointer; margin: 0;
}
.editor-bar button:hover { border-color: var(--gold, #22c55e); }
.editor-bar input[type="color"] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.editor-area { padding: 12px; outline: none; background: var(--surface); font-size: 14.5px; line-height: 1.6; }
.editor-area img { max-width: 100%; border-radius: 10px; }
.editor-area iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; }

/* ===== Comentários das questões ===== */
.comentarios { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 12px; }
.com-head { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.com-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; }
.com-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.com-form textarea { flex: 1; margin: 0; }

/* ===== Importador de Questões com IA ===== */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s, transform 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--gold, #22c55e);
  background: var(--surface-hover);
  transform: scale(1.005);
}
.dropzone .ico-cloud {
  font-size: 38px;
  margin-bottom: 10px;
  display: block;
}
.badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.revisao-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.revisao-card:hover {
  border-color: var(--gold, #22c55e);
}
.revisao-card.rejeitado {
  opacity: 0.5;
  filter: grayscale(0.8);
  border-style: dashed;
}
.revisao-card.aprovado {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.04);
}
.gabarito-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 12.5px;
}
.gabarito-pill.confiavel {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.gabarito-pill.atencao {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

/* ===== Reprodutor de Vídeos e Comentários ===== */
.modal .box.box-lg {
  max-width: 960px;
}
.modal .box.box-xl {
  max-width: 1140px;
}

.video-responsive-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000;
}
.video-responsive-wrap iframe,
.video-responsive-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-player-inline {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #000;
  max-height: 240px;
}

.video-comments-wrap {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-body {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.5;
}
.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
  gap: 8px;
}

/* ===== Metas do Aluno ===== */
.metas-mentor-banner {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(212, 160, 23, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
}

/* ===== Relatório do Aluno (ADM) ===== */
.relatorio-folha {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
.relatorio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.relatorio-stat-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}
.relatorio-secao {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.ponto-melhorar-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border-left: 4px solid var(--danger, #ef4444);
  margin-bottom: 8px;
}
.ponto-forte-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border-left: 4px solid var(--accent, #22c55e);
  margin-bottom: 8px;
}

/* ===== Impressão (Print) ===== */
@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
  }
  #sidebar,
  .topbar,
  .tabs,
  .no-print,
  button,
  .icon-btn,
  .toast {
    display: none !important;
  }
  #app,
  .main,
  .content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .relatorio-folha {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
    color: #111111 !important;
  }
  .card,
  .relatorio-stat-pill,
  .ponto-melhorar-item,
  .ponto-forte-item {
    border: 1px solid #d1d5db !important;
    background: #ffffff !important;
    color: #111111 !important;
    box-shadow: none !important;
  }
  .badge {
    border: 1px solid #6b7280 !important;
    color: #111111 !important;
    background: transparent !important;
  }
  .tit, h2, h3, h4, b, strong {
    color: #111111 !important;
  }
  .muted, .lbl, .d {
    color: #4b5563 !important;
  }
  .progress {
    border: 1px solid #d1d5db !important;
    background: #e5e7eb !important;
  }
  .progress i {
    background: #374151 !important;
  }
  table th {
    background: #f3f4f6 !important;
    color: #111111 !important;
    border-color: #d1d5db !important;
  }
  table td {
    border-color: #e5e7eb !important;
    color: #111111 !important;
  }
}


/* --- Pesquisa Global --- */
.busca-global {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.busca-global > input {
  width: clamp(160px, 24vw, 320px);
  height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font: inherit;
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}

.busca-global > input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}

.busca-global-resultados {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, 88vw);
  max-height: min(65vh, 480px);
  overflow-y: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .2);
  z-index: 100;
}

.busca-global-resultados[hidden] {
  display: none;
}

.busca-global-item {
  display: block;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.busca-global-item:hover,
.busca-global-item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.busca-global-tipo {
  display: block;
  margin-bottom: 3px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.busca-global-titulo {
  display: block;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.busca-global-vazio {
  padding: 16px 12px;
  color: var(--text-muted, var(--text));
  font-size: 13px;
}

@media (max-width: 600px) {
  .topbar {
    gap: 8px;
    padding: 10px 12px;
  }

  .topbar .tools {
    gap: 6px;
  }

  .busca-global {
    gap: 4px;
  }

  .busca-global > input {
    width: clamp(90px, 27vw, 160px);
    padding: 0 8px;
    font-size: 12px;
  }

  .busca-global .icon-btn {
    width: 36px;
    height: 40px;
  }
}
