/* ============================================================================
   DESIGN SYSTEM — LIGHT THEME (FUNDO BRANCO CLEAN & PALETA DO LOGO)
   ============================================================================ */

:root {
  /* Fundo Branco e Superfícies Suaves */
  --bg: #FDFBFE;               /* Fundo Principal Off-White/Branco Leve */
  --surface: #FFFFFF;          /* Cards, Sidebar e Topbar em Branco Puro */
  --surface-alt: #F4EEF8;      /* Superfície Alternativa / Hover / Inputs */
  --border: #E5D6EE;           /* Bordas Suaves em Tom Lavanda */
  --shadow: 0 4px 20px rgba(112, 11, 117, 0.07); /* Sombra Leve Púrpura */
  
  /* Cores da Marca (Extraídas do Logo) */
  --brand-purple: #700B75;     /* Púrpura Nobre Oficial */
  --brand-mauve: #A5538D;      /* Mauve Berry Oficial */
  
  /* Acentos no Tema Claro */
  --signal: #C026D3;           /* Sinal Magenta Vibrante (Barras de Sinal) */
  --signal-dim: #F3E8FF;       /* Fundo de Acento Suave */
  --warm: #D946EF;             /* Pontuação e Destaques */
  --purple-light: #FAE8FF;     /* Tag Background */
  
  /* Tipografia em Alto Contraste */
  --text: #210626;             /* Texto Principal (Púrpura Escuro Quase Preto) */
  --muted: #6B547C;            /* Texto Secundário Legível */
  --danger: #DC2626;           /* Alertas */
  --radius: 14px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.mono { font-family: 'JetBrains Mono', monospace; }
.display { font-family: 'Chakra Petch', sans-serif; }

/* ============ TELA DE LOGIN & BRAND PANEL ============ */
#login-screen {
  display: flex;
  min-height: 100vh;
}

.brand-panel {
  flex: 1.1;
  position: relative;
  background: linear-gradient(135deg, #F8F1FC 0%, #EFE2F7 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 56px;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.brand-panel svg.network-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
}

.node { fill: var(--brand-purple); opacity: 0.85; }
.node-pulse {
  transform-origin: center;
}

.link-line {
  stroke: var(--brand-mauve);
  stroke-width: 1;
  opacity: .35;
}
.link-line.active {
  opacity: .55;
  stroke: var(--brand-purple);
  stroke-dasharray: 4 6;
}

.brand-top { position: relative; z-index: 2; }
.brand-mark {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: .06em;
  color: var(--brand-purple); text-transform: uppercase;
}

.logo-icon-svg {
  width: 38px; height: 38px; flex-shrink: 0;
}

.brand-mid { position: relative; z-index: 2; max-width: 480px; margin-top: auto; margin-bottom: auto; }
.brand-mid h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 42px; font-weight: 700; line-height: 1.08;
  letter-spacing: -.01em; color: var(--text);
}
.brand-mid h1 span {
  color: var(--brand-purple);
}
.brand-mid p { margin-top: 16px; color: var(--muted); font-size: 15px; line-height: 1.6; }

.brand-bottom { position: relative; z-index: 2; display: flex; gap: 32px; }
.stat-mini .num { font-family: 'JetBrains Mono', monospace; font-size: 24px; font-weight: 700; color: var(--brand-purple); }
.stat-mini .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

.form-panel {
  flex: .85;
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: #FFFFFF;
}
.login-card { width: 100%; max-width: 400px; }
.login-card .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--brand-purple); letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
}
.login-card h2 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 28px; margin-top: 8px; margin-bottom: 6px; color: var(--text);
}
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
}
.field input, .field select {
  width: 100%; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 14px; color: var(--text); font-size: 14px;
  font-family: 'Inter', sans-serif; transition: border-color .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand-purple); background: #FFFFFF; box-shadow: 0 0 0 3px rgba(112, 11, 117, 0.12); }
.field input::placeholder { color: #A08DB5; }

.btn-primary {
  width: 100%; padding: 14px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-mauve));
  color: #FFFFFF; font-weight: 700; font-size: 14px;
  font-family: 'Chakra Petch', sans-serif; letter-spacing: .03em; text-transform: uppercase;
  cursor: pointer; transition: transform .1s, box-shadow .15s; margin-top: 6px;
}
.btn-primary:hover { box-shadow: 0 4px 15px rgba(112, 11, 117, 0.3); }
.btn-primary:active { transform: scale(.98); }

.login-hint {
  margin-top: 20px; font-size: 12px; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 10px; line-height: 1.6;
}
.login-hint b { color: var(--text); }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; display: none; }

