/* ─── Oryon Academy — Design System ──────────────────────────────────────── */
:root {
  --roxo: #5722F7;
  --lilas: #8B6FF2;
  --lilas-cl: #EAE6FB;
  --g1: #FFFFFF;
  --g2: #F6F8FF;
  --g3: #EEF3FF;
  --g4: #E3EAFB;
  --text: #0B1F3B;
  --cinza: #3F5678;
  --cinza2: #5D7394;
  --borda: rgba(11,31,59,0.10);
  --shadow: 0 4px 24px rgba(11,31,59,0.08);
  --shadow-md: 0 8px 40px rgba(11,31,59,0.12);
  --shadow-lg: 0 20px 60px rgba(11,31,59,0.14);
  --radius: 16px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--g1);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.5;
}
body.login-page-body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(87,34,247,.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(87,34,247,.4); }

/* ─── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 { letter-spacing: -.02em; line-height: 1.15; }

/* ─── Shared Components ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: 100px; font-size: 14px; font-weight: 500;
  font-family: inherit; border: none; cursor: pointer; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; line-height: 1.25; }
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--roxo); color: #fff;
}
.btn-primary:hover { box-shadow: 0 8px 32px rgba(87,34,247,.4); background: var(--lilas); }
.btn-ghost {
  background: transparent; color: var(--cinza);
  border: 1px solid var(--borda);
}
.btn-ghost:hover { background: var(--g2); color: var(--text); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
.badge-purple { background: rgba(87,34,247,.1); color: var(--roxo); border: 1px solid rgba(87,34,247,.2); }
.badge-green  { background: rgba(16,185,129,.1); color: #059669; border: 1px solid rgba(16,185,129,.2); }
.badge-yellow { background: rgba(245,158,11,.1);  color: #D97706; border: 1px solid rgba(245,158,11,.2); }
.badge-red    { background: rgba(239,68,68,.1);   color: #DC2626; border: 1px solid rgba(239,68,68,.2); }
.badge-cyan   { background: rgba(6,182,212,.1);   color: #0891B2; border: 1px solid rgba(6,182,212,.2); }
.badge-pink   { background: rgba(233,30,140,.1);  color: #9C1060; border: 1px solid rgba(233,30,140,.2); }
.badge-indigo { background: rgba(99,102,241,.1);  color: #4F46E5; border: 1px solid rgba(99,102,241,.2); }

.progress-bar {
  height: 4px; background: var(--g3); border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--roxo), var(--lilas));
  transition: width .5s ease;
}

.dot-pulse {
  width: 5px; height: 5px; background: var(--roxo);
  border-radius: 50%; animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }
@keyframes fup { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from{opacity:0} to{opacity:1} }

/* ─── Login Page ──────────────────────────────────────────────────────────── */
@keyframes login-gradient-shift {
  0%, 100% { background-position: 0% 40%; }
  50% { background-position: 100% 60%; }
}
@keyframes login-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes login-float-glow {
  0%, 100% { opacity: 0.45; transform: translate(0, 0) scale(1); }
  50% { opacity: 0.75; transform: translate(12px, -8px) scale(1.05); }
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}
.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(32px, 5vh, 56px);
  padding: clamp(28px, 4vw, 48px);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(
    125deg,
    #07051a 0%,
    #12082e 18%,
    #2d0d8c 42%,
    var(--roxo) 62%,
    #1a0f4a 88%,
    #0a0618 100%
  );
  background-size: 220% 220%;
  animation: login-gradient-shift 22s ease-in-out infinite;
}
.login-left-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 45% 40%, black, transparent 72%);
  pointer-events: none;
  opacity: 0.9;
}
.login-left-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 111, 242, 0.45) 0%, rgba(87, 34, 247, 0.15) 40%, transparent 70%);
  top: -120px;
  right: -80px;
  pointer-events: none;
  animation: login-float-glow 14s ease-in-out infinite;
}
.login-left-glow--2 {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.2) 0%, transparent 65%);
  bottom: -60px;
  left: -40px;
  pointer-events: none;
  animation: login-float-glow 18s ease-in-out infinite reverse;
}
.login-orbit {
  position: absolute;
  width: min(72vw, 420px);
  height: min(72vw, 420px);
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 0;
}
.login-orbit::before {
  content: '';
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  animation: login-orbit-spin 48s linear infinite;
}
.login-orbit::after {
  content: '';
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: login-orbit-spin 32s linear infinite reverse;
}
.login-brand {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-size: 17px; font-weight: 500;
  letter-spacing: -.02em; position: relative; z-index: 1;
  text-decoration: none;
}
.login-brand-logo {
  width: 38px; height: 38px;
  object-fit: contain; display: block; flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}
.login-hero { position: relative; z-index: 1; max-width: 520px; }
.login-hero h1 {
  font-size: clamp(30px, 4.2vw, 54px);
  font-weight: 200;
  color: #fff;
  margin-bottom: 18px;
  line-height: 1.08;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.25);
}
.login-hero h1 b { font-weight: 700; background: linear-gradient(90deg, #fff, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p {
  font-size: clamp(14px, 1.6vw, 16px);
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.75;
  max-width: 400px;
}

.login-right {
  width: min(480px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 40px);
  background:
    radial-gradient(ellipse 120% 80% at 80% 20%, rgba(87, 34, 247, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 60% at 10% 90%, rgba(34, 211, 238, 0.06), transparent 45%),
    linear-gradient(180deg, #f4f6fd 0%, #fafbfd 100%);
}
.login-right-inner {
  width: 100%;
  max-width: 420px;
}
.login-card-wrap {
  padding: 1.5px;
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    rgba(87, 34, 247, 0.55),
    rgba(147, 51, 234, 0.35) 40%,
    rgba(34, 211, 238, 0.35) 100%
  );
  box-shadow:
    0 4px 24px rgba(11, 31, 59, 0.08),
    0 24px 64px rgba(87, 34, 247, 0.12);
}
.login-card {
  border-radius: 20.5px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  padding: clamp(24px, 4vw, 36px) clamp(22px, 4vw, 32px) 20px;
}
.login-form-box { width: 100%; }
.login-support-row {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--borda);
  text-align: center;
}
.login-support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cinza);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--borda);
  background: rgba(255, 255, 255, 0.6);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.login-support-link:hover {
  color: var(--roxo);
  border-color: rgba(87, 34, 247, 0.35);
  background: var(--lilas-cl);
  transform: translateY(-1px);
}
.login-support-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}
.auth-panel { display: none; animation: fup .4s ease both; }
.auth-panel.active { display: block; }
.auth-panel h2 { font-size: 26px; font-weight: 600; margin-bottom: 6px; }
.auth-panel .subtitle { font-size: 14px; color: var(--cinza); margin-bottom: 28px; }

.demo-card {
  background: var(--g2); border: 1px solid var(--borda);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 24px;
  font-size: 12px; color: var(--cinza2);
}
.demo-card strong { color: var(--text); }

.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text); margin-bottom: 7px;
}
.field input {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--borda);
  border-radius: 12px; font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--g1); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px rgba(87,34,247,.1);
}
.field input::placeholder { color: var(--cinza2); }
.field-err { display: block; font-size: 12px; color: #DC2626; margin-top: 5px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.pass-toggle {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--cinza2);
  padding: 4px; display: flex; align-items: center;
}
.pass-toggle svg { width: 18px; height: 18px; }
.pass-toggle:hover { color: var(--text); }

.global-err {
  background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.2);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #DC2626;
  margin-bottom: 16px;
}

.btn-submit {
  width: 100%; padding: 13px; border-radius: 12px;
  background: var(--roxo); color: #fff; font-size: 15px; font-weight: 500;
  font-family: inherit; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .2s, box-shadow .2s;
  margin-bottom: 20px;
}
.btn-submit:hover:not(:disabled) {
  background: var(--lilas);
  box-shadow: 0 8px 32px rgba(87,34,247,.4);
  transform: translateY(-1px);
}
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.spin {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}

