/* ─── Universidade Donum — Estilos Globais ─────────────────────────────────── */

/* Importar fonte Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Variáveis — Identidade Visual Donum ──────────────────────────────────── */
:root {
  /* Cores primárias Donum */
  --primary: #296dfe;
  --primary-dark: #0b0e3c;
  --primary-cta: #056cfb;
  --primary-navy: #2C2E4A;

  /* Cores de ação */
  --success: #22c15e;
  --success-alt: #61a229;
  --warning: #ff7f00;
  --danger: #e74c3c;

  /* Backgrounds — Donum blue theme */
  --bg: #0a0d2e;
  --bg-white: #111540;
  --bg-card: #151948;
  --bg-input: #1a1f52;
  --bg-sidebar: #0e1138;

  /* Bordas */
  --border: #252a5e;
  --border-light: #1e2355;

  /* Textos */
  --text: #e8eaf0;
  --text-body: #c8ccd8;
  --text-muted: #7b82a8;
  --text-dim: #5a6190;

  /* Efeitos */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 8px 24px rgba(41, 109, 254, 0.3);
  --transition: 0.2s ease;

  /* Compat legado */
  --blue: #296dfe;
  --blue-dark: #1a4fcf;
  --blue-light: rgba(41, 109, 254, 0.12);
  --navy: #0b0e3c;
  --surface: #111540;
  --error: #e74c3c;
  --gold: var(--primary);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-cta); }

button { cursor: pointer; font-family: inherit; }

h1, h2, h3, h4, h5, h6 { color: var(--text); }

input, select, textarea {
  font-family: inherit;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text-body);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  width: 100%;
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(41, 109, 254, 0.12);
}

input::placeholder { color: var(--text-dim); }

select option { background: var(--bg-white); color: var(--text-body); }

/* ─── Botões ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-cta));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(41, 109, 254, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-cta), #0260e8);
  box-shadow: 0 6px 20px rgba(41, 109, 254, 0.45);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--success), var(--success-alt));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(34, 193, 94, 0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #1daa52, #528f22);
  box-shadow: 0 6px 16px rgba(34, 193, 94, 0.4);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(41, 109, 254, 0.05);
}

.btn-danger {
  background: rgba(231, 76, 60, 0.08);
  border: 1.5px solid rgba(231, 76, 60, 0.25);
  color: #e74c3c;
}
.btn-danger:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: #e74c3c;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
}
.btn-ghost:hover {
  background: rgba(41, 109, 254, 0.08);
  color: var(--text);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled, .btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  background: var(--border);
  color: var(--text-muted);
}

/* ─── Header ────────────────────────────────────────────────────────────────── */

.header {
  background: var(--primary-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(11, 14, 60, 0.25);
}

/* Compat: header-inner para admin */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-logo img { height: 36px; border-radius: 6px; }

.header-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-logo-icon img { height: 38px; width: auto; max-width: 120px; object-fit: contain; border-radius: 0; filter: brightness(0) invert(1); }

.header-logo-text {
  display: flex;
  flex-direction: column;
}

.header-logo-text span:first-child {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.header-logo-text span:last-child {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-cta));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.header-user-info {
  display: flex;
  flex-direction: column;
}

.header-user-info span:first-child {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.header-user-info span:last-child {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* ─── Página de Login ───────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, #112263 50%, var(--primary) 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(41, 109, 254, 0.2), transparent 70%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(5, 108, 251, 0.15), transparent 70%);
  pointer-events: none;
}

.login-card,
.login-container {
  background: rgba(21, 25, 72, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(41, 109, 254, 0.2);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo img {
  max-width: 180px;
  height: auto;
  margin-bottom: 16px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-cta));
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(41, 109, 254, 0.35);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-logo h1 span { color: var(--primary); }

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
  margin-top: -24px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text-body);
}

.login-error {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: #e74c3c;
  display: none;
}

.login-error.show { display: block; }

/* Alerts (compat) */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #e74c3c;
}
.alert-success {
  background: rgba(34, 193, 94, 0.08);
  border: 1px solid rgba(34, 193, 94, 0.25);
  color: var(--success);
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Layout Principal ──────────────────────────────────────────────────────── */

.main-layout,
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── Dashboard ─────────────────────────────────────────────────────────────── */

.dashboard-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #112263 60%, var(--primary) 100%);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(11, 14, 60, 0.18);
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(41, 109, 254, 0.2), transparent 70%);
  pointer-events: none;
}