/* ============ NAVEGAÇÃO & TOPBAR ============ */
#dashboard { display: none; min-height: 100vh; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 24px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* BARRAS DE SINAL NO TEMA CLARO */
.signal-indicator {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-alt); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--brand-purple);
}
.signal-bars-box { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.signal-bars-box span { width: 3px; border-radius: 1px; background: #D1C4E0; display: block; }

.signal-bars-box.level-1 span:nth-child(1) { background: var(--brand-purple); height: 30%; }
.signal-bars-box.level-2 span:nth-child(1), .signal-bars-box.level-2 span:nth-child(2) { background: var(--brand-purple); }
.signal-bars-box.level-2 span:nth-child(1) { height: 30%; } .signal-bars-box.level-2 span:nth-child(2) { height: 55%; }
.signal-bars-box.level-3 span:nth-child(1), .signal-bars-box.level-3 span:nth-child(2), .signal-bars-box.level-3 span:nth-child(3) { background: var(--brand-purple); }
.signal-bars-box.level-3 span:nth-child(1) { height: 30%; } .signal-bars-box.level-3 span:nth-child(2) { height: 55%; } .signal-bars-box.level-3 span:nth-child(3) { height: 80%; }
.signal-bars-box.level-4 span, .signal-bars-box.level-5 span { background: var(--brand-purple); }
.signal-bars-box span:nth-child(1) { height: 30%; }
.signal-bars-box span:nth-child(2) { height: 55%; }
.signal-bars-box span:nth-child(3) { height: 80%; }
.signal-bars-box span:nth-child(4) { height: 100%; }

.xp-badge {
  background: var(--purple-light); border: 1px solid rgba(112, 11, 117, 0.2);
  color: var(--brand-purple); padding: 5px 12px; border-radius: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
}

.role-switcher {
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; font-weight: 500;
}

.user-box { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-mauve));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Chakra Petch', sans-serif; font-weight: 700; color: #FFFFFF; font-size: 14px;
}
.logout-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 8px 14px; border-radius: 8px; font-size: 12px; cursor: pointer;
  transition: .15s;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); background: #FEE2E2; }

/* LAYOUT & SIDEBAR */
.layout { display: flex; flex: 1; }
.sidebar {
  width: 260px; border-right: 1px solid var(--border);
  padding: 24px 16px; background: var(--surface);
}
.sidebar-menu { display: flex; flex-direction: column; gap: 4px; }
.menu-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px; color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s;
}
.menu-btn:hover { background: var(--surface-alt); color: var(--brand-purple); }
.menu-btn.active {
  background: var(--purple-light); color: var(--brand-purple);
  border: 1px solid rgba(112, 11, 117, 0.25); font-weight: 700;
}

.main-content { flex: 1; padding: 32px 40px; background: var(--bg); }

/* CARDS E GRIDS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.stat-card .v { font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 700; }
.stat-card .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat-card.signal { background-color: #E8F8F0; border: 1px solid #B2F0D2; border-left: 4px solid #059669; }
.stat-card.signal .v { color: #059669; }
.stat-card.warm { background-color: #FAF3FC; border: 1px solid #E5C3EA; border-left: 4px solid var(--brand-purple); }
.stat-card.warm .v { color: var(--brand-purple); }
.stat-card.purple { background-color: #EEF4FF; border: 1px solid #C7D8FF; border-left: 4px solid #2563EB; }
.stat-card.purple .v { color: #2563EB; }
.stat-card.orange { background-color: #FFF7ED; border: 1px solid #FFEDD5; border-left: 4px solid #EA580C; }
.stat-card.orange .v { color: #EA580C; }
.stat-card.gold { background-color: #FEFCE8; border: 1px solid #FEF9C3; border-left: 4px solid #CA8A04; }
.stat-card.gold .v { color: #CA8A04; }

.section-header { margin-bottom: 24px; }
.section-header h2 { font-family: 'Chakra Petch', sans-serif; font-size: 22px; font-weight: 700; color: var(--text); }
.section-header p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.trilhas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.trilha-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #EDE4F5;
  border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: 0 4px 15px rgba(112, 11, 117, 0.02);
  overflow: hidden;
}
.trilha-card:hover {
  transform: translateY(-4px);
  border-color: rgba(112, 11, 117, 0.15);
  box-shadow: 0 10px 25px rgba(112, 11, 117, 0.06);
}
.trilha-card .tag {
  align-self: flex-start; background: var(--purple-light); color: var(--brand-purple);
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; text-transform: uppercase; border: 1px solid rgba(112, 11, 117, 0.2);
}
.trilha-card h3 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1e1b4b;
}
.trilha-card p {
  color: #52525b;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.progress-bar-container {
  background: #f5f2f9;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar-fill {
  background: var(--brand-purple);
  height: 100%;
  width: 0%;
  transition: width .4s ease;
}

.btn-open-trilha {
  width: 100%;
  padding: 12px;
  background: rgba(112, 11, 117, 0.05);
  border: 1px solid rgba(112, 11, 117, 0.03);
  border-radius: 10px;
  color: var(--brand-purple);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-open-trilha:hover {
  background: rgba(112, 11, 117, 0.09);
  color: var(--brand-purple);
}
.btn-open-trilha:active {
  transform: scale(0.98);
}

/* BADGES SHOWCASE */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.badge-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 10px; opacity: .5; filter: grayscale(1);
  transition: .2s; box-shadow: var(--shadow);
}
.badge-card.unlocked { opacity: 1; filter: grayscale(0); border-color: var(--brand-mauve); background: #FAF5FD; }
.badge-icon {
  width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-purple), var(--brand-mauve));
  display: flex; align-items: center; justify-content: center; font-size: 24px; color: #FFF; border: 2px solid #FFF;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.badge-card h4 { font-size: 14px; font-weight: 700; color: var(--text); }