.auth-switch { text-align: center; font-size: 13px; color: var(--cinza); }
.auth-switch a { color: var(--roxo); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }
.login-forgot-wrap { text-align: right; margin: 6px 0 0; }
.login-forgot-link {
  font-size: 13px;
  color: var(--roxo);
  text-decoration: none;
  font-weight: 500;
}
.login-forgot-link:hover { text-decoration: underline; }
.login-forgot-ok {
  font-size: 13px;
  line-height: 1.5;
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
}
.auth-signup-hint {
  text-align: center;
  font-size: 12px;
  color: var(--cinza2);
  margin-top: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .login-left {
    animation: none;
    background-size: 100% 100%;
  }
  .login-left-glow,
  .login-left-glow--2 {
    animation: none;
  }
  .login-orbit::before,
  .login-orbit::after {
    animation: none;
  }
}

/* ─── App Layout ──────────────────────────────────────────────────────────── */
.app-layout {
  display: flex; min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w); background: var(--g1);
  border-right: 1px solid var(--borda);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100; overflow-x: hidden; overflow-y: auto;
  transition: width .28s cubic-bezier(.4, 0, .2, 1);
}
.sidebar-top {
  padding: 16px 10px 12px 12px;
  border-bottom: 1px solid var(--borda);
  flex-shrink: 0;
}
.sidebar-brand-row {
  display: flex; align-items: center; gap: 6px;
  width: 100%; min-width: 0;
}
.sidebar-logo {
  flex: 1; min-width: 0;
  padding: 4px 8px;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-size: 15px; font-weight: 600; letter-spacing: -.02em;
  border-radius: 10px;
  transition: background .2s;
}
.sidebar-logo:hover { background: var(--g2); }
.sidebar-logo-img {
  width: 28px; height: 28px; flex-shrink: 0;
  object-fit: contain; display: block;
}
.sidebar-logo-text { font-weight: 200; white-space: nowrap; overflow: hidden; transition: opacity .2s, max-width .28s; }
.sidebar-logo-text strong { font-weight: 700; }
.sidebar-toggle {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--borda); border-radius: 8px;
  background: var(--g2); color: var(--cinza);
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .28s;
}
.sidebar-toggle:hover {
  background: var(--lilas-cl); color: var(--roxo); border-color: rgba(87,34,247,.25);
}
.sidebar-toggle svg { width: 18px; height: 18px; transition: transform .28s cubic-bezier(.4, 0, .2, 1); }
html.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-nav { padding: 16px 10px; flex: 1; }
.nav-section { margin-bottom: 24px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--cinza2);
  padding: 0 8px; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s, max-height .28s, margin .28s;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  text-decoration: none; color: var(--cinza); font-size: 14px;
  transition: background .2s, color .2s, padding .28s, justify-content .28s;
  position: relative;
}
.nav-item-label {
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s, max-width .28s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--g2); color: var(--text); }
.nav-item.active {
  background: var(--lilas-cl); color: var(--roxo); font-weight: 500;
}
.nav-item .nav-count {
  margin-left: auto; background: var(--roxo); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 100px; min-width: 20px; text-align: center;
}

.sidebar-user {
  padding: 16px 12px;
  border-top: 1px solid var(--borda);
  flex-shrink: 0;
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: var(--g2);
}
.user-ava {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--roxo), var(--lilas));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; truncate: clip; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--cinza2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
  background: none; border: none; cursor: pointer;
  color: var(--cinza2); padding: 4px;
  display: flex; align-items: center;
  border-radius: 6px; transition: color .2s, background .2s;
}
.logout-btn:hover { color: #DC2626; background: rgba(220,38,38,.08); }
.logout-btn svg { width: 16px; height: 16px; }

.main-content {
  margin-left: var(--sidebar-w); flex: 1; min-height: 100vh;
  background: var(--g2);
  transition: margin-left .28s cubic-bezier(.4, 0, .2, 1);
}

/* Sidebar recolhida — faixa estreita com ícones */
html.sidebar-collapsed {
  --sidebar-w: var(--sidebar-w-collapsed);
}
html.sidebar-collapsed .sidebar-top {
  padding: 10px 4px;
  display: flex; justify-content: center;
}
html.sidebar-collapsed .sidebar-brand-row {
  width: auto; justify-content: center; gap: 0;
}
html.sidebar-collapsed .sidebar-logo {
  flex: none; justify-content: center; padding: 2px 0 2px 2px;
}
html.sidebar-collapsed .sidebar-logo-img {
  width: 26px; height: 26px;
}
html.sidebar-collapsed .sidebar-logo-text {
  opacity: 0; width: 0; overflow: hidden; pointer-events: none;
}
html.sidebar-collapsed .sidebar-toggle {
  width: 22px; height: 22px; min-width: 22px;
  border: none; background: transparent; border-radius: 6px;
  margin-left: -2px;
}
html.sidebar-collapsed .sidebar-toggle svg {
  width: 15px; height: 15px;
}
html.sidebar-collapsed .nav-section-label {
  opacity: 0; max-height: 0; margin-bottom: 0; padding: 0;
}
html.sidebar-collapsed .nav-item {
  justify-content: center; padding: 10px;
  gap: 0;
}
html.sidebar-collapsed .nav-item-label {
  opacity: 0; max-width: 0; pointer-events: none;
}
html.sidebar-collapsed .nav-item .nav-count { display: none; }
html.sidebar-collapsed .sidebar-nav { padding: 12px 8px; }
html.sidebar-collapsed .sidebar-user { padding: 12px 8px; }
html.sidebar-collapsed .user-card {
  flex-direction: column; align-items: center;
  padding: 10px 6px; gap: 8px;
}
html.sidebar-collapsed .user-info {
  opacity: 0; max-height: 0; overflow: hidden; pointer-events: none;
}
html.sidebar-collapsed .logout-btn {
  width: 36px; height: 36px; justify-content: center;
  border-radius: 10px;
}
html.sidebar-collapsed .logout-btn:hover { background: rgba(220,38,38,.08); }

/* ─── Top Bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--borda);
  padding: 16px 32px;
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  row-gap: 10px;
}
.topbar-title { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; }

/* Botão hambúrguer — visível só no modo gaveta (mobile / tablet estreito) */
.nav-drawer-open-btn {
  display: none;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--borda);
  border-radius: 10px;
  background: var(--g2);
  color: var(--text);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.nav-drawer-open-btn:hover {
  background: var(--lilas-cl);
  border-color: rgba(87, 34, 247, 0.25);
  color: var(--roxo);
}
.nav-drawer-open-btn svg { width: 20px; height: 20px; }

.nav-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(11, 31, 59, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
html.nav-drawer-open .nav-drawer-backdrop {
  display: block;
  left: var(--nav-drawer-w, min(300px, 88vw));
  right: 0;
  top: 0;
  bottom: 0;
  opacity: 1;
  pointer-events: auto;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--g2); border: 1.5px solid var(--borda);
  border-radius: 100px; padding: 8px 18px; flex: 1; max-width: 360px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px rgba(87,34,247,.08);
}
.search-box svg { width: 16px; height: 16px; color: var(--cinza2); flex-shrink: 0; }
.search-box input {
  border: none; background: none; outline: none;
  font-size: 14px; color: var(--text); font-family: inherit; width: 100%;
}
.search-box input::placeholder { color: var(--cinza2); }

/* ─── Dashboard Content ───────────────────────────────────────────────────── */
.dash-body { padding: 32px; }

.welcome-section { margin-bottom: 32px; }
.welcome-section h1 {
  font-size: 28px; font-weight: 200; margin-bottom: 4px;
}
.welcome-section h1 b { font-weight: 700; }
.welcome-section p { font-size: 14px; color: var(--cinza); }

.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px;
}
.stat-card {
  background: var(--g1); border: 1px solid var(--borda);
  border-radius: var(--radius); padding: 24px 20px;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(87,34,247,.1);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.stat-card-icon svg { width: 18px; height: 18px; color: var(--roxo); }
.stat-card-val { font-size: 32px; font-weight: 700; letter-spacing: -.04em; margin-bottom: 4px; }
.stat-card-lbl { font-size: 12px; color: var(--cinza2); }
.stat-card--link { cursor: pointer; }
.stat-card--link:hover { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(87,34,247,.08), var(--shadow-md); }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-header h2 { font-size: 18px; font-weight: 600; }

.continue-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 48px;
}

