/* ============================================================
   Tema Certiva - Área do Aluno
   Identidade: azul #1E63D6 · navy #0E1A2B · off-white #F2F4F7 · Poppins
   Tema claro (padrão) e escuro: <html data-tema="escuro">.

   Os nomes antigos das variáveis (--gold, --obsidian, --cream…) foram mantidos
   para as páginas antigas continuarem funcionando; agora apontam para a marca:
     --obsidian  fundo da página      --grafite   cartões
     --gold      cor de ação (azul)   --cream     títulos / texto forte
   ============================================================ */

:root {
  color-scheme: light;
  --obsidian: #F2F4F7;
  --grafite: #FFFFFF;
  --grafite-2: #F7F9FC;
  --grafite-3: #EDF1F6;
  --line: #DDE3EC;
  --line-2: #CBD4E0;
  --gold: #1E63D6;
  --gold-bright: #174FB0;
  --gold-deep: #1E63D6;
  --gold-soft: #E7EFFC;
  --cream: #0E1A2B;
  --text: #1F2A3C;
  --text-2: #535D6E;
  --text-3: #6B7280;
  --success: #15803D;
  --success-soft: #E3F3E8;
  --warn: #B45309;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --navy: #0E1A2B;
  --sombra: 0 18px 48px rgba(14, 26, 43, .14);
  --raio: 18px;
}

html[data-tema="escuro"] {
  color-scheme: dark;
  --obsidian: #0A1320;
  --grafite: #111E31;
  --grafite-2: #16253B;
  --grafite-3: #1C2D46;
  --line: #24354E;
  --line-2: #2F4260;
  --gold: #3B7BEA;
  --gold-bright: #5A90F0;
  --gold-deep: #3B7BEA;
  --gold-soft: #16294A;
  --cream: #F2F6FC;
  --text: #E8EEF7;
  --text-2: #A3AEC0;
  --text-3: #8592A8;
  --success: #4ADE80;
  --success-soft: #123323;
  --warn: #FBBF24;
  --danger: #F87171;
  --danger-soft: #3A1717;
  --sombra: 0 18px 48px rgba(0, 0, 0, .5);
}

/* Poppins em tudo (os ícones <i class="ti"> mantêm a fonte deles) */
html, body, body *:not(i) {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}
body {
  background: var(--obsidian);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--cream); font-weight: 600; letter-spacing: -.01em; }

:focus-visible { outline: 3px solid #7FA8F0; outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ===== Layout app (sidebar + main) ===== */
.app {
  position: relative;
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

.main {
  position: relative;
  padding: 36px 48px 64px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

/* ===== Sidebar (sempre navy, nos dois temas) ===== */
.sidebar {
  background: var(--navy);
  color: #C3CEDF;
  padding: 28px 16px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 26px;
  text-decoration: none;
}
.brand-icon { width: 40px; height: 40px; flex-shrink: 0; }
.brand-logo { display: block; width: 141px; height: auto; }
.brand-name {
  color: #FFFFFF;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1;
}
.brand-sub {
  font-size: 7.5px;
  font-weight: 500;
  color: #6E9BEA;
  letter-spacing: .38em;
  text-transform: uppercase;
  margin-top: 6px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: #7C8AA3;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 18px 14px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  color: #C3CEDF;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
  transition: background-color .15s, color .15s;
}
.nav-item i { font-size: 20px; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.nav-item.active { background: #1E63D6; color: #FFFFFF; }
.nav-item .badge {
  margin-left: auto;
  background: rgba(255, 255, 255, .16);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tema-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
  color: #C3CEDF;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.tema-toggle:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.tema-toggle i { font-size: 18px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
}
.user-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1E63D6;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; color: #FFFFFF; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 12px; color: #7C8AA3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sair {
  width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: #9AA6B8;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.user-sair:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }

/* ===== Aviso de visualização (painel) ===== */
.preview-banner {
  background: rgba(30, 99, 214, .18);
  border: 1px solid rgba(110, 155, 234, .35);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #C3CEDF;
}
.preview-banner strong { display: block; color: #FFFFFF; font-size: 12px; margin-bottom: 4px; }
.preview-banner a { color: #9DB7E8; text-decoration: none; display: inline-block; margin-top: 6px; }
.preview-banner a:hover { color: #FFFFFF; }

/* Divisor (páginas antigas) */
.ornament { display: flex; align-items: center; gap: 14px; margin: 40px 0; }
.ornament-line { flex: 1; height: 1px; background: var(--line); }
.ornament-mark { display: none; }

/* ===== Elemento gráfico da marca: arco ===== */
.arco {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  border-color: transparent;
  border-top-color: #1E63D6;
  border-left-color: #1E63D6;
  transform: rotate(20deg);
  pointer-events: none;
}

/* ===== Navegação mobile (sidebar em gaveta) ===== */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--navy);
  border: 0;
  color: #FFFFFF;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--sombra);
}
.mobile-nav-toggle i { font-size: 22px; }
html[data-tema="escuro"] .mobile-nav-toggle { border: 1px solid rgba(255, 255, 255, .14); }
.menu-aberto .mobile-nav-toggle { opacity: 0; pointer-events: none; }
.menu-aberto { overflow: hidden; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 19, 32, .6);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 84vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200;
    overscroll-behavior: contain;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-nav-toggle { display: flex; }
  .main { padding: 24px 16px 48px; padding-top: 76px; }
}