.dashboard-hero h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}

.dashboard-hero p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
  font-size: 15px;
}

/* Barra de progresso */
.progress-container {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-cta));
  border-radius: 100px;
  transition: width 0.8s ease;
  box-shadow: 0 0 8px rgba(41, 109, 254, 0.5);
}

.progress-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.progress-label strong { color: #ffffff; }

/* Seção de módulos */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition);
}

.module-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.module-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.module-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.module-badge {
  background: rgba(41, 109, 254, 0.08);
  border: 1px solid rgba(41, 109, 254, 0.2);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Cards de aulas — novo estilo */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.lesson-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: var(--shadow-card);
}

.lesson-card:hover:not(.locked) {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}

.lesson-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.lesson-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary-dark), #112263);
  position: relative;
  overflow: hidden;
}

.lesson-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--primary-dark), #1a2a6c);
}

.lesson-status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  backdrop-filter: blur(4px);
}

.lesson-status-badge.completed { background: rgba(34, 193, 94, 0.92); }
.lesson-status-badge.in-progress { background: rgba(41, 109, 254, 0.9); }
.lesson-status-badge.locked { background: rgba(154, 155, 160, 0.85); }

.lesson-info { padding: 12px; }

.lesson-number {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lesson-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.lesson-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.lesson-progress-mini {
  height: 3px;
  background: var(--border);
  border-radius: 100px;
  margin-top: 8px;
  overflow: hidden;
}

.lesson-progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-cta));
  border-radius: 100px;
}

/* ─── Aulas grid (compat legado) ─────────────────────────────────────────────── */
.aulas-grid { display: flex; flex-direction: column; gap: 12px; }
.aula-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition);
}
.aula-card:hover { box-shadow: var(--shadow-hover); }
.aula-concluida { border-left: 4px solid var(--success); }
.aula-disponivel { border-left: 4px solid var(--primary); }
.aula-bloqueada { opacity: 0.55; border-left: 4px solid var(--border); }
.aula-numero {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(41, 109, 254, 0.12);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.aula-concluida .aula-numero { background: rgba(34, 193, 94, 0.12); color: var(--success); }
.aula-info { flex: 1; }
.aula-info h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.aula-info p { font-size: 0.82rem; color: var(--text-muted); }
.aula-action { flex-shrink: 0; }

/* ─── Player de Vídeo ──────────────────────────────────────────────────────── */

.lesson-page { max-width: 1100px; margin: 0 auto; padding: 24px; }

.lesson-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  transition: color var(--transition);
}

.lesson-back:hover { color: var(--primary); }

.lesson-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.video-container,
.video-wrapper {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  position: relative;
}

.video-wrapper {
  aspect-ratio: 16/9;
}

.video-container video,
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

.video-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.video-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 8px;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-cta));
  transition: width 1s linear;
  border-radius: 100px;
}

.video-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.lesson-meta {
  margin-top: 20px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.lesson-meta h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.aula-titulo {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.lesson-meta-info {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.lesson-complete-banner {
  background: rgba(34, 193, 94, 0.07);
  border: 1px solid rgba(34, 193, 94, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.lesson-complete-banner span {
  font-size: 14px;
  color: var(--success);
  font-weight: 500;
}

/* Sidebar de aulas */
.lessons-sidebar {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: fit-content;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  background: var(--bg-white);
  color: var(--text);
}

.sidebar-lessons {
  overflow-y: auto;
  flex: 1;
}

.sidebar-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
  background: var(--bg-white);
}

.sidebar-lesson:hover:not(.locked) {
  background: rgba(41, 109, 254, 0.05);
  color: inherit;
}

.sidebar-lesson.active {
  background: rgba(41, 109, 254, 0.07);
  border-left: 3px solid var(--primary);
}

.sidebar-lesson.locked { opacity: 0.45; cursor: not-allowed; }

.sidebar-lesson-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--border);
  color: var(--text-muted);
}

.sidebar-lesson.completed .sidebar-lesson-num {
  background: rgba(34, 193, 94, 0.15);
  color: var(--success);
}

.sidebar-lesson.active .sidebar-lesson-num {
  background: var(--primary);
  color: white;
}

.sidebar-lesson-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
  color: var(--text-body);
}

.sidebar-lesson-icon { font-size: 14px; }

/* ─── Quiz ──────────────────────────────────────────────────────────────────── */

.quiz-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-card);
  margin-top: 24px;
}