.continue-card {
  background: var(--g1); border: 1px solid var(--borda); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 14px; align-items: center;
  text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.continue-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: rgba(87,34,247,.2);
}
.continue-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.continue-thumb {
  width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.continue-thumb svg { width: 22px; height: 22px; color: #fff; }
.continue-info { flex: 1; min-width: 0; }
.continue-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-progress { display: flex; align-items: center; gap: 8px; }
.continue-pct { font-size: 11px; color: var(--cinza2); white-space: nowrap; }

/* ─── Course Cards ────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap;
}
.filter-btn {
  padding: 7px 16px; border-radius: 100px; font-size: 13px;
  font-family: inherit; border: 1.5px solid var(--borda); background: var(--g1);
  cursor: pointer; color: var(--cinza); transition: all .2s;
}
.filter-btn:hover { border-color: var(--roxo); color: var(--roxo); }
.filter-btn.active { background: var(--roxo); border-color: var(--roxo); color: #fff; }

.course-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}

.course-card {
  background: var(--g1); border: 1px solid var(--borda);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; text-decoration: none; color: inherit;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  display: flex; flex-direction: column;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(87,34,247,.15);
}
.course-card-thumb {
  height: 140px; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.course-card-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.course-card-thumb-icon {
  width: 52px; height: 52px; background: rgba(255,255,255,.2);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
}
.course-card-thumb-icon svg { width: 26px; height: 26px; color: #fff; }
.course-card-cat {
  position: absolute; top: 12px; left: 12px;
}
.course-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.course-card-title {
  font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.3;
}
.course-card-sub {
  font-size: 12.5px; color: var(--cinza); line-height: 1.55; margin-bottom: 14px; flex: 1;
}
.course-card-meta {
  display: flex; gap: 12px; align-items: center;
  font-size: 11.5px; color: var(--cinza2); margin-bottom: 14px;
}
.course-card-meta span { display: flex; align-items: center; gap: 4px; }
.course-card-meta svg { width: 13px; height: 13px; }
.course-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--borda);
  display: flex; align-items: center; justify-content: space-between;
}
.course-card-prog-txt { font-size: 12px; color: var(--cinza); }
.course-card-prog-txt strong { color: var(--roxo); }
.course-card-action {
  font-size: 12px; font-weight: 500; color: var(--roxo);
  display: flex; align-items: center; gap: 4px;
}
.course-card-action svg { width: 14px; height: 14px; }

.course-card--locked {
  cursor: not-allowed;
  pointer-events: none;
}
.course-card--locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--borda);
}
.course-card--locked .course-card-thumb {
  filter: grayscale(0.45) brightness(0.72);
}
.course-card--locked .course-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.course-card--locked .course-card-thumb-icon {
  opacity: 0.45;
}
.course-card--locked .course-card-body {
  opacity: 0.55;
}
.course-card--locked .course-card-footer {
  opacity: 0.65;
  background: var(--g2);
}
.course-card--locked .course-card-action {
  color: var(--cinza2);
}
.course-card-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(11, 31, 59, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(11, 31, 59, 0.2);
}
.course-card-lock svg {
  width: 18px;
  height: 18px;
}

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 64px 32px; color: var(--cinza);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .4; display: block; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ─── Curso (Course Viewer) ───────────────────────────────────────────────── */
.curso-layout { display: flex; flex-direction: column; min-height: 100vh; }

.curso-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--borda);
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 16px;
}
.curso-back {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--cinza); text-decoration: none;
  padding: 6px 10px; border-radius: 8px; transition: color .2s, background .2s;
}
.curso-back:hover { color: var(--text); background: var(--g2); }
.curso-back svg { width: 16px; height: 16px; }
.curso-outline-open-btn {
  display: none;
}
.curso-topbar-title { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curso-progress-wrap { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.curso-progress-label { font-size: 12px; color: var(--cinza); white-space: nowrap; }
.curso-progress-bar { width: 120px; }

.curso-body { display: flex; flex: 1; }

.curso-sidebar {
  width: 300px; flex-shrink: 0;
  background: var(--g1); border-right: 1px solid var(--borda);
  overflow-y: auto; height: calc(100vh - 60px);
  position: sticky; top: 60px;
}
.curso-sidebar-head {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--borda);
}
.curso-sidebar-head h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.curso-sidebar-head p { font-size: 12px; color: var(--cinza2); }
.curso-sidebar-prog { margin-top: 10px; }
.curso-sidebar-prog-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.curso-sidebar-prog-lbl { font-size: 11px; color: var(--cinza2); }
.curso-sidebar-prog-pct { font-size: 11px; font-weight: 600; color: var(--roxo); }

.module-group { border-bottom: 1px solid var(--borda); }
.module-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; cursor: pointer; transition: background .2s;
}
.module-header:hover { background: var(--g2); }
.module-num { font-size: 10px; color: var(--cinza2); font-weight: 500; min-width: 18px; }
.module-title { font-size: 13px; font-weight: 500; flex: 1; line-height: 1.35; }
.module-chevron {
  width: 16px; height: 16px; color: var(--cinza2);
  transition: transform .25s; flex-shrink: 0;
}
.module-group.open .module-chevron { transform: rotate(180deg); }
.module-lessons { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.module-group.open .module-lessons { max-height: 9999px; }

.lesson-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 36px; cursor: pointer;
  transition: background .2s, color .2s; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit;
}
.lesson-item:hover { background: var(--g2); }
.lesson-item.active { background: var(--lilas-cl); }
.lesson-icon {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(87,34,247,.1);
}
.lesson-icon svg { width: 12px; height: 12px; color: var(--roxo); }
.lesson-item.done .lesson-icon { background: rgba(16,185,129,.12); }
.lesson-item.done .lesson-icon svg { color: #059669; }
.lesson-item.active .lesson-icon { background: var(--roxo); }
.lesson-item.active .lesson-icon svg { color: #fff; }
.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-size: 13px; color: var(--text); line-height: 1.35; }
.lesson-item.active .lesson-title { color: var(--roxo); font-weight: 500; }
.lesson-item.done .lesson-title { color: var(--cinza); }
.lesson-dur { font-size: 11px; color: var(--cinza2); margin-top: 1px; }

.curso-main {
  flex: 1; overflow-y: auto; background: var(--g2);
}

.video-player {
  position: relative; aspect-ratio: 16/9; max-height: 520px;
  cursor: pointer; overflow: hidden; background: #0f0f14;
}
.video-player.has-embed { cursor: default; }
.video-embed-wrap {
  position: absolute; inset: 0; z-index: 2;
  background: #000;
}
.video-embed-wrap iframe {
  width: 100%; height: 100%; border: 0; display: block;
}
.video-player.has-embed .video-embed-wrap { display: block !important; }
.video-player.has-embed .video-embed-wrap[hidden] { display: none !important; }
.video-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
}
.video-play-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s;
}
.video-play-btn svg { width: 28px; height: 28px; color: #fff; margin-left: 4px; }
.video-player:hover .video-play-btn { transform: scale(1.1); background: rgba(255,255,255,.3); }
.video-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.7));
  pointer-events: none;
}
.video-label {
  position: absolute; bottom: 20px; left: 24px; right: 24px;
  color: #fff;
}
.video-label small { font-size: 11px; opacity: .7; letter-spacing: .06em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.video-label strong { font-size: 18px; font-weight: 500; display: block; }

.video-player.playing .video-play-btn { opacity: 0; }
.video-playing-indicator {
  position: absolute; top: 16px; right: 16px;
  background: rgba(0,0,0,.6); border-radius: 100px;
  padding: 5px 12px; font-size: 11px; color: #fff;
  display: flex; align-items: center; gap: 6px; opacity: 0;
  transition: opacity .3s;
}
.video-playing-indicator .pulse { width: 7px; height: 7px; background: #EF4444; border-radius: 50%; animation: blink 1.2s infinite; }
.video-player.playing .video-playing-indicator { opacity: 1; }

.lesson-content { padding: 32px; max-width: 840px; }
.lesson-content-header { margin-bottom: 24px; }
.lesson-content-type { margin-bottom: 10px; }
.lesson-content h2 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.lesson-content-sub { font-size: 14px; color: var(--cinza); line-height: 1.7; }
.lesson-divider { height: 1px; background: var(--borda); margin: 28px 0; }
.lesson-desc { font-size: 14px; color: var(--cinza); line-height: 1.8; margin-bottom: 28px; }
.lesson-actions {
  display: flex; gap: 12px; align-items: center;
}
.btn-complete {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 100px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  background: var(--roxo); color: #fff; border: none; cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.btn-complete:hover {
  background: var(--lilas);
  box-shadow: 0 6px 24px rgba(87,34,247,.35);
  transform: translateY(-1px);
}
.btn-complete svg { width: 16px; height: 16px; }
.btn-complete.done {
  background: #059669;
}
.btn-complete.done:hover { background: #047857; box-shadow: 0 6px 24px rgba(5,150,105,.3); }
.btn-nav {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: 100px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  border: 1.5px solid var(--borda); background: var(--g1);
  color: var(--cinza); cursor: pointer;
  transition: all .2s;
}
.btn-nav:hover { border-color: var(--roxo); color: var(--roxo); background: var(--lilas-cl); }
.btn-nav:disabled { opacity: .4; cursor: not-allowed; }
.btn-nav svg { width: 16px; height: 16px; }

/* ─── Milestone Bar ───────────────────────────────────────────────────────── */
.milestone-bar-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 190px;
}
.milestone-label {
  display: flex; align-items: baseline; gap: 4px; font-size: 13px; font-weight: 600;
}
.milestone-current { color: var(--text); }
.milestone-sep { color: var(--cinza2); font-weight: 400; }
.milestone-target { color: var(--cinza2); font-weight: 400; font-size: 12px; }
.milestone-track {
  width: 180px; height: 6px; background: var(--g3); border-radius: 100px; overflow: hidden;
}
.milestone-fill {
  height: 100%; background: linear-gradient(90deg,#10B981,#059669);
  border-radius: 100px; transition: width .5s ease;
}
.milestone-range-lbl { font-size: 10px; color: var(--cinza2); letter-spacing: .02em; }

/* ─── Overview (dashboard admin) ─────────────────────────────────────────── */
.overview-filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px;
}
.overview-filter-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 100%;
  vertical-align: middle;
}
.overview-filter-wrap--period,
.overview-filter-wrap--course {
  width: 9.75rem;
}
.overview-filter-wrap--type {
  width: 8.75rem;
}
.overview-filter-wrap--course-picker {
  width: 11rem;
  max-width: min(42vw, 11rem);
}
.overview-filter-wrap select {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 26px 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--borda);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--g1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 12px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.overview-filter-wrap select:hover { border-color: rgba(87, 34, 247, .35); }
.overview-filter-wrap select:focus {
  outline: none;
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px rgba(87, 34, 247, .1);
}
.overview-custom-range {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.overview-custom-range label {
  font-size: 12px; color: var(--cinza); white-space: nowrap;
}
.overview-custom-range input[type="date"] {
  padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--borda);
  font-family: inherit; font-size: 13px; background: var(--g1); color: var(--text);
}
.overview-layout,
.overview-bottom-row {
  --overview-sidebar: 260px;
}
.overview-layout {
  display: grid; grid-template-columns: 1fr var(--overview-sidebar); gap: 20px; align-items: stretch;
}
.overview-chart-card {
  margin-bottom: 0; display: flex; flex-direction: column; height: 100%; min-height: 0;
}
.overview-chart-card .overview-chart-wrap { flex: 1; min-height: 140px; }
.overview-chart-hd { margin-bottom: 12px; }
.overview-chart-val { font-size: 26px; font-weight: 700; color: var(--text); }
.overview-chart-lbl { font-size: 12px; color: var(--cinza); margin-top: 1px; }
.overview-chart-wrap { width: 100%; }
.overview-chart-empty {
  height: 140px; display: flex; align-items: center; justify-content: center;
  color: var(--cinza2); font-size: 13px;
}
.overview-cards-col {
  display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0;
}
.overview-metric-card {
  background: var(--g1); border: 1px solid var(--borda); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  flex: 1; min-height: 72px; box-sizing: border-box;
}
.overview-metric-icon {
  width: 40px; height: 40px; min-width: 40px; min-height: 40px;
  border-radius: 12px; background: var(--lilas-cl);
  display: flex; align-items: center; justify-content: center;
  color: var(--roxo); flex-shrink: 0;
}
.overview-metric-icon svg { width: 18px; height: 18px; display: block; }
.overview-metric-icon--amber { background: rgba(245,158,11,.12); color: #D97706; }
.overview-metric-body { min-width: 0; flex: 1; }
.overview-metric-card--link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.overview-metric-card--link:hover { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(87,34,247,.08); }
.overview-metric-lbl { font-size: 11px; color: var(--cinza); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .05em; }
.overview-metric-val { font-size: 18px; font-weight: 700; color: var(--text); }
.overview-metric-sub { font-size: 11px; color: var(--cinza2); margin-top: 2px; }
.overview-bottom-row {
  display: grid; grid-template-columns: 1fr var(--overview-sidebar);
  gap: 20px; margin-top: 20px; align-items: stretch;
}
.overview-bottom-left {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; min-width: 0;
}
.overview-bottom-left .stat-card,
.overview-bottom-row > .stat-card { min-width: 0; height: 100%; }
.overview-bottom-right { width: 100%; }
@media (max-width: 960px) {
  .overview-layout { grid-template-columns: 1fr; }
  .overview-cards-col { flex-direction: row; flex-wrap: wrap; height: auto; }
  .overview-metric-card { flex: 1 1 140px; min-width: 140px; }
  .overview-chart-card { height: auto; }
  .overview-bottom-row { grid-template-columns: 1fr; gap: 16px; }
  .overview-bottom-left { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .overview-bottom-left { grid-template-columns: 1fr; }
}

/* ─── Financeiro (admin) ──────────────────────────────────────────────────── */
.finance-filters { margin-bottom: 20px; }
.finance-search {
  flex: 1; min-width: 180px; max-width: 280px;
  padding: 8px 12px; border: 1px solid var(--borda); border-radius: 10px;
  font-size: 13px; font-family: inherit; background: var(--g1);
}
.finance-search:focus { outline: none; border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(87,34,247,.1); }
.finance-overview-layout { margin-bottom: 24px; }
.finance-chart-meta {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--borda);
  font-size: 12px; color: var(--cinza);
}
.finance-pending { color: #D97706; font-weight: 600; }
.finance-badge-reemb { background: rgba(245,158,11,.15); color: #D97706; font-size: 11px; padding: 3px 10px; border-radius: 100px; font-weight: 600; }
.finance-grid { margin-top: 0; }
.finance-table-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.finance-table-hd-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto;
}
.finance-table-hd-actions .finance-search {
  flex: 1; min-width: 200px; max-width: 320px; margin: 0;
}
.finance-row-clickable { cursor: pointer; transition: background .15s; }
.finance-row-clickable:hover { background: rgba(87,34,247,.04); }
.finance-history-card { margin-bottom: 0; }
.coupons-card .admin-table-wrap { overflow-x: auto; }
.admin-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin-top: 4px;
  cursor: pointer;
}
.admin-check-row input { accent-color: var(--roxo); width: 18px; height: 18px; }
.admin-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .admin-form .field-row { grid-template-columns: 1fr; } }

/* ─── Admin Panel ─────────────────────────────────────────────────────────── */
.admin-body { max-width: 1200px; }
.panel-badge {
  flex-shrink: 0; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 6px 14px; border-radius: 100px;
  background: var(--lilas-cl); color: var(--roxo); border: 1px solid rgba(87,34,247,.2);
}
.panel-badge--student {
  background: rgba(6, 182, 212, .1); color: #0891B2; border-color: rgba(8, 145, 178, .25);
}
.topbar--student .search-box { flex: 1; max-width: none; }
.topbar-user-ava {
  width: 34px; height: 34px; border-radius: 10px; font-size: 13px; flex-shrink: 0;
}
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fup .35s ease both; }
.admin-hint { font-size: 14px; color: var(--cinza); margin-bottom: 24px; line-height: 1.6; }
.admin-muted { font-size: 12px; color: var(--cinza2); }
.admin-grid-2 {
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 24px; align-items: start;
}
.admin-card {
  background: var(--g1); border: 1px solid var(--borda); border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px;
}
.admin-card--wide { min-width: 0; }
.admin-card-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.admin-form .field { margin-bottom: 14px; }
.admin-form .field label { font-size: 12px; margin-bottom: 6px; }
.admin-form .field input,
.admin-form .field select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--borda); font-family: inherit; font-size: 14px; }
.admin-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.admin-form-inline { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.admin-form-inline input { flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--borda); font-family: inherit; }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.admin-select { padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--borda); font-family: inherit; min-width: 220px; }
.admin-select-sm { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--borda); font-size: 12px; }
.admin-check-grid { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.admin-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.admin-check input { accent-color: var(--roxo); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--borda); }
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--cinza2); font-weight: 600; }
.admin-table-actions { white-space: nowrap; }
.btn-icon-sm {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--borda);
  background: var(--g2); cursor: pointer; font-size: 16px; line-height: 1;
}
.btn-icon-sm:hover { border-color: var(--roxo); color: var(--roxo); }
.btn-icon-danger:hover { border-color: #DC2626; color: #DC2626; background: rgba(220,38,38,.06); }
.btn-danger-text { color: #DC2626 !important; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.admin-modules { display: flex; flex-direction: column; gap: 16px; }
.admin-module { border: 1px solid var(--borda); border-radius: 12px; padding: 14px; background: var(--g2); }
.admin-module-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.admin-lesson-list { list-style: none; margin: 0 0 10px; padding: 0; }
.admin-lesson-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--borda);
}
.admin-lesson-row:last-child { border-bottom: none; }
.admin-input-inline { flex: 1; min-width: 120px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--borda); font-size: 13px; }
.admin-input-dur { width: 64px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--borda); font-size: 13px; }
.admin-access-list { display: flex; flex-direction: column; gap: 16px; }
.admin-access-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-text-danger { color: #DC2626; font-weight: 500; }
.admin-text-reemb  { color: #D97706; font-weight: 500; }
.admin-filter-input {
  flex: 1;
  min-width: 140px;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--borda);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
  background: var(--g1);
  box-sizing: border-box;
}
.admin-filter-input:focus {
  outline: none;
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px rgba(87, 34, 247, .1);
}
.admin-toolbar .overview-filter-wrap {
  flex: 0 0 auto;
}
.user-prog-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.user-prog-bar { width: 72px; height: 5px; background: var(--g3); border-radius: 100px; overflow: hidden; flex-shrink: 0; }
.user-prog-fill { height: 100%; background: var(--roxo); border-radius: 100px; }
.user-prog-lbl { font-size: 12px; font-weight: 600; color: var(--text); }
.badge-beta {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 100px;
  background: rgba(99,102,241,.12); color: #6366F1;
  vertical-align: middle; white-space: nowrap;
}
.admin-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100010;
  padding: 14px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 360px;
}
.admin-toast--ok { background: #059669; color: #fff; }
.admin-toast--warn { background: #D97706; color: #fff; }

.modal-overlay--profile-pw[data-forced-via-modal] { pointer-events: all; }
#modalPasswordChange:not([hidden])[data-forced="1"] {
  z-index: 100000;
  background: rgba(5, 5, 12, 0.92);
}
.admin-toast--err { background: #DC2626; color: #fff; }

.badge-muted {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}
.admin-table-row--muted td {
  opacity: 0.65;
}
.admin-table-row--muted strong {
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.5);
}
@media (max-width: 900px) {
  .admin-grid-2 { grid-template-columns: 1fr; }
}

/* ─── User Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(11,31,59,.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fade-in .2s ease both;
}
.modal-card {
  background: var(--g1); border: 1px solid var(--borda);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  animation: fup .25s ease both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--borda);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--borda);
  background: var(--g2); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--cinza); transition: border-color .15s, color .15s;
}
.modal-close:hover { border-color: var(--roxo); color: var(--roxo); }
.modal-close svg { width: 16px; height: 16px; }
.modal-card form { display: flex; flex-direction: column; }
.modal-fields {
  padding: 20px 24px 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start;
}
.modal-fields .field { margin-bottom: 16px; }
.modal-fields .field label { font-size: 12px; margin-bottom: 6px; display: block; font-weight: 500; color: var(--text); }
.modal-fields .field input:not([type="checkbox"]),
.modal-fields .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--borda); font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--g1); outline: none; transition: border-color .2s, box-shadow .2s;
}
.modal-fields .field input:not([type="checkbox"]):focus,
.modal-fields .field select:focus { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(87,34,247,.1); }

/* Modal financeiro — layout próprio (evita grid 2 colunas do .modal-fields) */
.modal-card--finance {
  max-width: 640px;
  width: min(640px, calc(100vw - 48px));
}
.modal-card--finance .modal-head h3 { font-size: 18px; }
.modal-card--finance .modal-fields.modal-fields--finance {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px 28px 12px;
  grid-template-columns: unset;
}
.modal-card--finance .modal-fields--finance > .field,
.modal-card--finance .modal-fields--finance > .field-row {
  width: 100%;
  min-width: 0;
}
.modal-card--finance .modal-fields--finance .field { margin-bottom: 18px; }
.modal-card--finance .modal-fields--finance .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  width: 100%;
}
.modal-card--finance .modal-fields--finance .field-row .field { margin-bottom: 18px; }
.modal-card--finance .modal-fields--finance .field-row--bottom {
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 1.35fr) minmax(150px, 1.15fr);
}
.modal-card--finance .modal-fields--finance .field label {
  font-size: 13px;
  margin-bottom: 8px;
}
.modal-card--finance .modal-fields--finance .field input:not([type="checkbox"]),
.modal-card--finance .modal-fields--finance .field select,
.modal-card--finance .modal-fields--finance > .field > .multi-select {
  min-height: 44px;
  font-size: 15px;
  padding: 11px 14px;
  box-sizing: border-box;
}
.modal-card--finance .modal-footer { padding: 18px 28px; }
@media (max-width: 640px) {
  .modal-card--finance { width: calc(100vw - 32px); }
  .modal-card--finance .modal-fields--finance .field-row,
  .modal-card--finance .modal-fields--finance .field-row--bottom {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--borda);
}