.badge-card p { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* LEADERBOARD & TABLES */
.leaderboard-table, .analytics-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.leaderboard-table th, .analytics-table th {
  background: var(--surface-alt); padding: 14px 18px; text-align: left;
  font-size: 12px; color: var(--brand-purple); text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.leaderboard-table td, .analytics-table td {
  padding: 16px 18px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text);
}
.rank-num { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--brand-purple); }

/* MODAL SALA DE TREINAMENTO E QUIZ (CLEAN LIGHT THEME) */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(33, 6, 38, 0.5); backdrop-filter: blur(6px);
  z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-container {
  background: #FFFFFF; border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 860px; max-height: 90vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 20px 60px rgba(112, 11, 117, 0.2);
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; background: var(--surface-alt);
}
.modal-header h3 { font-family: 'Chakra Petch', sans-serif; font-size: 18px; color: var(--brand-purple); font-weight: 700; }
.close-modal-btn { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.close-modal-btn:hover { color: var(--danger); }

.modal-body { padding: 24px; overflow-y: auto; flex: 1; background: #FFFFFF; }
.video-frame { width: 100%; aspect-ratio: 16/9; border-radius: 10px; border: none; background: #000; }
.lesson-text-body { font-size: 15px; line-height: 1.7; color: var(--text); }
.lesson-text-body h3 { color: var(--brand-purple); margin: 18px 0 10px; font-family: 'Chakra Petch', sans-serif; }
.lesson-text-body ul, .lesson-text-body ol { padding-left: 20px; margin-bottom: 14px; }
.lesson-text-body li { margin-bottom: 6px; }

.quiz-box { background: var(--surface-alt); border: 1px solid var(--border); padding: 24px; border-radius: 12px; margin-top: 16px; }
.quiz-question { font-weight: 700; font-size: 16px; margin-bottom: 16px; color: var(--text); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  background: #FFFFFF; border: 1px solid var(--border); padding: 14px;
  border-radius: 8px; cursor: pointer; transition: .15s; font-size: 14px; color: var(--text);
}
.quiz-option:hover { border-color: var(--brand-purple); background: #FAF5FD; }
.quiz-option.selected { border-color: var(--brand-purple); background: var(--purple-light); font-weight: 600; }

.btn-finish-lesson {
  margin-top: 24px; width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-mauve));
  color: #FFFFFF; font-weight: 700; border: none; border-radius: 10px;
  font-family: 'Chakra Petch', sans-serif; font-size: 14px; text-transform: uppercase;
  cursor: pointer; transition: .15s;
}
.btn-finish-lesson:hover { box-shadow: 0 4px 15px rgba(112, 11, 117, 0.3); }

/* RESPONSIVIDADE */
@media (max-width: 860px) {
  #login-screen { flex-direction: column; }
  .brand-panel { padding: 32px; min-height: 280px; }
  .sidebar { display: none; }
  .main-content { padding: 20px; }
  .topbar { padding: 14px 18px; }
}

/* TOAST NOTIFICATIONS */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
}
.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  min-width: 300px;
  max-width: 450px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.success {
  border-left: 4px solid #059669;
}
.toast.error {
  border-left: 4px solid var(--danger);
}
.toast.info {
  border-left: 4px solid var(--brand-purple);
}
.toast.warning {
  border-left: 4px solid var(--warm);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@keyframes fadeOutToast {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* FLOATING MODAL OVERLAY */
.floating-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(10, 14, 26, 0.4);
  backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: center;
  z-index: 100000;
  animation: fadeInBackdrop 0.2s ease forwards;
}
.floating-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(112, 11, 117, 0.15);
  animation: scaleInBox 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.floating-box h3 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-purple);
  margin-bottom: 12px;
}
.floating-box p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.floating-box .btn-close {
  padding: 10px 28px;
  background: var(--brand-purple);
  color: #fff;
  border: 1px solid var(--brand-purple);
  border-radius: 8px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.floating-box .btn-close:hover {
  background: var(--brand-mauve);
  border-color: var(--brand-mauve);
  box-shadow: 0 4px 12px rgba(112, 11, 117, 0.25);
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleInBox {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* VERTICAL COURSE CARDS GRID */
.courses-grid-vertical {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: flex-start;
  margin-top: 16px;
}
.vertical-course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}
.vertical-course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(112, 11, 117, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}
.vertical-course-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: var(--surface-alt);
}
.vertical-course-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-mauve));
  display: flex;
  align-items: center;
  justify-content: center;
}
.vertical-course-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}
.vertical-course-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}
.vertical-course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.vertical-course-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--surface-alt);
}
.vertical-course-card.expanded .vertical-course-drawer {
  max-height: 1200px;
  border-top: 1px solid var(--border);
}
.vertical-lessons-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vertical-lesson-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  transition: border-color 0.2s;
}
.vertical-lesson-item:hover {
  border-color: var(--brand-purple);
}
.vertical-lesson-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.vertical-lesson-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-mauve);
}
.vertical-lesson-badge.quiz {
  color: var(--warm);
}
.vertical-lesson-title {
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.vertical-lesson-btn {
  background: var(--purple-light);
  color: var(--brand-purple);
  border: 1px solid rgba(112, 11, 117, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
}
.vertical-lesson-btn:hover {
  background: var(--brand-purple);
  color: #fff;
}
.vertical-lesson-btn.done {
  background: rgba(0, 229, 160, 0.15);
  color: #059669;
  border-color: rgba(0, 229, 160, 0.25);
}
.vertical-lesson-btn.done:hover {
  background: #059669;
  color: #fff;
}

/* COURSE DETAIL MODAL */
.course-modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(10, 14, 26, 0.4);
  backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: center;
  z-index: 99990;
  animation: fadeInBackdrop 0.25s ease forwards;
}
.course-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(112, 11, 117, 0.15);
  animation: scaleInBox 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  overflow: hidden;
}
.course-modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.course-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: var(--surface-alt);
}