.quiz-section h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--text);
}

.quiz-section > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.quiz-pergunta { margin-bottom: 28px; }

.quiz-pergunta p {
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text);
}

.quiz-opcao {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 8px;
  transition: background var(--transition), border-color var(--transition);
  color: var(--text-body);
  user-select: none;
}

.quiz-opcao:hover {
  background: rgba(41, 109, 254, 0.08);
  border-color: var(--primary);
}

.quiz-opcao input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
}

.quiz-opcao span {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.quiz-resultado {
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
}

.quiz-resultado.sucesso {
  background: rgba(34, 193, 94, 0.07);
  border: 1px solid rgba(34, 193, 94, 0.25);
}

.quiz-resultado.sucesso h3 { color: var(--success); margin-bottom: 8px; }

.quiz-resultado.erro {
  background: rgba(231, 76, 60, 0.07);
  border: 1px solid rgba(231, 76, 60, 0.25);
}

.quiz-resultado.erro h3 { color: #e74c3c; margin-bottom: 8px; }

.quiz-resultado p { color: var(--text-body); margin-bottom: 16px; }

/* ─── Admin Panel ───────────────────────────────────────────────────────────── */

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}

.admin-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.admin-tab:hover { color: var(--primary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-actions { display: flex; gap: 12px; margin-bottom: 24px; }

/* Tabela */
.table-container,
.table-wrapper { overflow-x: auto; }

.table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.data-table th,
.table th {
  background: var(--primary-dark);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table td,
.table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
}

.data-table tr:last-child td,
.table tr:last-child td { border-bottom: none; }

.data-table tbody tr:nth-child(even) td { background: rgba(41, 109, 254, 0.05); }

.data-table tr:hover td,
.table tr:hover td { background: rgba(41, 109, 254, 0.04); }

.table td small { color: var(--text-muted); font-size: 0.8rem; }

/* Badges e tags */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge-area { background: rgba(41, 109, 254, 0.12); color: var(--primary); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 4px;
}

.tag-success { background: rgba(34, 193, 94, 0.12); color: var(--success); }
.tag-info { background: rgba(41, 109, 254, 0.12); color: var(--primary); }
.tag-locked { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.role-Admin { background: rgba(255, 127, 0, 0.12); color: var(--warning); }
.role-CLT { background: rgba(41, 109, 254, 0.12); color: var(--primary); }
.role-Corretor { background: rgba(34, 193, 94, 0.12); color: var(--success); }
.role-Gerente { background: rgba(155, 89, 182, 0.12); color: #9b59b6; }
.role-Regional { background: rgba(231, 76, 60, 0.12); color: #e74c3c; }
.role-Engenharia { background: rgba(44, 46, 74, 0.1); color: var(--text); }

.progress-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.progress-mini-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-cta));
  border-radius: 100px;
}

.progress-mini-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 35px;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.stat-card-value,
.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-label,
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* Card genérico */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.card h3 { font-size: 1.1rem; margin-bottom: 20px; color: var(--text); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 60, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(11, 14, 60, 0.2);
  transform: translateY(16px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text); }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--danger); border-color: var(--danger); color: white; }

.modal-form { display: flex; flex-direction: column; gap: 14px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(11, 14, 60, 0.15);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
  color: var(--text-body);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(34, 193, 94, 0.4); color: var(--success); }
.toast.error { border-color: rgba(231, 76, 60, 0.4); color: #e74c3c; }

/* ─── Loading ───────────────────────────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  flex-direction: column;
  gap: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsivo ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .main-layout, .container { padding: 20px 16px; }
  .login-card, .login-container { padding: 32px 24px; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lessons-sidebar { max-height: 400px; }
  .lessons-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .header-user-info { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-hero { padding: 24px 20px; }
  .dashboard-hero h2 { font-size: 20px; }
  .data-table, .table { font-size: 13px; }
  .data-table th, .data-table td,
  .table th, .table td { padding: 10px 12px; }
  .admin-actions { flex-direction: column; }
}

@media (max-width: 640px) {
  .progress-banner { flex-direction: column; gap: 16px; text-align: center; }
  .aula-card { flex-wrap: wrap; }
  .login-container { margin: 16px; }
}

@media (max-width: 480px) {
  .lessons-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Utilitários ───────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.justify-between { justify-content: space-between; }

/* Scrollbar customizada */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