/* ─── Multi-select (cursos) ───────────────────────────────────────────────── */
.multi-select {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1.5px solid var(--borda); border-radius: 10px;
  font-size: 14px; background: var(--g1); cursor: pointer;
  user-select: none; transition: border-color .2s, box-shadow .2s;
}
.multi-select:hover { border-color: rgba(87,34,247,.35); }
.multi-select.open { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(87,34,247,.1); }
.multi-select > span { flex: 1; color: var(--cinza2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi-select.has-value > span { color: var(--text); }
.multi-select-chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--cinza2); transition: transform .2s; }
.multi-select.open .multi-select-chevron { transform: rotate(180deg); }
.multi-select-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--g1); border: 1.5px solid var(--borda); border-radius: 12px;
  box-shadow: var(--shadow-md); z-index: 50; overflow: hidden;
  max-height: 192px; overflow-y: auto;
}
.multi-select.open .multi-select-dropdown { display: block; }
/* Usuários — lista de cursos no multi-select (proporções próprias, padrão do financeiro) */
#userModal .user-course-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; cursor: pointer;
  font-size: 14px; line-height: 1.45; color: var(--text);
  border-bottom: 1px solid var(--borda); transition: background .15s;
  box-sizing: border-box;
}
#userModal .user-course-item:last-child { border-bottom: none; }
#userModal .user-course-item:hover { background: var(--lilas-cl); }
#userModal .user-course-item > span {
  flex: 1; min-width: 0; font-size: 14px; line-height: 1.45;
}
#userModal .user-course-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 11px; height: 11px; min-height: 11px; max-height: 11px;
  margin: 0; padding: 0; flex-shrink: 0; align-self: center;
  border: 1.5px solid #C4C9D4; border-radius: 3px;
  background: var(--g1); cursor: pointer; box-sizing: border-box;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