/* NEW LESSON ROW STYLE (YOUTUBE/NETFLIX PATTERN WITH TIMELINE) */
.course-modal-box {
  max-width: 660px;
}
.vertical-lessons-list {
  padding: 16px 36px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.vertical-lessons-list::after {
  content: '';
  position: absolute;
  right: 17px;
  top: 36px;
  bottom: 36px;
  width: 2px;
  background: var(--border);
  z-index: 1;
}
.new-lesson-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  position: relative;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.new-lesson-row:hover {
  background: var(--surface-alt);
  border-color: var(--brand-purple);
  transform: translateX(4px);
}
.new-lesson-row.locked {
  cursor: not-allowed;
  opacity: 0.75;
}
.new-lesson-row.locked:hover {
  transform: none;
  background: #FFFFFF;
  border-color: var(--border);
}
.lesson-row-thumb {
  width: 90px;
  height: 52px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.status-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.status-overlay.completed {
  background: rgba(5, 150, 105, 0.75);
}
.status-overlay.completed svg {
  background: #059669;
  border-radius: 50%;
  padding: 2px;
}
.status-overlay.locked {
  background: rgba(10, 14, 26, 0.65);
  backdrop-filter: blur(1px);
}
.lesson-row-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lesson-row-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lesson-icon {
  color: var(--brand-purple);
  display: flex;
  align-items: center;
}
.lesson-row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.lesson-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.lesson-row-info {
  color: var(--brand-purple);
  opacity: 0.5;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  margin-right: 8px;
}
.new-lesson-row:hover .lesson-row-info {
  opacity: 1;
}
.lesson-row-node {
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-purple);
  border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  z-index: 3;
  transition: background 0.2s;
}
.new-lesson-row:hover .lesson-row-node {
  background: var(--brand-mauve);
}
.new-lesson-row.locked .lesson-row-node {
  background: var(--border);
}

/* COURSE MODAL TABS */
.course-modal-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  padding: 0 24px;
  background: var(--surface);
}
.course-tab-btn {
  background: none;
  border: none;
  padding: 14px 20px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.course-tab-btn:hover {
  color: var(--brand-purple);
}
.course-tab-btn.active {
  color: var(--brand-purple);
}
.course-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-purple);
  border-radius: 2px 2px 0 0;
}

