:root {
  --bg: #EAF5F0;
  --bg-soft: #f4faf7;
  --panel: #ffffff;
  --panel-alt: #edf8f3;
  --text: #0B2B20;
  --muted: #4f6f61;
  --primary: #10F090;
  --primary-strong: #00A86B;
  --support: #529B7D;
  --border: rgba(11, 43, 32, 0.08);
  --shadow: 0 12px 32px rgba(12, 42, 31, 0.10);
  color-scheme: light;
}
:root.dark-mode { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; }

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-brand { display: flex; align-items: center; gap: 0.8rem; }
.topbar-brand strong { display: block; font-size: 1.15rem; }
.topbar-brand small { display: block; color: var(--muted); }
.logo-mark {
  display: block; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; object-fit: contain;
}
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.topbar-user { display: inline-flex; align-items: center; gap: .55rem; }
.topbar-profile-photo { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-soft); object-fit: cover; }
.logout-form, .sidebar-logout-form { margin: 0; }
.menu-button { width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; font: inherit; }
.menu-icon { display: inline-flex; width: 1.25rem; height: 1.25rem; vertical-align: middle; margin-right: 0.5rem; }
.menu-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.user-badge {
  background: var(--panel-alt); border: 1px solid var(--border); padding: 0.6rem 0.9rem; border-radius: 999px; font-size: 0.9rem;
}
.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 50px;
  width: 50px;
  height: 41px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}
.theme-toggle:hover { background: var(--panel-alt); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle:focus-visible { outline: 3px solid var(--primary-strong); outline-offset: 3px; }
.theme-toggle[aria-disabled="true"] { cursor: progress; }

.layout {
  display: flex;
  flex: 1;
}
.sidebar {
  width: 260px;
  padding: 1.25rem 1rem;
  background: #f7fbf8;
  border-right: 1px solid var(--border);
}
.sidebar-header { display: flex; gap: 0.8rem; align-items: center; padding: 0.8rem; margin-bottom: 1rem; }
.sidebar-header strong { display: block; }
.sidebar-header small { color: var(--muted); }
.menu-list { display: flex; flex-direction: column; gap: 0.35rem; }
.menu-item {
  display: block; padding: 0.8rem 0.85rem; border-radius: 12px; color: var(--text); transition: 0.2s ease; font-weight: 600;
}
.menu-item:hover, .menu-item.active { background: var(--primary); color: var(--text); }

.content {
  flex: 1;
  padding: 2rem;
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem;
}
.page-header h1, .page-header h2 { margin: 0; font-size: clamp(1.7rem, 2vw, 2.5rem); }
.page-header p { margin: 0.4rem 0 0; color: var(--muted); }

.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; color: var(--support); margin-bottom: 0.4rem;
}

.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }

.progress-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(16, 240, 144, 0.12), rgba(255,255,255,0.96), rgba(82,155,125,0.04));
  border: 1px solid rgba(16, 240, 144, 0.18);
}
.progress-hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -45px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,240,144,0.16), transparent 70%);
  pointer-events: none;
}
.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.progress-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.progress-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16,240,144,0.35);
  box-shadow: 0 10px 24px rgba(11, 43, 32, 0.06);
}
.progress-card .label { color: var(--muted); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.progress-card strong { font-size: clamp(1.4rem, 2vw, 2rem); }
.progress-card small { color: var(--muted); line-height: 1.4; }

.student-metrics {
  margin-top: 1.25rem;
}
.student-dashboard-grid {
  margin-top: 1.25rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 142px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(12, 42, 31, 0.08);
}
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
}
.metric-card .value { font-size: 2rem; font-weight: 700; }
.metric-card .label { color: var(--muted); }
.metric-card .trend { display: inline-flex; font-size: 0.8rem; color: var(--primary-strong); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border: none; border-radius: 12px; cursor: pointer; font-weight: 700; text-decoration: none; transition: 0.2s ease; padding: 0.8rem 1rem;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: var(--text); }
.btn-secondary { background: var(--panel-alt); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #ea5a5a; color: white; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

.form-grid { display: grid; gap: 1rem; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-field { display: flex; flex-direction: column; gap: 0.45rem; }
label { font-weight: 600; }
input, textarea, select {
  width: 100%; border: 1px solid var(--border); background: var(--bg-soft); border-radius: 12px; padding: 0.9rem 1rem; color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(16,240,144,0.2); border-color: var(--primary-strong); }

.alert { padding: 0.9rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.alert.success { background: rgba(16,240,144,0.14); color: var(--text); border: 1px solid rgba(16,240,144,0.3); }
.alert.error { background: rgba(234,90,90,0.12); color: #7a1f1f; border: 1px solid rgba(234,90,90,0.2); }

.list-table { width: 100%; border-collapse: collapse; }
.list-table th, .list-table td { padding: 0.9rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.list-table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }
.badge { display: inline-flex; padding: 0.35rem 0.7rem; border-radius: 999px; background: var(--panel-alt); border: 1px solid var(--border); }
.table-wrap { width: 100%; overflow-x: auto; }
.agenda-stats { margin-bottom: 1.5rem; }
.agenda-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.agenda-filter { min-width: 180px; }
.btn-small { padding: 0.55rem 0.9rem; font-size: 0.85rem; }
.inline-form { margin: 0; }
.password-students-card { margin-top: 1.25rem; }
.password-own-card > p, .password-students-card > p { color: var(--muted); }
.password-own-form { max-width: 760px; }
.password-student-form { grid-template-columns: repeat(2, minmax(130px, 1fr)) auto; min-width: 520px; align-items: center; }
.agenda-highlight { background: linear-gradient(135deg, rgba(16,240,144,0.08), rgba(255,255,255,0.96)); }
.agenda-highlight h2 { margin: 0.15rem 0 0.8rem; }
.agenda-meta { display: flex; flex-wrap: wrap; gap: 0.8rem; color: var(--muted); font-size: 0.94rem; }
.agenda-event-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.agenda-event-card {
  display: flex; flex-direction: column; gap: 0.8rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; padding: 1rem;
}
.agenda-item-header { display: flex; justify-content: flex-start; }
.agenda-event-card h4 { margin: 0; font-size: 1.15rem; }
.agenda-event-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.3rem; align-items: stretch; }
.hero-panel { padding: 1.5rem; }
.hero-panel h2 { margin-top: 0; }
.inline-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.question-preview { display: grid; gap: 0.9rem; }
.question-block { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.question-block h4 { margin-top: 0; }
.option-list { display: grid; gap: 0.5rem; }
.option-item { padding: 0.7rem 0.85rem; border-radius: 10px; border: 1px solid var(--border); background: white; }

.auth-page {
  min-height: 100vh; display: grid; place-items: center; position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(circle at top, #f2fff8 0%, var(--bg) 52%);
  padding: 2rem;
}
.auth-background-video, .auth-video-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-background-video {
  z-index: -2;
  object-fit: cover;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
.auth-video-overlay {
  z-index: -1;
  background: linear-gradient(135deg, rgba(4, 35, 25, 0.68), rgba(8, 54, 38, 0.5));
  pointer-events: none;
}
.auth-card {
  width: min(520px, 100%); background: rgba(255,255,255,0.94); border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 2rem;
}
.auth-page .auth-card {
  position: relative;
  z-index: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}
.auth-page.is-leaving .auth-card {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
}
.mobile-dashboard-tabs { display: none; }
.user-type-picker { border: 0; padding: 0; margin: 0; display: flex; flex-direction: row; gap: 0.8rem; }
.user-type-picker legend { font-weight: 700; margin-bottom: 0.5rem; }
.user-type-option { flex: 1; cursor: pointer; }
.user-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.user-type-option span {
  display: block; text-align: center; border: 1px solid var(--border); background: var(--bg-soft);
  padding: 0.85rem; border-radius: 12px; transition: 0.2s ease;
}
.user-type-option input:checked + span { border-color: var(--primary-strong); background: rgba(16, 240, 144, 0.18); }
[hidden] { display: none !important; }

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #0B2B20;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.96), rgba(234, 245, 240, 0.98) 55%, #dceddf 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 420ms ease;
}
.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem;
  text-align: center;
}
.beaker-animation {
  position: relative;
  width: 180px;
  height: 205px;
  margin-bottom: 0.5rem;
  transform: translate3d(0, 0, 0);
  animation: beaker-float 5.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}
.beaker-svg { width: 100%; height: 100%; overflow: visible; }
.beaker-liquid {
  transform-box: fill-box;
  transform-origin: center bottom;
  transform: translate3d(0, 0, 0) scaleY(0.12);
  animation: liquid-fill 1.6s cubic-bezier(0.22, 0.68, 0.25, 1) both;
}
.beaker-wave {
  fill: url(#beaker-liquid-gradient);
  transform-box: fill-box;
  transform-origin: center;
  backface-visibility: hidden;
}
.beaker-wave-back { opacity: 0.62; animation: wave-drift 5.8s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }
.beaker-wave-front { opacity: 0.9; animation: wave-drift 4.9s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate-reverse; }
.beaker-glass {
  fill: rgba(255, 255, 255, 0.38);
  stroke: #529B7D;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.beaker-mark, .beaker-highlight { fill: none; stroke: rgba(82, 155, 125, 0.62); stroke-width: 3; stroke-linecap: round; }
.beaker-highlight { stroke: rgba(255,255,255,0.9); stroke-width: 4; }
.beaker-bubble {
  position: absolute;
  z-index: 1;
  bottom: 32px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  transform: translate3d(0, 0, 0);
  animation: bubble-rise 3.4s cubic-bezier(0.32, 0, 0.58, 1) infinite;
  will-change: transform, opacity;
}
.bubble-one { left: 43%; animation-delay: 0s; }
.bubble-two { left: 57%; width: 6px; height: 6px; animation-delay: 1.1s; }
.bubble-three { left: 66%; width: 5px; height: 5px; animation-delay: 2.2s; }
.loading-title { margin-top: 0.25rem; font-size: 1.1rem; }
.loading-caption { color: #4f6f61; font-size: 0.9rem; }
.loading-decoration {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(82, 155, 125, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(82, 155, 125, 0.06);
  animation: particle-drift 7s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
.loading-decoration-one { top: 25%; left: 24%; }
.loading-decoration-two { right: 23%; bottom: 25%; width: 7px; height: 7px; animation-delay: 1.2s; }
.loading-screen.is-hidden * { animation-play-state: paused !important; }
body.loading-active .app-shell { visibility: hidden; }

@keyframes liquid-fill {
  from { transform: translate3d(0, 0, 0) scaleY(0.12); }
  to { transform: translate3d(0, 0, 0) scaleY(1); }
}
@keyframes wave-drift {
  from { opacity: 0.58; }
  to { opacity: 0.78; }
}
@keyframes beaker-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -6px, 0); }
}
@keyframes bubble-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.7); }
  12% { opacity: 0.85; }
  76% { opacity: 0.7; }
  100% { opacity: 0; transform: translate3d(2px, -72px, 0) scale(1.05); }
}
@keyframes particle-drift {
  from { transform: translate3d(0, -5px, 0); opacity: 0.5; }
  to { transform: translate3d(0, 6px, 0); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .beaker-animation, .beaker-liquid, .beaker-wave, .beaker-bubble, .loading-decoration { animation: none; }
  .beaker-liquid { transform: translate3d(0, 0, 0) scaleY(1); }
  .loading-screen, .auth-page .auth-card { transition-duration: 1ms; }
}

.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-header .logo-mark { width: 80px; height: 80px; margin: 0 auto 1rem; }
.auth-actions { display: flex; gap: 0.7rem; justify-content: center; }

.empty-state { padding: 2rem 1rem; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 1rem; }
  .grid-3, .grid-4, .hero { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
}

@view-transition {
  navigation: auto;
}

/* =====================================================================
   Melhorias visuais (mesma paleta: --primary, --primary-strong, --support)
   ===================================================================== */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
input[type="checkbox"], input[type="radio"] { width: auto; }
code { background: var(--panel-alt); border: 1px solid var(--border); border-radius: 6px; padding: 0.05rem 0.35rem; font-size: 0.9em; }
.btn-small { padding: 0.5rem 0.85rem; font-size: 0.85rem; border-radius: 10px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary:not(:disabled):hover { filter: brightness(1.04); transform: translateY(-1px); }
.badge-ok { background: rgba(16, 240, 144, 0.16); border-color: rgba(0, 168, 107, 0.35); }
.badge-warn { background: rgba(255, 193, 7, 0.18); border-color: rgba(255, 193, 7, 0.5); }
.check-line { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }

/* Barra lateral */
.sidebar { position: sticky; top: 74px; align-self: flex-start; max-height: calc(100vh - 74px); overflow-y: auto; background: var(--panel); }
.sidebar-header { background: var(--panel-alt); border: 1px solid var(--border); border-radius: 16px; }
.menu-group-title { margin: 1rem 0.5rem 0.25rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.menu-group-title:first-child { margin-top: 0.2rem; }
.menu-item { display: flex; align-items: center; gap: 0.7rem; position: relative; isolation: isolate; transition: transform 180ms ease, color 180ms ease; }
.menu-item::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  content: "";
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms cubic-bezier(0.2, 0.75, 0.25, 1);
}
.menu-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--panel-alt); font-size: 0.95rem; transition: transform 240ms cubic-bezier(0.2, 0.75, 0.25, 1), background-color 200ms ease; }
.menu-item:hover:not(.active) { background: var(--panel-alt); transform: translateX(2px); }
.menu-item:hover .menu-icon { background: rgba(16, 240, 144, 0.28); }
.menu-item.active { background: transparent; color: #04110b; box-shadow: 0 6px 16px rgba(0, 168, 107, 0.18); view-transition-name: none; }
.menu-item.active::before { transform: scaleX(1); }
.menu-item.active .menu-icon { background: rgba(255, 255, 255, 0.45); transform: scale(1.04); }
.menu-item > span:last-child { transition: opacity 220ms ease, transform 220ms ease; }

@media (min-width: 901px) {
  .app-shell:has(> .layout) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .app-shell:has(> .layout) > .layout {
    min-height: 0;
    overflow: hidden;
  }
  .app-shell:has(> .layout) > .layout > .sidebar {
    position: relative;
    top: auto;
    align-self: stretch;
    height: auto;
    max-height: none;
    flex: 0 0 260px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .app-shell:has(> .layout) > .layout > .content {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media print {
  .app-shell:has(> .layout) {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .app-shell:has(> .layout) > .layout,
  .app-shell:has(> .layout) > .layout > .content {
    min-height: 0;
    overflow: visible;
  }
}

html.navigation-departure .menu-item.active,
html.navigation-arrival .menu-item.active { view-transition-name: active-menu-item; }
html.navigation-arrival .menu-item.active::before {
  animation: menu-active-expand 380ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
html.navigation-arrival .menu-item.active .menu-icon {
  animation: menu-icon-arrive 340ms 90ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
html.navigation-arrival .menu-item.active > span:last-child {
  animation: menu-label-arrive 300ms 70ms ease-out both;
}
@keyframes menu-active-expand {
  from { transform: scaleX(0.08); opacity: 0.65; }
  to { transform: scaleX(1); opacity: 1; }
}
@keyframes menu-icon-arrive {
  from { transform: translateX(-3px) scale(0.82); }
  to { transform: scale(1.04); }
}
@keyframes menu-label-arrive {
  from { opacity: 0.55; transform: translateX(3px); }
  to { opacity: 1; transform: translateX(0); }
}

html.navigation-arrival main.content > .page-header {
  animation: navigation-content-enter 360ms 0ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
html.navigation-departure main.content {
  animation: navigation-content-leave 140ms ease-in both;
}
html.navigation-arrival main.content > :is(.quick-grid, .student-metrics, .analytics-metrics, .grid, .hero, .review-modes, .lab-layout) {
  animation: navigation-content-enter 360ms 55ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
html.navigation-arrival main.content > :is(.card, .analytics-section, .review-filters, .instrument-search, .table-wrap, .student-engagement, .review-content-section) {
  animation: navigation-content-enter 360ms 110ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
@keyframes navigation-content-enter {
  from { opacity: 0; transform: translate3d(18px, 0, 0) scale(0.99); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes navigation-content-leave {
  to { opacity: 0; transform: translate3d(-12px, 0, 0) scale(0.995); }
}

::view-transition {
  pointer-events: none;
}
::view-transition-group(root) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.2, 0.75, 0.25, 1);
}
::view-transition-old(root) {
  animation: navigation-page-leave 220ms ease-in both;
}
::view-transition-new(root) {
  animation: navigation-page-enter 380ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
::view-transition-group(active-menu-item) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.2, 0.75, 0.25, 1);
}
@keyframes navigation-page-leave {
  to { opacity: 0; transform: translate3d(-18px, 0, 0) scale(0.99); }
}
@keyframes navigation-page-enter {
  from { opacity: 0; transform: translate3d(24px, 0, 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* Cartões do dashboard */
.metric-card { position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.quick-card { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); transition: 0.2s ease; }
.quick-card:hover { transform: translateY(-2px); border-color: var(--primary-strong); }
.quick-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; font-size: 1.35rem; background: linear-gradient(135deg, rgba(16, 240, 144, 0.35), rgba(0, 168, 107, 0.25)); }
.quick-card strong { display: block; }
.quick-card small { color: var(--muted); }

/* Questões e alternativas (rádios) */
.question-card { display: grid; gap: 0.9rem; }
.question-number { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary-strong); }
.question-statement { margin: 0; font-size: 1.05rem; line-height: 1.6; }
.option-list { display: grid; gap: 0.6rem; }
.option-item { position: relative; display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.8rem 1rem; border: 1.5px solid var(--border); border-radius: 14px; background: var(--panel); cursor: pointer; transition: 0.15s ease; }
.option-item:hover { border-color: var(--primary-strong); background: var(--panel-alt); }
.option-item input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.option-letter { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-weight: 700; background: var(--panel-alt); border: 1.5px solid var(--border); transition: 0.15s ease; }
.option-text { padding-top: 0.2rem; line-height: 1.45; }
.option-item:has(input:checked) { border-color: var(--primary-strong); background: rgba(16, 240, 144, 0.14); box-shadow: 0 0 0 3px rgba(16, 240, 144, 0.2); }
.option-item:has(input:checked) .option-letter { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); border-color: transparent; color: #04110b; }
.option-item:has(input:focus-visible) { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.option-item.is-correct { border-color: var(--primary-strong); background: rgba(16, 240, 144, 0.14); cursor: default; }
.option-item.is-correct .option-letter { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); border-color: transparent; color: #04110b; }

/* Abas */
.tabs { position: sticky; top: 80px; z-index: 8; display: flex; gap: 0.4rem; width: fit-content; max-width: 100%; margin-bottom: 1.2rem; padding: 0.35rem; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 0.65rem 1.1rem; border-radius: 10px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.is-active { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #04110b; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: tab-panel-enter 180ms ease both; }
.tab-panel.is-leaving { animation: tab-panel-leave 120ms ease both; }
@keyframes tab-panel-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tab-panel-leave {
  to { opacity: 0; transform: translateY(-4px); }
}

/* Chat das IAs */
.chat-panel { display: flex; flex-direction: column; gap: 1rem; }
.chat-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.chat-status { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--muted); }
.chat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(16, 240, 144, 0.25); }
.chat-messages { display: flex; flex-direction: column; gap: 0.9rem; min-height: 320px; max-height: 55vh; overflow-y: auto; padding: 1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; }
.chat-row { display: flex; align-items: flex-start; gap: 0.6rem; max-width: 88%; }
.chat-row-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 0.8rem; font-weight: 700; color: #04110b; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); }
.chat-row-user .chat-avatar { background: var(--support); color: #fff; }
.chat-bubble { padding: 0.7rem 1rem; line-height: 1.55; word-break: break-word; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.chat-row-user .chat-bubble { background: rgba(16, 240, 144, 0.16); border-color: rgba(0, 168, 107, 0.3); }
.chat-bubble p { margin: 0.25rem 0; }
.chat-bubble ul, .chat-bubble ol { margin: 0.4rem 0; padding-left: 1.25rem; }
.chat-bubble h4 { margin: 0.6rem 0 0.2rem; }
.chat-row.is-error .chat-bubble { background: rgba(234, 90, 90, 0.12); border-color: rgba(234, 90, 90, 0.35); }
.chat-row.is-typing .chat-bubble { opacity: 0.7; font-style: italic; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { border: 1px solid var(--border); background: var(--panel-alt); color: var(--text); border-radius: 999px; padding: 0.45rem 0.95rem; font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: 0.15s ease; }
.chip:hover { border-color: var(--primary-strong); background: rgba(16, 240, 144, 0.18); }
.chat-form { display: flex; align-items: flex-end; gap: 0.75rem; }
.chat-form textarea { flex: 1; min-height: 58px; }
.chat-footnote { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* Busca ENEM */
.enem-results { display: grid; gap: 1.2rem; margin-top: 1.2rem; }
.enem-pick { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }

@media (max-width: 900px) {
  .sidebar { position: static; max-height: none; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* NATIVIDADE: componentes analíticos e ícones acessíveis */
svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-icon svg, .quick-icon svg, .metric-icon svg, .theme-icon { width: 1.15rem; height: 1.15rem; }
.quick-icon, .metric-icon { display: grid; place-items: center; color: var(--primary-strong); }
.theme-toggle .theme-icon {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  transition: opacity 260ms ease, transform 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}
.theme-icon-sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-icon-moon { opacity: 0; transform: rotate(90deg) scale(0.55); }
body.dark-mode .theme-icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.55); }
body.dark-mode .theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle.is-animating { animation: theme-button-press 420ms cubic-bezier(0.2, 0.75, 0.25, 1); }
@keyframes theme-button-press {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(0.92); }
}

body.theme-color-transition,
body.theme-color-transition :where(*) {
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: 520ms;
  transition-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle .theme-icon { transition-duration: 1ms; }
  .theme-toggle.is-animating { animation: none; }
  body.theme-color-transition,
  body.theme-color-transition :where(*) { transition-duration: 1ms; }
  .menu-item,
  .menu-item::before,
  .menu-icon,
  .menu-item > span:last-child { transition-duration: 1ms; }
  html.navigation-arrival .menu-item.active::before,
  html.navigation-arrival .menu-item.active .menu-icon,
  html.navigation-arrival .menu-item.active > span:last-child,
  html.navigation-arrival main.content > .page-header,
  html.navigation-arrival main.content > :is(.quick-grid, .student-metrics, .analytics-metrics, .grid, .hero, .review-modes, .lab-layout),
  html.navigation-arrival main.content > :is(.card, .analytics-section, .review-filters, .instrument-search, .table-wrap, .student-engagement, .review-content-section) { animation: none; }
  html.navigation-departure main.content,
  .tab-panel.is-active,
  .tab-panel.is-leaving,
  .history-chart:not(.is-hidden),
  .mobile-tab-panel:not(.is-mobile-hidden) { animation: none; }
  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-group(active-menu-item) { animation-duration: 1ms !important; }
}
.eyebrow { display: block; margin-bottom: .35rem; color: var(--primary-strong); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.analytics-metrics { margin-top: 1.25rem; }
.metric-card { min-height: 142px; }
.metric-card .metric-icon { margin-bottom: .3rem; width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--panel-alt); }
.analytics-section { margin-top: 1.25rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading h2 { margin: 0; font-size: 1.1rem; }
.text-link { color: var(--primary-strong); font-weight: 700; font-size: .88rem; }
.status-list, .deadline-list { display: grid; gap: .9rem; }
.status-row { display: grid; grid-template-columns: 1fr auto; gap: .45rem .8rem; align-items: center; font-size: .9rem; }
.status-row strong { font-size: 1rem; }
.status-bar, .bar-track { display: block; grid-column: 1 / -1; height: 8px; overflow: hidden; border-radius: 999px; background: var(--bg-soft); }
.status-bar i, .bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary-strong); }
.status-bar .status-running { background: #d6a72c; }
.status-bar .status-closed { background: var(--support); }
.bar-row { display: grid; grid-template-columns: minmax(90px, .65fr) 1fr auto; gap: .8rem; align-items: center; margin-bottom: .95rem; }
.bar-row > div { display: grid; gap: .15rem; }
.bar-track { grid-column: auto; }
.deadline-item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,250,247,0.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.deadline-item span { display: grid; gap: .2rem; }
.deadline-item small { color: var(--muted); }
.deadline-item time { color: var(--muted); font-size: .86rem; white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(16, 240, 144, .55); outline-offset: 2px; }

.chat-card { padding: 1.25rem; }
.chat-messages { display: grid; gap: .75rem; min-height: 260px; max-height: 52vh; overflow-y: auto; padding: 1rem; border-radius: 14px; background: var(--bg-soft); }
.chat-bubble { width: min(80%, 520px); padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; background: var(--panel); }
.chat-bubble-own { justify-self: end; border-radius: 14px 14px 4px 14px; background: rgba(16, 240, 144, .14); }
.chat-bubble strong, .chat-bubble p, .chat-bubble time { display: block; }
.chat-bubble p { margin: .35rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble time { color: var(--muted); font-size: .75rem; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; margin-top: 1rem; }
.chat-form textarea { min-height: 74px; }
.chat-form-status { grid-column: 1 / -1; min-height: 1.2em; margin: 0; color: var(--muted); font-size: .82rem; }
.chat-form-status[data-state="error"] { color: #b64040; }
.chat-form-status[data-state="success"] { color: #187a56; }
@media (max-width: 720px) { .chat-form { grid-template-columns: 1fr; } .chat-bubble { width: 92%; } }

.table-wrap { overflow-x: auto; }
.student-name { display: block; color: var(--text); font-weight: 700; }
.detail-only { display: block; margin-top: .2rem; font-size: .78rem; }
.class-card, .notebook-card { min-height: 170px; transition: transform .2s ease, border-color .2s ease; }
.class-card:hover, .notebook-card:hover { transform: translateY(-2px); border-color: var(--primary-strong); }
.class-card h2, .notebook-card h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.class-card p, .notebook-card p { min-height: 2.8rem; color: var(--muted); }
.notebook-create, .notebook-search, .notebook-editor { margin-bottom: 1.25rem; }
.notebook-create h2 { margin-top: 0; font-size: 1.1rem; }
.notebook-create form { align-items: end; }
.notebook-create .btn { align-self: end; }
.notebook-search .form-field { margin: 0; }
.notebook-editor > form { margin-bottom: 1rem; }
.add-question-form { padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); }
.add-question-form select { flex: 1; min-width: 0; }
.notebook-question-list { display: grid; gap: .8rem; padding: 0; margin: 0 0 1rem; list-style: none; }
.notebook-question-list .question-block { cursor: grab; }
.notebook-question-list .question-block:active { cursor: grabbing; }
.notebook-question-list .question-block.is-dragging { opacity: .5; border: 2px dashed var(--primary-strong); }
.question-reorder-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.profile-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.profile-facts div { display: grid; gap: .3rem; padding: .9rem; border-radius: 12px; background: var(--bg-soft); }
@media (max-width: 720px) { .profile-facts { grid-template-columns: 1fr; } .notebook-create form .btn { width: 100%; } .list-table { min-width: 720px; } }

.student-dashboard-grid, .review-modes, .lab-layout { margin-top: 1.25rem; }
.student-metrics { margin-top: 1.25rem; }
.student-metrics .metric-card { box-shadow: 0 10px 24px rgba(11, 43, 32, 0.05); }
.review-filters, .instrument-search { margin-bottom: 1.25rem; }
.review-question { max-width: 880px; }
.review-statement { font-size: 1.15rem; line-height: 1.65; }
.review-options { display: grid; gap: .7rem; margin-top: 1.25rem; }
.review-option { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); cursor: pointer; }
.review-option:has(input:checked) { border-color: var(--primary-strong); background: rgba(16, 240, 144, .12); }
.review-option input { margin-top: .25rem; }
.review-summary { margin-bottom: 1.25rem; }
.review-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-top: 1rem; }
.review-questions-list { display: grid; gap: 1rem; }
.review-question-item { display: grid; gap: .9rem; }
.review-question-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.review-question-head h2 { margin: .2rem 0 0; font-size: 1.2rem; line-height: 1.5; }
.review-detail-list { display: grid; gap: .45rem; margin: 0; padding-left: 1.1rem; color: var(--text); }
.review-resolution { display: grid; gap: .75rem; }
.resolution-panel { padding: 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); }
.resolution-panel h3 { margin-top: 0; }
.resolution-panel ol { margin: 0; padding-left: 1.2rem; line-height: 1.7; }
.status-correta { background: rgba(16, 240, 144, 0.15); color: #0a7a46; }
.status-incorreta { background: rgba(239, 68, 68, .12); color: #b42318; }
.status-sem-resposta { background: rgba(245, 158, 11, .12); color: #b7791f; }
.site-credit { padding: 1.2rem; color: var(--muted); font-size: .82rem; text-align: center; }
@media (max-width: 720px) { .review-question-head { display: block; } .review-question-head .badge { margin-top: .75rem; display: inline-flex; } }
.lab-modules { display: grid; gap: .65rem; margin-top: 1rem; }
.lab-module {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,250,247,0.9));
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.lab-module:hover { transform: translateY(-1px); border-color: rgba(16,240,144,0.35); }
.lab-module span:first-child { display: grid; gap: .2rem; }
.lab-module small { color: var(--muted); }
.lab-module.is-active { border-color: var(--primary-strong); background: rgba(16, 240, 144, .12); box-shadow: 0 8px 18px rgba(16,240,144,0.08); }
.lab-scene { display: grid; place-items: center; min-height: 260px; margin: 1rem 0; border-radius: 16px; background: radial-gradient(circle at 50% 30%, var(--panel-alt), var(--bg-soft)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); }
.lab-vessel { position: relative; width: 150px; height: 205px; border: 3px solid var(--support); border-top: 0; border-radius: 0 0 28px 28px; background: rgba(255,255,255,.12); overflow: hidden; }
.liquid-level { position: absolute; inset: 93px 0 0; background: rgba(56, 160, 210, .45); }
.meniscus { position: absolute; top: 91px; left: 0; right: 0; height: 5px; border-radius: 50%; background: #4ca7d0; }
.measurement { position: absolute; left: 9px; width: 32px; border-top: 1px solid var(--muted); color: var(--muted); font-size: .7rem; }
.measurement-10 { top: 165px; }.measurement-25 { top: 135px; }.measurement-50 { top: 90px; }.measurement-75 { top: 47px; }.measurement-100 { top: 8px; width: 55px; }
.lab-answer { display: grid; gap: .75rem; max-width: 420px; }
.lab-data, .lab-safety { margin-top: 1rem; padding: 1rem; border-radius: 12px; background: var(--bg-soft); }
.instrument-card { display: flex; flex-direction: column; gap: .55rem; }
.instrument-card h2 { margin: 0; font-size: 1.2rem; }
.instrument-card p { flex: 1; color: var(--muted); }
.instrument-image-fallback, .instrument-image-large { display: grid; place-items: center; min-height: 150px; width: 100%; border-radius: 14px; object-fit: cover; background: var(--panel-alt); color: var(--muted); }
.instrument-fallback-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: .4rem; border-radius: 16px; background: var(--primary); color: var(--text); font-size: 1.5rem; font-weight: 800; }
.instrument-image-large { min-height: 220px; max-height: 320px; margin-bottom: 1rem; }
.instrument-detail { margin-bottom: 1.25rem; }
.instrument-detail .profile-facts { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .instrument-detail .profile-facts { grid-template-columns: 1fr; } .lab-layout { grid-template-columns: 1fr; } }

.mascot-card { display: flex; align-items: center; gap: 1rem; min-height: 100%; padding: 1rem 1.2rem; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.mascot-card img { width: 112px; height: 112px; object-fit: contain; flex: 0 0 auto; }
.mascot-card p { margin: 0; line-height: 1.5; }
.student-engagement { margin-top: 1.25rem; }
.achievement-list { display: grid; gap: .7rem; }
.achievement-item { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: 12px; background: var(--bg-soft); }
.achievement-item > span:last-child { display: grid; gap: .2rem; }
.achievement-item small { color: var(--muted); }
.achievement-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--primary); color: var(--text); font-weight: 800; }
@media (max-width: 720px) { .mascot-card { align-items: flex-start; } .mascot-card img { width: 84px; height: 84px; } }

.formula-search-panel { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.formula-search-box { display: flex; gap: .75rem; }
.formula-search-box input { width: 100%; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); }
.formula-suggestion-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.formula-results-summary { margin-bottom: .9rem; color: var(--muted); font-weight: 600; }
.formula-grid { display: grid; gap: 1rem; }
.formula-card { display: grid; gap: .9rem; }
.formula-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.formula-card-header h3 { margin: 0; font-size: 1.2rem; }
.formula-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.formula-actions { display: flex; justify-content: flex-end; }
.formula-detail { display: grid; gap: .75rem; margin-bottom: 1.25rem; }
.formula-detail-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.formula-detail p { margin: 0; line-height: 1.6; }
.formula-detail strong { color: var(--text); }
@media (max-width: 720px) { .formula-card-header, .formula-detail-header { display: block; } .formula-card-header .badge { margin-top: .7rem; display: inline-flex; } }

/* Relatórios pedagógicos */
.report-builder, .report-history, .report-view { margin-bottom: 1.25rem; }
.report-draft-divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.report-content { white-space: normal; line-height: 1.75; padding: 1.25rem; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); margin: 1rem 0; overflow-wrap: anywhere; }
.report-view .section-heading p { margin-bottom: 0; }
@media print {
  body { background: #fff !important; color: #111 !important; }
  .topbar, .sidebar, .report-view .btn, .report-view .section-heading button, footer { display: none !important; }
  .layout, .content { display: block !important; width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .report-view { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  .report-content { border: 0 !important; background: #fff !important; padding: 0 !important; }
}


/* Etapa 5 — laboratório virtual e ilustrações de instrumentos */
.lab-progress-summary { margin-bottom: 1.25rem; display: grid; gap: .8rem; }
.lab-progress-summary h2 { margin: .25rem 0; font-size: 1.2rem; }
.lab-progress-summary p { margin: 0; color: var(--muted); }
.lab-progress-track { width: 100%; height: 10px; overflow: hidden; border-radius: 999px; background: var(--border); }
.lab-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary-strong); transition: width .25s ease; }
.lab-experiment-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.lab-experiment-number { color: var(--muted); font-size: .85rem; font-weight: 700; }
.lab-scene { gap: .5rem; padding: 1rem; }
.lab-scene img { max-width: 100%; height: auto; object-fit: contain; }
.lab-scene-caption { max-width: 100%; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.lab-completion-note { color: var(--muted); font-size: .9rem; }
.instrument-card img { width: 100%; min-height: 150px; max-height: 190px; object-fit: contain; border-radius: 14px; background: var(--panel-alt); }
.instrument-image-large { object-fit: contain; padding: 1rem; }
@media (prefers-reduced-motion: reduce) { .lab-progress-track span { transition: none; } }


/* Revisão interativa — progresso, flashcards e feedback acessível */
.review-progress { margin: 1.25rem 0; }
.review-stat { display: flex; flex-direction: column; gap: .45rem; }
.review-stat-label { color: var(--muted); font-weight: 700; font-size: .92rem; }
.review-stat > strong { font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.1; }
.review-stat small { color: var(--muted); line-height: 1.45; }
.review-progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--panel-alt); margin-top: .35rem; }
.review-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary-strong); transition: width .25s ease; }
.review-filter-form { align-items: end; }
.review-filter-form .form-field { flex: 1; min-width: 220px; }
.review-question { max-width: 920px; }
.review-option { color: var(--text); line-height: 1.5; transition: border-color .15s ease, background .15s ease; }
.review-option:focus-within { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.review-option input { accent-color: var(--primary-strong); flex: 0 0 auto; }
.review-feedback { margin: 1.1rem 0; line-height: 1.6; }
.review-feedback p { margin: .65rem 0 0; }
.review-answer-key { padding-top: .65rem; border-top: 1px solid var(--border); }
.review-difficulty { margin-top: 1.25rem; }
.review-difficulty-card { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; background: var(--bg-soft); }
.review-difficulty-card h3 { margin: 0 0 .65rem; }
.review-difficulty-card > strong { display: block; font-size: 1.65rem; }
.review-difficulty-card p { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.review-content-section { margin-top: 1.5rem; }
.review-flashcard { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; }
.review-flashcard h3, .review-flashcard p { margin: 0; }
.review-flashcard-hint { color: var(--muted); line-height: 1.55; }
.review-flashcard-answer { width: 100%; padding: .9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); color: var(--text); line-height: 1.65; overflow-wrap: anywhere; }
.review-flashcard-answer[hidden] { display: none; }
.review-flashcard button { margin-top: auto; }
.chat-form button[disabled] { opacity: .75; cursor: progress; }
.chat-form-status { min-height: 1.25rem; }
@media (max-width: 680px) {
  .review-filter-form { align-items: stretch; }
  .review-filter-form .form-field, .review-filter-form button { width: 100%; }
  .review-stat { min-width: 0; }
}

/* Etapa 7: anexos do chat e dashboard analítico */
.chat-attachment-controls { grid-column: 1 / -1; display: grid; gap: .35rem; padding: .8rem; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg-soft); }
.chat-attachment-controls label { font-weight: 700; font-size: .9rem; }
.chat-attachment-controls input { max-width: 100%; }
.chat-attachment-controls small { color: var(--muted); font-size: .78rem; }
.chat-attachment-preview { display: grid; gap: .5rem; margin-top: .35rem; }
.chat-file-name { font-size: .82rem; color: var(--muted); word-break: break-word; }
.chat-attachment-image { display: block; width: min(100%, 360px); max-height: 320px; object-fit: contain; border-radius: 10px; margin: .5rem 0; background: var(--bg-soft); }
.chat-attachment-image.chat-attachment-preview { margin: 0; }
.chat-attachment-audio { display: block; width: min(100%, 360px); margin: .55rem 0; }
.chat-attachment-audio.chat-attachment-preview { margin: 0; }
.chat-attachment-link { display: inline-block; }
.analytics-extra { margin-top: 1.25rem; }
.analytics-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .85rem; }
.analytics-summary-item { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; background: var(--panel); }
.analytics-summary-item strong { display: block; font-size: 1.55rem; margin: .3rem 0; }
.analytics-summary-item span { color: var(--muted); font-size: .86rem; }
.difficulty-row { display: grid; grid-template-columns: 110px minmax(0,1fr) 45px; gap: .75rem; align-items: center; margin: .85rem 0; }
.difficulty-track { height: 10px; overflow: hidden; background: var(--bg-soft); border-radius: 99px; }
.difficulty-track i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
@media(max-width:720px){.analytics-summary{grid-template-columns:1fr}.difficulty-row{grid-template-columns:90px minmax(0,1fr) 40px}.chat-attachment-image{max-width:100%}}


/* Acabamento da etapa 9: acessibilidade, foco e painel de diagnóstico. */
.badge-success { background: #d8f5e6; color: #145b3b; border: 1px solid #8bc9a8; }
.badge-warning { background: #fff0cf; color: #684500; border: 1px solid #e3c16d; }
.badge-danger { background: #fde7e7; color: #8a1f1f; border: 1px solid #d38c8c; }
.badge-info { background: #e7f2ff; color: #1d4f91; border: 1px solid #a1c6f0; }
.list-table-wrap { width: 100%; overflow-x: auto; }
.list-table { width: 100%; border-collapse: collapse; }
.list-table th, .list-table td { padding: .85rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.list-table th { color: var(--muted); font-size: .82rem; }
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible { outline: 3px solid #007a52; outline-offset: 3px; }
body.dark-mode .badge-success { background: #17432f; color: #d8ffeb; border-color: #478766; }
body.dark-mode .badge-warning { background: #4a3918; color: #fff0c4; border-color: #94763c; }
body.dark-mode .badge-danger { background: #4b1d1d; color: #ffd7d7; border-color: #a35f5f; }
body.dark-mode .badge-info { background: #1c2f4a; color: #dfeeff; border-color: #7592c1; }
body.dark-mode :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible { outline-color: #8df7c4; }
@media (max-width: 720px) { .list-table th, .list-table td { padding: .7rem .55rem; } }

.progress-hero { margin-bottom: 1.25rem; }
.progress-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.progress-card { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.progress-card .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.progress-card strong { font-size: clamp(1.8rem, 2.4vw, 2.4rem); line-height: 1; }
.progress-card small { color: var(--muted); }
.student-metrics { margin-top: 1.25rem; }
.metric-card { display: flex; flex-direction: column; gap: .35rem; }
.metric-card .value { font-size: 2rem; font-weight: 700; }
.metric-card .label { color: var(--muted); }
.metric-card .trend { font-size: .8rem; color: var(--primary-strong); }
.student-dashboard-grid { margin-top: 1.25rem; }
.deadline-list, .agenda-event-list, .recommendation-list, .achievement-list, .topic-list { display: grid; gap: .8rem; }
.deadline-item, .recommendation-item, .achievement-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.deadline-item strong, .recommendation-item strong, .achievement-item strong { display: block; }
.deadline-item small, .achievement-item small { display: block; color: var(--muted); }
.deadline-item time { color: var(--muted); font-size: .85rem; }
.recommendation-item p { margin: .35rem 0 0; color: var(--muted); line-height: 1.5; }
.recommendation-item a { white-space: nowrap; }
.achievement-item { align-items: flex-start; }
.achievement-item span:last-child { color: var(--muted); font-size: .8rem; }
.topic-row {
  display: grid; gap: .6rem; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(240,250,245,0.85));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.topic-row:hover { border-color: rgba(16,240,144,0.32); }
.topic-head, .topic-meta, .topic-footer { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.topic-meta, .topic-footer { color: var(--muted); font-size: .82rem; }
.topic-head, .topic-meta, .topic-footer { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.topic-meta, .topic-footer { color: var(--muted); font-size: .82rem; }
.progress-track { width: 100%; height: 10px; overflow: hidden; border-radius: 999px; background: rgba(82,155,125,0.12); }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
.progress-low { background: linear-gradient(90deg, #f59373, #d95a5a); }
.progress-mid { background: linear-gradient(90deg, #f2bb4b, #e68a00); }
.progress-good { background: linear-gradient(90deg, #88d4b0, #3abf8d); }
.progress-high { background: linear-gradient(90deg, #64d7a2, #2ca57a); }
.progress-neutral { background: linear-gradient(90deg, var(--panel-alt), var(--border)); }
.badge.progress-low,
.badge.progress-mid,
.badge.progress-good,
.badge.progress-high,
.badge.progress-neutral { color: #04110b; }
.badge.progress-low { background: #ffd7cf; }
.badge.progress-mid { background: #ffe7b8; }
.badge.progress-good { background: #d8f5e6; }
.badge.progress-high { background: #c9f8da; }
.badge.progress-neutral { background: var(--panel-alt); }
.history-chart { display: grid; gap: .8rem; }
.history-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 48px; align-items: center; gap: .75rem; }
.history-bar-track { position: relative; overflow: hidden; height: 10px; border-radius: 999px; background: rgba(82,155,125,0.12); }
.history-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
.history-chart.is-hidden { display: none; }
.history-chart:not(.is-hidden), .mobile-tab-panel:not(.is-mobile-hidden) { animation: tab-panel-enter 180ms ease both; }
.history-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 48px; align-items: center; gap: .75rem; }
.history-bar-track { position: relative; overflow: hidden; height: 10px; border-radius: 999px; background: var(--panel-alt); }
.history-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
.period-filters { display: inline-flex; gap: .5rem; padding: .3rem; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); }
.period-filter { appearance: none; border: 0; background: transparent; border-radius: 999px; padding: .45rem .8rem; color: var(--muted); font-weight: 700; cursor: pointer; }
.period-filter.is-active { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #04110b; }
.eyebrow { display: inline-flex; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-strong); }
@media (max-width: 900px) {
  .progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .progress-grid { grid-template-columns: 1fr; }
  .history-bar-row { grid-template-columns: 70px minmax(0, 1fr) 40px; }
  .performance-section-heading { flex-direction: column; align-items: stretch; }
  .recommendation-item { flex-wrap: wrap; }
  .period-filters { width: 100%; justify-content: space-between; }
  .period-filter { flex: 1; }
}