#userModal .user-course-item:hover input[type="checkbox"]:not(:checked) {
  border-color: rgba(87, 34, 247, .45);
}
#userModal .user-course-item input[type="checkbox"]:checked {
  background-color: var(--roxo);
  border-color: var(--roxo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2L5 8.7L9.5 3.8' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 7px 7px;
}
#userModal .user-course-item input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(87, 34, 247, .18);
}

/* Financeiro — lista de cursos (visual próprio) */
.modal-card--finance .finance-course-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  font-size: 16px; line-height: 1.4; color: var(--text);
  border-bottom: 1px solid var(--borda); transition: background .15s;
  box-sizing: border-box;
}
.modal-card--finance .finance-course-item:last-child { border-bottom: none; }
.modal-card--finance .finance-course-item:hover { background: var(--lilas-cl); }
.modal-card--finance .finance-course-item > span {
  flex: 1; min-width: 0; font-size: 16px; line-height: 1.4;
}
.modal-card--finance .finance-course-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px; height: 12px; min-height: 12px; max-height: 12px;
  margin: 0; padding: 0; flex-shrink: 0; align-self: center;
  border: 1.5px solid #C4C9D4; border-radius: 4px;
  background: var(--g1); cursor: pointer; box-sizing: border-box;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.modal-card--finance .finance-course-item:hover input[type="checkbox"]:not(:checked) {
  border-color: rgba(87, 34, 247, .45);
}
.modal-card--finance .finance-course-item input[type="checkbox"]:checked {
  background-color: var(--roxo);
  border-color: var(--roxo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2L5 8.7L9.5 3.8' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 8px;
}
.modal-card--finance .finance-course-item input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(87, 34, 247, .18);
}