/* MATERIALS LIST */
.materials-list-container {
  padding: 20px 24px;
}
.materials-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  font-family: 'Chakra Petch', sans-serif;
}
.material-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.material-row:hover {
  border-color: var(--brand-purple);
  background: var(--surface-alt);
}
.material-icon-box {
  width: 38px;
  height: 38px;
  background: #FEE2E2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EF4444;
}
.material-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.material-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.material-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.material-size-badge {
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

/* LOCK STATE FOR MATERIALS */
.materials-lock-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 14px;
}
.lock-illustration {
  width: 64px;
  height: 64px;
  background: rgba(255, 180, 84, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm);
  font-size: 28px;
}
.lock-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.lock-desc {
  font-size: 13px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.4;
  margin: 0;
}

.draggable-row {
  cursor: grab;
  user-select: none;
}
.draggable-row:active {
  cursor: grabbing;
}
.draggable-row.dragging {
  opacity: 0.4;
  background: var(--purple-light) !important;
}
.draggable-row.drag-over {
  border-bottom: 2px solid var(--brand-purple) !important;
}

/* ============================================================================
   ESTILOS DE KPIS PERSONALIZADOS (ALTA FIDELIDADE)
   ============================================================================ */
.stat-card-kpi {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: var(--surface);
  min-height: 94px;
  box-sizing: border-box;
}

.stat-card-kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.06);
}

.stat-card-kpi .kpi-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 2;
  position: relative;
}

.stat-card-kpi .kpi-left .v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat-card-kpi .kpi-left .l {
  font-size: 10px;
  color: var(--text);
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

/* Cores e Bordas */
.stat-card-kpi.kpi-green {
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.45) 0%, rgba(209, 250, 229, 0.12) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
}
.stat-card-kpi.kpi-green .kpi-left .v {
  color: #10B981;
}

.stat-card-kpi.kpi-blue {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.45) 0%, rgba(219, 234, 254, 0.12) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.35);
}
.stat-card-kpi.kpi-blue .kpi-left .v {
  color: #3B82F6;
}

.stat-card-kpi.kpi-orange {
  background: linear-gradient(135deg, rgba(254, 215, 170, 0.45) 0%, rgba(254, 215, 170, 0.12) 100%);
  border: 1.5px solid rgba(249, 115, 22, 0.35);
}
.stat-card-kpi.kpi-orange .kpi-left .v {
  color: #F97316;
}

.stat-card-kpi.kpi-gold {
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.45) 0%, rgba(254, 240, 138, 0.12) 100%);
  border: 1.5px solid rgba(234, 179, 8, 0.35);
}
.stat-card-kpi.kpi-gold .kpi-left .v {
  color: #D97706;
}

/* Watermarks e Badges */
.kpi-right-container {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.kpi-watermark {
  position: absolute;
  right: -8px;
  bottom: -10px;
  opacity: 0.14;
  pointer-events: none;
  z-index: 1;
}

.kpi-badge {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background: #fff;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.kpi-badge.badge-blue {
  color: #3B82F6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.35);
}

.kpi-badge.badge-orange {
  color: #F97316;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.35);
}

.kpi-badge.badge-gold {
  color: #D97706;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.35);
}

/* ============================================================================
   ESTILOS DE BANNER ROTATIVO (CAROUSEL)
   ============================================================================ */
.kpi-banner-carousel {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.kpi-banner-carousel {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  aspect-ratio: 24/5;
}

.kpi-banner-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.kpi-banner-slide {
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.5s ease-in-out;
  padding: 0;
  overflow: hidden;
}

.kpi-banner-slide.active {
  opacity: 1;
  z-index: 2;
  position: relative;
}

.kpi-banner-img-responsive {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kpi-banner-dots {
  position: absolute;
  right: 24px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.banner-dot {
  width: 24px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, width 0.3s;
}

.banner-dot.active {
  width: 32px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* ESTILOS DE LOGIN CUSTOMIZADOS (IMAGEM METRICA DE ACESSO) */
.btn-login {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-mauve)) !important;
}
.btn-login:hover {
  box-shadow: 0 4px 15px rgba(112, 11, 117, 0.3) !important;
}
.password-toggle-btn {
  transition: color 0.15s;
}
.password-toggle-btn:hover {
  color: var(--brand-purple) !important;
}
.input-with-icon input:focus {
  border-color: var(--brand-purple) !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px rgba(112, 11, 117, 0.12) !important;
}

 