/* ─── Course Creation Modal ───────────────────────────────────────────────── */
.course-modal-card { max-width: 680px; }
.course-modal-body { display: grid; grid-template-columns: 1fr 220px; }
.course-modal-left {
  padding: 24px; display: flex; flex-direction: column;
  border-right: 1px solid var(--borda);
}
.course-modal-left .field { margin-bottom: 16px; }
.course-modal-left .field label { font-size: 12px; font-weight: 500; display: block; margin-bottom: 6px; color: var(--text); }
.course-modal-left .field input,
.course-modal-left .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--borda); font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--g1); outline: none; transition: border-color .2s, box-shadow .2s;
}
.course-modal-left .field input:focus,
.course-modal-left .field select:focus { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(87,34,247,.1); }
.course-upload-zone {
  border: 2px dashed var(--borda); border-radius: 12px; padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; transition: border-color .2s, background .2s; text-align: center;
}
.course-upload-zone svg { width: 30px; height: 30px; color: var(--cinza2); margin-bottom: 4px; }
.course-upload-zone:hover, .course-upload-zone.drag-over { border-color: var(--roxo); background: var(--lilas-cl); }
.course-upload-zone.has-image { border-style: solid; border-color: var(--roxo); }
.course-upload-link { color: var(--roxo); font-weight: 500; font-size: 13px; }
.course-upload-zone > span { font-size: 12px; color: var(--cinza); }
.course-upload-hint { font-size: 11px; color: var(--cinza2); margin-top: 2px; }
.course-upload-tip {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  background: rgba(245,158,11,.08); border-left: 3px solid #D97706;
  border-radius: 0 8px 8px 0; padding: 10px 12px;
  font-size: 12px; color: var(--cinza);
}
.course-upload-tip svg { color: #D97706; flex-shrink: 0; width: 15px; height: 15px; }
.course-meta-cover-field { grid-column: 1 / -1; }
.course-meta-cover-preview {
  width: 100%; max-width: 200px; aspect-ratio: 2/3;
  border-radius: 12px; border: 1px solid var(--borda);
  margin-bottom: 10px; background: var(--g3) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  min-height: 120px;
}
.course-cover-url-input {
  width: 100%; margin-top: 10px; padding: 8px 12px;
  border-radius: 8px; border: 1.5px solid var(--borda);
  font-family: inherit; font-size: 13px; box-sizing: border-box;
}
.course-modal-preview { background-size: cover; background-position: center; }
.drag-handle {
  cursor: grab; color: var(--cinza2); font-size: 14px; letter-spacing: -2px;
  user-select: none; padding: 0 4px; line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
.admin-lesson-row.dragging, .course-module-card.dragging { opacity: .45; }
.admin-lesson-row.drag-over, .course-module-card.drag-over { outline: 2px dashed var(--roxo); outline-offset: 2px; }
.att-file-zone.has-file { border-color: var(--roxo); background: var(--lilas-cl); }
.course-card-thumb { background-size: cover; background-position: center; }
.course-modal-right { padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--g2); border-radius: 0 0 20px 0; }
.course-modal-preview-label { font-size: 11px; font-weight: 600; color: var(--cinza); text-transform: uppercase; letter-spacing: .06em; }
.course-modal-preview {
  flex: 1; border-radius: 14px; background: #111;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background-size: cover; background-position: center;
  min-height: 180px;
}

/* ─── Courses Panel ───────────────────────────────────────────────────────── */
.course-picker-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.course-picker-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.course-picker-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-picker-left .overview-filter-wrap {
  flex-shrink: 0;
}
.course-picker-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.modal-card--categories {
  max-width: 520px;
  width: min(520px, calc(100vw - 48px));
}
.modal-fields--categories {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 28px 8px;
}
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(360px, 50vh);
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 4px;
}
.categories-hint { margin: 0 0 16px; }
.categories-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--g2);
  border: 1px solid var(--borda);
  border-radius: 12px;
}
.categories-row .badge {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.categories-add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--borda);
}
.categories-add-form input[type="text"] {
  width: 100%;
  min-height: 40px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  background: var(--g1);
  color: var(--cinza);
  box-sizing: border-box;
}
.categories-add-submit { width: 100%; justify-content: center; }
.modal-card--categories .modal-footer { justify-content: flex-end; }

.course-meta-card { margin-bottom: 20px; padding: 20px 24px; }
.course-meta-toggle { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.course-meta-toggle-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.course-meta-toggle-sub { font-size: 13px; color: var(--cinza); }
.course-meta-chevron { width: 18px; height: 18px; color: var(--cinza2); transition: transform .2s; flex-shrink: 0; }
.course-meta-card.open .course-meta-chevron { transform: rotate(180deg); }
.course-meta-body { display: none; border-top: 1px solid var(--borda); margin-top: 18px; padding-top: 18px; }
.course-meta-card.open .course-meta-body { display: block; }
.course-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin-bottom: 4px; }
.course-meta-grid .field { margin-bottom: 14px; }

.course-modules-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.course-module-list { display: flex; flex-direction: column; gap: 8px; }
.course-module-card { border: 1px solid var(--borda); border-radius: 12px; overflow: hidden; }
.course-module-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  cursor: pointer; background: var(--g1); transition: background .15s; user-select: none;
}
.course-module-head:hover { background: var(--g2); }
.course-module-num { font-size: 11px; color: var(--cinza2); font-weight: 700; min-width: 22px; flex-shrink: 0; }
.course-module-title { flex: 1; font-size: 14px; font-weight: 600; }
.course-module-chevron { width: 16px; height: 16px; color: var(--cinza2); transition: transform .2s; flex-shrink: 0; }
.course-module-card.open .course-module-chevron { transform: rotate(180deg); }
.course-module-body { display: none; padding: 12px 16px; border-top: 1px solid var(--borda); background: var(--g2); }
.course-module-card.open .course-module-body { display: block; }

/* ─── Lesson list rows ────────────────────────────────────────────────────── */
.admin-lesson-title { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-type-badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px;
  font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  flex-shrink: 0; white-space: nowrap;
}
.lesson-type-video    { background: rgba(87,34,247,.1);  color: var(--roxo); }
.lesson-type-exercise { background: rgba(16,185,129,.1); color: #059669; }
.lesson-type-resource { background: rgba(245,158,11,.1); color: #D97706; }
.lesson-add-row { border-top: 1px solid var(--borda); padding-top: 12px; margin-top: 8px; }

/* ─── Lesson Editor (full-panel page) ────────────────────────────────────── */
.lesson-editor-topbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
  padding-bottom: 16px; border-bottom: 1px solid var(--borda);
}
.lesson-editor-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex: 1;
  font-size: 13px; color: var(--cinza); overflow: hidden; white-space: nowrap;
}
.lesson-editor-breadcrumb span { overflow: hidden; text-overflow: ellipsis; }
.lesson-editor-hd {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap;
}
.lesson-editor-hd h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.lesson-editor-body {
  display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start;
}
.lesson-editor-main { display: flex; flex-direction: column; }
.lesson-editor-card { margin-bottom: 20px; }
.lesson-editor-card:last-child { margin-bottom: 0; }
.lesson-editor-sidebar .lesson-editor-card { margin-bottom: 0; }
/* ─── Lesson Editor — field styles ─ */
.le-field { margin-bottom: 16px; }
.le-field:last-child { margin-bottom: 0; }
.le-field label {
  font-size: 12px; font-weight: 500; display: block; margin-bottom: 6px; color: var(--text);
}
.le-field input,
.le-field select,
.le-field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--borda); font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--g1); outline: none; transition: border-color .2s, box-shadow .2s;
}
.le-field textarea { resize: vertical; }
.le-field input:focus,
.le-field select:focus,
.le-field textarea:focus { border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(87,34,247,.1); }
.le-optional { font-weight: 400; color: var(--cinza2); font-size: 11px; margin-left: 4px; }
.le-hint { display: block; font-size: 12px; color: var(--cinza2); margin-top: 6px; line-height: 1.5; }
@media (max-width: 900px) {
  .lesson-editor-body { grid-template-columns: 1fr; }
}

/* ─── Attachments — admin editor ─────────────────────────────────────────── */
.att-admin-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.att-admin-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--g2);
  border: 1px solid var(--borda);
}
.att-admin-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.att-admin-icon svg { width: 14px; height: 14px; }
.att-icon-link { background: rgba(87,34,247,.1); color: var(--roxo); }
.att-icon-text { background: rgba(16,185,129,.1); color: #059669; }
.att-icon-file { background: rgba(245,158,11,.1); color: #D97706; }
.att-admin-info { flex: 1; min-width: 0; }
.att-admin-label { font-size: 13px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-admin-sub { font-size: 11px; color: var(--cinza2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-add-wrap { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--borda); }
.att-add-fields { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.att-add-fields .le-field label { font-size: 12px; font-weight: 500; display: block; margin-bottom: 5px; color: var(--text); }
.att-type-fields { }
.att-file-zone {
  border: 2px dashed var(--borda); border-radius: 10px; padding: 16px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 13px; color: var(--cinza); transition: border-color .2s, background .2s;
}
.att-file-zone svg { width: 18px; height: 18px; flex-shrink: 0; }
.att-file-zone:hover { border-color: var(--roxo); background: var(--lilas-cl); }

/* ─── Attachments — student view ─────────────────────────────────────────── */
.lesson-att-block { margin: 24px 0; }
.lesson-att-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--cinza2); margin-bottom: 12px;
}
.lesson-att-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-att-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid var(--borda); font-size: 14px; font-weight: 500;
  color: var(--text); text-decoration: none; transition: border-color .2s, background .2s;
}
.lesson-att-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.lesson-att-link { cursor: pointer; }
.lesson-att-link:hover { border-color: var(--roxo); background: var(--lilas-cl); color: var(--roxo); }
.lesson-att-file svg { color: #D97706; }
.lesson-att-file:hover { border-color: #D97706; background: rgba(245,158,11,.06); }
.att-filename { font-size: 12px; color: var(--cinza2); font-weight: 400; margin-left: auto; }
.lesson-att-text { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; cursor: default; }
.lesson-att-text-hd {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  cursor: pointer; transition: background .15s;
}
.lesson-att-text-hd:hover { background: var(--g2); }
.lesson-att-text-hd svg { width: 18px; height: 18px; color: #059669; flex-shrink: 0; }
.lesson-att-text-hd > span { flex: 1; }
.att-copy-btn {
  font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 100px;
  border: 1px solid var(--borda); background: var(--g1); cursor: pointer;
  color: var(--cinza); transition: border-color .15s, color .15s; white-space: nowrap;
}
.att-copy-btn:hover { border-color: var(--roxo); color: var(--roxo); }
.lesson-att-text-body { display: none; border-top: 1px solid var(--borda); }
.lesson-att-text.open .lesson-att-text-body { display: block; }
.lesson-att-text-body pre {
  padding: 16px; font-size: 13px; line-height: 1.6; white-space: pre-wrap;
  word-break: break-word; color: var(--cinza); font-family: 'DM Sans', monospace;
  margin: 0; max-height: 320px; overflow-y: auto;
}

/* ─── Perfil do aluno ─────────────────────────────────────────────────────── */
.modal-overlay[hidden] { display: none !important; }

.profile-page { max-width: 720px; }
.profile-page-title {
  font-size: 22px; font-weight: 700; color: var(--text);
  margin: 0 0 24px;
}
.profile-section-head { margin-bottom: 16px; }
.profile-section-head h2 {
  font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--text);
}
.profile-section-head p {
  font-size: 13px; color: var(--cinza2); margin: 0;
}
.profile-card {
  background: var(--g1);
  border: 1px solid var(--borda);
  border-radius: 16px;
  padding: 28px 32px 24px;
  box-shadow: var(--shadow-sm);
}
.profile-field {
  margin-bottom: 22px;
}
.profile-field:last-of-type { margin-bottom: 8px; }
.profile-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.profile-input {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--borda);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--g1);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.profile-input:focus {
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px rgba(87, 34, 247, .1);
}
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--g2);
  border: 1px solid var(--borda);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-placeholder {
  font-size: 20px;
  font-weight: 600;
  color: var(--cinza);
}
.profile-card-footer .btn,
.modal-body--profile .btn,
.profile-pw-actions .btn {
  flex-shrink: 0;
}
.profile-email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 14px;
}
.profile-email-text { color: var(--text); }
.profile-link {
  color: #2563eb;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}
.profile-link:hover { text-decoration: underline; }
.profile-link--btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.profile-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 8px;
}
.user-ava-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-ava:has(img),
.topbar-user-ava:has(img) {
  padding: 0;
  overflow: hidden;
  background: var(--g2);
}

.modal-card--profile { max-width: 440px; }
.modal-body--profile { padding: 20px 24px 24px; }
.modal-desc {
  font-size: 14px;
  color: var(--cinza);
  line-height: 1.55;
  margin: 0 0 16px;
}
.modal-desc--sm { font-size: 13px; margin-top: 12px; margin-bottom: 0; }
.profile-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.modal-actions--right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.profile-pw-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-overlay--profile-pw .modal-card--profile-pw {
  padding: 28px 28px 24px;
  border: none;
  max-width: 420px;
}
.profile-pw-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}
.profile-pw-desc {
  margin-bottom: 24px;
  color: var(--cinza);
}
.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100010;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: min(92vw, 480px);
  text-align: center;
}
.app-toast[hidden] { display: none !important; }
.pw-form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  background: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.35);
}
.pw-form-error[hidden] { display: none !important; }
.pw-form-hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--cinza2);
}
.app-toast--ok { background: #059669; color: #fff; }
.app-toast--err { background: #DC2626; color: #fff; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .continue-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
  .curso-sidebar { width: 260px; }
}
@media (max-width: 900px) {
  :root {
    --nav-drawer-w: min(300px, 88vw);
    --curso-drawer-w: min(300px, 90vw);
  }
  .nav-drawer-open-btn { display: inline-flex; }
  .sidebar-toggle { display: none; }

  .sidebar {
    display: flex;
    width: var(--nav-drawer-w);
    max-width: 100vw;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s;
    z-index: 200;
    box-shadow: none;
  }
  html.nav-drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(11, 31, 59, 0.18);
  }
  html.nav-drawer-open {
    overflow: hidden;
  }

  .main-content { margin-left: 0 !important; }

  /* No mobile não usamos modo ícone — gaveta sempre com labels */
  html.sidebar-collapsed .sidebar-logo-text,
  html.sidebar-collapsed .nav-item-label,
  html.sidebar-collapsed .nav-section-label {
    opacity: 1;
    max-width: none;
    width: auto;
    pointer-events: auto;
  }
  html.sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding: 9px 12px;
    gap: 10px;
  }
  html.sidebar-collapsed .nav-item .nav-count { display: flex; }
  html.sidebar-collapsed .sidebar-logo {
    flex: 1;
    justify-content: flex-start;
    padding: 4px 8px;
  }
  html.sidebar-collapsed .sidebar-top {
    display: block;
    padding: 16px 10px 12px 12px;
  }
  html.sidebar-collapsed .sidebar-brand-row {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  html.sidebar-collapsed .sidebar-nav { padding: 16px 10px; }
  html.sidebar-collapsed .sidebar-user { padding: 16px 12px; }
  html.sidebar-collapsed .user-card {
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
  }
  html.sidebar-collapsed .user-info {
    opacity: 1;
    max-height: none;
    overflow: visible;
    pointer-events: auto;
  }
  html.sidebar-collapsed .nav-section-label {
    max-height: none;
    margin-bottom: 6px;
    padding: 0 8px;
  }

  .dash-body { padding: 16px 14px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .course-grid { grid-template-columns: 1fr; }
  .continue-row { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; gap: 10px; }
  .topbar--student .search-box { max-width: none; flex: 1 1 160px; min-width: 0; }
  .panel-badge { font-size: 11px; padding: 6px 10px; }
  .milestone-bar-wrap {
    flex: 1 1 100%;
    order: 10;
    min-width: 0;
  }

  .lesson-content { padding: 16px 14px; }
  .lesson-actions {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 10px;
  }
  .lesson-actions .btn-complete { flex: 1 1 200px; justify-content: center; }
  .lesson-actions .btn-nav { flex: 1 1 120px; justify-content: center; }

  /* Curso: índice em gaveta */
  .curso-outline-open-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--borda);
    background: var(--g2);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    margin-left: auto;
  }
  .curso-outline-open-btn svg { width: 18px; height: 18px; }
  .curso-outline-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    z-index: 105;
    background: rgba(11, 31, 59, 0.42);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }
  html.curso-outline-open .curso-outline-backdrop {
    display: block;
    left: var(--curso-drawer-w);
    right: 0;
    top: 60px;
    bottom: 0;
    opacity: 1;
    pointer-events: auto;
  }
  .curso-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: var(--curso-drawer-w);
    height: auto;
    max-height: calc(100dvh - 60px);
    z-index: 110;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s;
    box-shadow: none;
    border-right: 1px solid var(--borda);
  }
  html.curso-outline-open .curso-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(11, 31, 59, 0.16);
  }
  html.curso-outline-open {
    overflow: hidden;
  }
  .curso-progress-wrap { gap: 8px; }
  .curso-progress-bar { width: min(120px, 22vw); }

  .video-player {
    max-height: none;
    min-height: min(52vw, 280px);
  }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .curso-outline-open-btn-text { display: none; }
  .curso-outline-open-btn { padding: 8px 10px; }
  .login-right {
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .admin-toast {
    left: 12px;
    right: 12px;
    bottom: max(16px, env(safe-area-inset-bottom));
    max-width: none;
  }
}

/* ─── Checkout (Asaas) — layout em css/checkout.css ───────────────────────── */
.checkout-page .checkout-form-box { max-width: 480px; }
.checkout-courses {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}
.checkout-course-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--borda);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.checkout-course-item:has(input:checked) {
  border-color: var(--roxo);
  background: rgba(87, 34, 247, 0.08);
}
.checkout-course-item input { margin-top: 4px; accent-color: var(--roxo); }
.checkout-course-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.checkout-course-title { font-size: 14px; font-weight: 600; color: var(--texto); }
.checkout-course-sub { font-size: 12px; color: var(--cinza); line-height: 1.35; }
.checkout-course-price { font-size: 14px; font-weight: 600; color: var(--roxo-claro); white-space: nowrap; }
.checkout-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  margin: 8px 0 16px;
  border-radius: 12px;
  background: var(--card2);
  border: 1px solid var(--borda);
}
.checkout-total span { font-size: 14px; color: var(--cinza); }
.checkout-total strong { font-size: 1.25rem; color: var(--texto); }
.checkout-asaas-note {
  font-size: 12px;
  color: var(--cinza2);
  text-align: center;
  margin: 0;
}
.checkout-section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cinza);
  margin: 8px 0 10px;
}
.checkout-address-grid {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px 12px;
  margin-bottom: 16px;
}
.checkout-field-street { grid-column: 1 / -1; }
.checkout-field-hood { grid-column: 1 / -1; }
.checkout-field-comp { grid-column: 1 / -1; }
.checkout-field-city { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .checkout-address-grid { grid-template-columns: 1fr; }
  .checkout-field-num { grid-column: 1; }
}
.checkout-status-banner {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.checkout-status--ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}
.checkout-status--warn {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #fde047;
}

.checkout-wizard-box { max-width: 520px; }
.checkout-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.checkout-step {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--cinza2);
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.checkout-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 4px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: var(--card2);
  border: 1px solid var(--borda);
  vertical-align: middle;
}
.checkout-step.is-active {
  color: var(--texto);
  font-weight: 600;
  border-color: var(--roxo);
  background: rgba(87, 34, 247, 0.08);
}
.checkout-step.is-active span {
  background: var(--roxo);
  border-color: var(--roxo);
  color: #fff;
}
.checkout-step.is-done { color: var(--cinza); }
.checkout-step.is-done span {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}
.checkout-pane { display: none; }
.checkout-pane.is-active { display: block; }
.checkout-pane h2 {
  font-size: 1.35rem;
  margin: 0 0 6px;
  color: var(--texto);
}
.checkout-pane .subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--cinza);
}
.checkout-pane-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 10px;
}
.checkout-pane-actions--split {
  justify-content: space-between;
  align-items: center;
}
.checkout-pane-actions .btn-submit { flex: 1; max-width: 220px; }
.checkout-pane-actions--split .btn-submit { flex: 0 1 auto; }
.checkout-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card2);
  border: 1px solid var(--borda);
}
.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}
.checkout-summary-title { color: var(--texto); font-weight: 500; flex: 1; }
.checkout-summary-price { color: var(--roxo-claro); font-weight: 600; white-space: nowrap; }
.checkout-coupon-field { margin-bottom: 12px; }
.checkout-coupon-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.checkout-coupon-row input { flex: 1; min-width: 0; }
.checkout-coupon-msg {
  font-size: 12px;
  margin: 8px 0 0;
  line-height: 1.4;
}
.checkout-coupon-msg--ok { color: #86efac; }
.checkout-coupon-msg--err { color: #fca5a5; }
.checkout-total--detail {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.checkout-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--cinza);
}
.checkout-total-line--discount { color: #86efac; }
.checkout-total-line--final {
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--borda);
  color: var(--texto);
}
.checkout-total-line--final strong { font-size: 1.25rem; color: var(--texto); }
@media (max-width: 520px) {
  .checkout-step { font-size: 10px; padding: 6px 2px; }
  .checkout-step span { width: 18px; height: 18px; margin-right: 2px; }
}
