/* ==========================================================================
   BLACKBOARD FTC — DESIGN SYSTEM MINIMALISTA & SÓBRIO
   Suporte a Modo Escuro (Dark) e Modo Claro (Light)
   Sem neon, sem cores berrantes, tipografia refinada e ícones vetoriais.
   ========================================================================== */

:root, [data-theme="dark"] {
  --bg-app: #090a0f;
  --bg-surface: #121318;
  --bg-surface-elevated: #181920;
  --bg-surface-subtle: #1c1d26;
  --nav-backdrop: rgba(9, 10, 15, 0.88);
  --botnav-backdrop: rgba(9, 10, 15, 0.94);

  --border-subtle: #22242d;
  --border-medium: #2b2d38;
  --border-focus: #4b4e60;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Muted Status Colors (Matte, no glow) */
  --status-pending-bg: #1c1d24;
  --status-pending-text: #d4d4d8;
  --status-pending-border: #2a2b36;

  --status-success-bg: rgba(16, 185, 129, 0.08);
  --status-success-text: #34d399;
  --status-success-border: rgba(16, 185, 129, 0.2);

  --status-late-bg: rgba(245, 158, 11, 0.08);
  --status-late-text: #fbbf24;
  --status-late-border: rgba(245, 158, 11, 0.25);

  --status-danger-bg: rgba(239, 68, 68, 0.08);
  --status-danger-text: #f87171;
  --status-danger-border: rgba(239, 68, 68, 0.25);

  --status-exam-bg: rgba(217, 119, 6, 0.1);
  --status-exam-text: #f59e0b;
  --status-exam-border: rgba(217, 119, 6, 0.3);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --transition-fast: 0.15s ease;

  /* Splash & Boot Screen Theme Variables */
  --splash-bg: #090a0f;
  --splash-logo-top: #ffffff;
  --splash-glow: radial-gradient(circle, rgba(242, 24, 111, 0.22) 0%, rgba(255, 255, 255, 0.05) 45%, transparent 70%);
  --splash-shadow: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

/* Modo Claro Minimalista (Clean & Matte) */
[data-theme="light"] {
  --bg-app: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f0f2f5;
  --bg-surface-subtle: #e4e7eb;
  --nav-backdrop: rgba(255, 255, 255, 0.90);
  --botnav-backdrop: rgba(255, 255, 255, 0.95);

  --border-subtle: #e2e5e9;
  --border-medium: #cfd4dc;
  --border-focus: #9aa2b0;

  --text-primary: #0f1115;
  --text-secondary: #4a5160;
  --text-muted: #737c8c;
  --text-dim: #9aa3b2;

  --status-pending-bg: #eef0f3;
  --status-pending-text: #2d333d;
  --status-pending-border: #dbe0e7;

  --status-success-bg: rgba(16, 185, 129, 0.09);
  --status-success-text: #059669;
  --status-success-border: rgba(16, 185, 129, 0.28);

  --status-late-bg: rgba(245, 158, 11, 0.1);
  --status-late-text: #d97706;
  --status-late-border: rgba(245, 158, 11, 0.3);

  --status-danger-bg: rgba(239, 68, 68, 0.09);
  --status-danger-text: #dc2626;
  --status-danger-border: rgba(239, 68, 68, 0.3);

  --status-exam-bg: rgba(217, 119, 6, 0.09);
  --status-exam-text: #b45309;
  --status-exam-border: rgba(217, 119, 6, 0.3);

  /* Splash & Boot Screen Theme Variables (Light Mode) */
  --splash-bg: #f6f7f9;
  --splash-logo-top: #0f1115;
  --splash-glow: radial-gradient(circle, rgba(242, 24, 111, 0.18) 0%, rgba(15, 17, 21, 0.04) 45%, transparent 70%);
  --splash-shadow: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.08));
}

/* Reset & Base Setup */
html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
  overflow-x: hidden;
  max-width: 100vw;
}

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

/* Custom Minimalist Scrollbars (Trackless, refined thumb) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-focus);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

#app-content {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  body {
    padding-bottom: 40px;
  }
}

/* ==========================================================================
   TOP NAVIGATION
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--nav-backdrop);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
  padding-bottom: 0;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-symbol {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: #11131b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast);
}

.brand-symbol:hover {
  transform: scale(1.04);
}

.brand-logo-svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ==========================================================================
   SPLASH / BOOT SCREEN (LOGO NO FUNDO VAZIO COM FADE)
   ========================================================================== */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: var(--splash-bg, var(--bg-app, #090a0f));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.45s ease,
              background-color 0.3s ease;
  will-change: opacity;
}

.app-splash.fade-logo .splash-center {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashLogoEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.splash-logo-glow {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--splash-glow, radial-gradient(circle, rgba(242, 24, 111, 0.22) 0%, rgba(255, 255, 255, 0.05) 45%, transparent 70%));
  filter: blur(24px);
  pointer-events: none;
  animation: splashGlowPulse 2.2s ease-in-out infinite alternate;
}

.splash-logo {
  position: relative;
  z-index: 2;
  filter: var(--splash-shadow, drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5)));
}

.splash-logo-wing {
  fill: var(--splash-logo-top, #ffffff);
  transition: fill var(--transition-fast);
}

@keyframes splashLogoEntrance {
  0% {
    opacity: 0;
    transform: scale(0.84) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes splashGlowPulse {
  0% {
    opacity: 0.4;
    transform: scale(0.88);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.15);
  }
}

/* ==========================================================================
   DASHBOARD ENTRANCE & ORCHESTRATED CASCADE ANIMATIONS
   Sensação Apple/Linear de montagem fluida e elegante dos componentes
   ========================================================================== */

.app-content-fade {
  opacity: 0;
  transform: translateY(16px) scale(0.995);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.app-content-fade.is-ready {
  opacity: 1;
  transform: none !important;
  will-change: auto;
}

/* Cascading Stagger Keyframes */
@keyframes dashboardCascadeIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.988);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes topNavSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mobileBottomNavSlideUp {
  0% {
    opacity: 0;
    transform: translateY(100%);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* Entrada Fluida da Barra Superior */
.app-content-fade.is-ready .top-nav {
  animation: topNavSlideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Entrada dos Cartões de Métricas KPI em Cascata Suave */
.app-content-fade.is-ready .metrics-grid .metric-card:nth-child(1) {
  animation: dashboardCascadeIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.app-content-fade.is-ready .metrics-grid .metric-card:nth-child(2) {
  animation: dashboardCascadeIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both;
}
.app-content-fade.is-ready .metrics-grid .metric-card:nth-child(3) {
  animation: dashboardCascadeIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.app-content-fade.is-ready .metrics-grid .metric-card:nth-child(4) {
  animation: dashboardCascadeIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.20s both;
}

/* Entrada do Destaque (Spotlight: Próximo Vencimento & Aulas de Hoje) */
.app-content-fade.is-ready .overview-spotlight-grid {
  animation: dashboardCascadeIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}

/* Entrada das Colunas Principais (Pendentes e Provas Recentes) */
.app-content-fade.is-ready .overview-row {
  animation: dashboardCascadeIn 0.58s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

/* Entrada da Navegação Inferior Mobile */
.app-content-fade.is-ready ~ .mobile-bottom-nav,
.app-content-fade.is-ready .mobile-bottom-nav {
  animation: mobileBottomNavSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Desktop Tabs with Sliding Pill */
.desktop-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: 999px;
  height: 46px;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.nav-sliding-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 999px;
  background-color: #f4f4f5; /* Cor sólida de preenchimento (Dark Mode) */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), width 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

[data-theme="light"] .nav-sliding-pill {
  background-color: #0f1115; /* Cor sólida de preenchimento (Light Mode) */
  box-shadow: 0 2px 8px rgba(15, 17, 21, 0.25);
}

.nav-tab {
  position: relative;
  z-index: 2;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s ease;
  user-select: none;
}

.nav-tab span.tab-label {
  white-space: nowrap !important;
  display: inline-block;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: #090a0f !important;
  font-weight: 700;
}

[data-theme="light"] .nav-tab.active {
  color: #ffffff !important;
}

.tab-icon {
  color: inherit;
  opacity: 0.8;
  flex-shrink: 0;
}

.nav-tab.active .tab-icon {
  opacity: 1;
  color: #090a0f !important;
}

[data-theme="light"] .nav-tab.active .tab-icon {
  color: #ffffff !important;
}

.nav-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  background-color: var(--border-medium);
  color: var(--text-primary);
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-tab.active .nav-pill {
  background-color: #121318 !important;
  color: #ffffff !important;
}

[data-theme="light"] .nav-tab.active .nav-pill {
  background-color: #ffffff !important;
  color: #0f1115 !important;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-action {
  background-color: var(--bg-surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 500;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn-action:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background-color: var(--bg-surface-subtle);
  transform: translateY(-1px);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn-action:disabled,
.btn-action.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

.btn-action.icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}

.btn-action.icon-only span {
  display: none !important;
}

#btn-user-profile span {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.btn-action.primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff !important;
  border: 1px solid rgba(59, 130, 246, 0.5);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.btn-action.primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
  opacity: 1;
}

.btn-action.primary svg {
  color: #ffffff !important;
}

.btn-action.paused-active {
  background-color: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

/* ==========================================================================
   TOP NAVIGATION RESPONSIVENESS (TIERS ADAPTATIVOS)
   ========================================================================== */

/* Laptops & Telas Médias (<= 1280px) */
@media (max-width: 1280px) {
  .top-nav {
    padding: 0 1rem;
  }
  .nav-container {
    gap: 0.75rem;
  }
  .brand-tag {
    display: none;
  }
  .header-actions .btn-action:not(.icon-only) span {
    display: none;
  }
  .header-actions .btn-action {
    padding: 0;
    width: 36px;
    height: 36px;
    justify-content: center;
  }
  .desktop-tabs {
    gap: 2px;
    padding: 3px;
    height: 42px;
  }
  .nav-tab {
    padding: 6px 11px;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
}

/* Tablets, Telas Estreitas & Laptops Compactos (<= 1180px) */
@media (max-width: 1180px) {
  .desktop-tabs {
    gap: 4px;
    padding: 3px 6px;
    height: 42px;
  }
  .desktop-tabs .tab-label {
    display: none !important;
  }
  .nav-tab {
    padding: 7px 12px;
    gap: 0.35rem;
  }
  .nav-tab .tab-icon {
    width: 17px;
    height: 17px;
  }
}

/* Dispositivos Móveis (<= 768px) */
@media (max-width: 768px) {
  body {
    padding-bottom: 66px;
  }
  .desktop-tabs {
    display: none !important;
  }
  .top-nav {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    padding-bottom: 0;
    overflow: visible;
  }
  .nav-container {
    height: 52px;
    gap: 0.4rem;
    max-width: 100%;
    justify-content: space-between;
  }
  .brand-group {
    gap: 0.5rem;
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-symbol {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
  }
  .brand-symbol svg {
    width: 18px;
    height: 18px;
  }
  .brand-info {
    min-width: 0;
    overflow: hidden;
  }
  .brand-name {
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-tag {
    display: none !important;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
  }
  .header-actions .btn-action,
  .top-nav .btn-action {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    justify-content: center !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
  }
  .header-actions .btn-action span,
  .top-nav .btn-action span {
    display: none !important;
  }
  .header-actions .btn-action svg,
  .top-nav .btn-action svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
  }
}

/* Telas Ultra-Compactas (<= 380px) */
@media (max-width: 380px) {
  .top-nav {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(0.45rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.45rem, env(safe-area-inset-right, 0px));
    padding-bottom: 0;
  }
  .nav-container {
    height: 48px;
    gap: 0.25rem;
  }
  .brand-group {
    gap: 0.35rem;
  }
  .brand-symbol {
    width: 28px;
    height: 28px;
  }
  .brand-symbol svg {
    width: 16px;
    height: 16px;
  }
  .brand-name {
    font-size: 0.86rem;
  }
  .header-actions {
    gap: 0.25rem;
  }
  .header-actions .btn-action,
  .top-nav .btn-action {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    border-radius: 7px !important;
  }
  .header-actions .btn-action svg,
  .top-nav .btn-action svg {
    width: 14px !important;
    height: 14px !important;
  }
}

/* ==========================================================================
   STATUS BANNER
   ========================================================================== */
.status-banner {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.6rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.status-banner.hidden {
  display: none;
}

.status-banner.paused-mode {
  background-color: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   MAIN CONTAINER & SECTIONS
   ========================================================================== */
.main-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
  min-width: 0;
}

@media (max-width: 768px) {
  .main-container {
    padding: 0.75rem 0.65rem;
    overflow-x: hidden;
  }
}

.view-section {
  display: none;
  width: 100%;
  min-width: 0;
}

.view-section.active {
  display: block;
  animation: viewSectionEntrance 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes viewSectionEntrance {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stagger Suave dos Elementos Internos de cada Aba */
.view-section.active .schedule-day-card,
.view-section.active .exam-card,
.view-section.active .assignment-card,
.view-section.active .message-item,
.view-section.active .mob-academic-card,
.view-section.active .calendar-card,
.view-section.active .academic-metric-card {
  animation: viewItemsCascadeIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes viewItemsCascadeIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Micro-delay em cascata para os primeiros 4 itens de qualquer lista */
.view-section.active .exam-card:nth-child(1),
.view-section.active .assignment-card:nth-child(1),
.view-section.active .message-item:nth-child(1),
.view-section.active .schedule-day-card:nth-child(1),
.view-section.active .mob-academic-card:nth-child(1),
.view-section.active .academic-metric-card:nth-child(1) {
  animation-delay: 0.04s;
}

.view-section.active .exam-card:nth-child(2),
.view-section.active .assignment-card:nth-child(2),
.view-section.active .message-item:nth-child(2),
.view-section.active .schedule-day-card:nth-child(2),
.view-section.active .mob-academic-card:nth-child(2),
.view-section.active .academic-metric-card:nth-child(2) {
  animation-delay: 0.08s;
}

.view-section.active .exam-card:nth-child(3),
.view-section.active .assignment-card:nth-child(3),
.view-section.active .message-item:nth-child(3),
.view-section.active .schedule-day-card:nth-child(3),
.view-section.active .mob-academic-card:nth-child(3),
.view-section.active .academic-metric-card:nth-child(3) {
  animation-delay: 0.12s;
}

.view-section.active .exam-card:nth-child(4),
.view-section.active .assignment-card:nth-child(4),
.view-section.active .message-item:nth-child(4),
.view-section.active .schedule-day-card:nth-child(4),
.view-section.active .mob-academic-card:nth-child(4),
.view-section.active .academic-metric-card:nth-child(4) {
  animation-delay: 0.16s;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-heading h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==========================================================================
   VIEW 1: METRICS GRID & URGENT BANNER
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon {
  color: var(--text-muted);
}

.metric-icon.success {
  color: var(--status-success-text);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.5rem 0 0.25rem 0;
  letter-spacing: -0.03em;
}

.metric-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
  }
  .metric-card {
    padding: 0.65rem 0.8rem !important;
    border-radius: var(--radius-md) !important;
  }
  .metric-label {
    font-size: 0.68rem !important;
  }
  .metric-val {
    font-size: 1.45rem !important;
    margin: 0.15rem 0 0.1rem 0 !important;
  }
  .metric-sub {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
}

/* ==========================================================================
   OVERVIEW SPOTLIGHT GRID (Próximo Vencimento & Aulas de Hoje Lado a Lado)
   ========================================================================== */
.overview-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

@media (max-width: 860px) {
  .overview-spotlight-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
  }
}

@media (max-width: 768px) {
  .urgent-banner {
    padding: 0.85rem 1rem !important;
    border-radius: var(--radius-md) !important;
  }
  .urgent-tag {
    font-size: 0.68rem !important;
    margin-bottom: 0.2rem !important;
  }
  .urgent-title {
    font-size: 0.95rem !important;
    margin-bottom: 0.15rem !important;
    line-height: 1.3 !important;
  }
  .urgent-course {
    font-size: 0.75rem !important;
    margin: 0.1rem 0 0.4rem 0 !important;
  }
  .urgent-meta {
    gap: 0.45rem !important;
  }
  .urgent-due-text {
    font-size: 0.72rem !important;
  }
  .urgent-ticker-pill {
    font-size: 0.74rem !important;
    padding: 2px 7px !important;
  }

  .today-classes-banner {
    padding: 0.85rem 1rem !important;
    border-radius: var(--radius-md) !important;
  }
  .today-classes-header {
    margin-bottom: 0.45rem !important;
  }
  .today-badge-title {
    font-size: 0.68rem !important;
  }
  .today-class-item {
    padding: 0.6rem 0.75rem !important;
    border-radius: var(--radius-sm) !important;
  }
  .today-class-item .class-title {
    font-size: 0.82rem !important;
  }
  .today-class-item .class-info-line {
    font-size: 0.7rem !important;
  }
}

.overview-spotlight-grid.single-column {
  grid-template-columns: 1fr;
}

.overview-spotlight-grid .urgent-banner {
  margin-bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.overview-spotlight-grid .urgent-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.overview-spotlight-grid .today-classes-banner {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overview-spotlight-grid .today-classes-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

/* Urgent Banner */
.urgent-banner {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.urgent-banner:hover {
  border-color: #f59e0b;
}

.urgent-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #d97706;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .urgent-tag {
  color: #fbbf24;
}

.urgent-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.urgent-course {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0.75rem 0;
}

.urgent-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.urgent-due-text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.urgent-ticker-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .urgent-ticker-pill {
  color: #fbbf24;
}

/* Overview Dual Grid (Pendentes & Em Atraso / Atividades Recentes) */
.overview-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.overview-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.panel-header h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font-main);
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.link-btn:hover {
  color: var(--text-primary);
}

.panel-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.snippet-card {
  padding: 0.85rem 1rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.snippet-card:hover {
  border-color: var(--border-medium);
  background-color: var(--bg-surface-subtle);
}

.snippet-card > div:first-child {
  min-width: 0;
  flex: 1 1 0%;
  overflow: hidden;
}

.snippet-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.snippet-course {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
  max-width: 100%;
  min-width: 0;
}

/* Media queries para Overview Panels (declaradas após as regras base) */
@media (max-width: 860px) {
  .overview-dual-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }
  .overview-panel {
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-md);
  }
  .panel-header {
    margin-bottom: 0.6rem;
    padding-bottom: 0.45rem;
  }
  .panel-header h3 {
    font-size: 0.85rem;
  }
  .panel-items {
    gap: 0.45rem;
  }
  .snippet-card {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
  }
  .snippet-title {
    font-size: 0.82rem;
  }
  .snippet-course {
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  .overview-dual-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.65rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .overview-panel {
    padding: 0.75rem 0.8rem !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .panel-items {
    gap: 0.45rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .snippet-card {
    padding: 0.6rem 0.7rem !important;
    gap: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .snippet-card > div:first-child {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .snippet-title {
    font-size: 0.82rem !important;
  }
  .snippet-course {
    font-size: 0.68rem !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* ==========================================================================
   VIEW 2: PROVAS & AVALIAÇÕES (DEDICATED)
   ========================================================================== */
.security-banner {
  background-color: var(--bg-surface);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sec-icon-wrap {
  color: var(--status-exam-text);
  flex-shrink: 0;
  margin-top: 2px;
}

.sec-text strong {
  display: block;
  font-size: 0.88rem;
  color: var(--status-exam-text);
  margin-bottom: 0.25rem;
}

.sec-text span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.exam-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.exam-card:hover {
  border-color: var(--border-medium);
}

.exam-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--status-exam-bg);
  color: var(--status-exam-text);
  border: 1px solid var(--status-exam-border);
}

.exam-timer-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background-color: var(--bg-surface-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.exam-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.exam-card-course {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.exam-info-box {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.exam-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 0.2rem 0;
}

.exam-info-row .label {
  color: var(--text-muted);
}

.exam-info-row .val {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.exam-countdown-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.exam-countdown-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.exam-countdown-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--status-exam-text);
}

/* ==========================================================================
   VIEW 3: ATIVIDADES & TRABALHOS (DEDICATED)
   ========================================================================== */
.filter-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: 999px;
  white-space: nowrap !important;
  flex-shrink: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-group::-webkit-scrollbar {
  display: none;
}

.filter-sliding-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 999px;
  background-color: #f4f4f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), width 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

[data-theme="light"] .filter-sliding-pill {
  background-color: #0f1115;
  box-shadow: 0 2px 8px rgba(15, 17, 21, 0.25);
}

.filter-btn {
  position: relative;
  z-index: 2;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s ease;
  user-select: none;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  color: #090a0f !important;
  font-weight: 700;
}

[data-theme="light"] .filter-btn.active {
  color: #ffffff !important;
}

.filter-count,
.filter-counter {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  background-color: var(--border-medium);
  color: var(--text-primary);
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.filter-btn.active .filter-count,
.filter-btn.active .filter-counter {
  background-color: #121318 !important;
  color: #ffffff !important;
}

[data-theme="light"] .filter-btn.active .filter-count,
[data-theme="light"] .filter-btn.active .filter-counter {
  background-color: #ffffff !important;
  color: #0f1115 !important;
}

.assignments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.assignment-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.assignment-card:hover {
  border-color: var(--border-medium);
  background-color: var(--bg-surface-elevated);
}

/* Opacidade reduzida em cards entregues ou não efetuados / perdidos */
.assignment-card.card-dimmed,
.exam-card.card-dimmed {
  opacity: 0.62;
}

.assignment-card.card-dimmed:hover,
.exam-card.card-dimmed:hover {
  opacity: 1;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.status-badge.pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}

.status-badge.delivered {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.status-badge.delivered-late {
  background-color: var(--status-late-bg);
  color: var(--status-late-text);
  border: 1px solid var(--status-late-border);
}

.status-badge.overdue {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

/* Compact SVG Characteristic Status Badge (Replaces giant text badges) */
.status-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: default;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.status-icon-badge svg {
  display: block;
}

.status-icon-badge.pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}

.status-icon-badge.delivered {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.status-icon-badge.delivered-late {
  background-color: var(--status-late-bg);
  color: var(--status-late-text);
  border: 1px solid var(--status-late-border);
}

.status-icon-badge.overdue {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

.status-icon-badge.not-delivered,
.status-icon-badge.missed {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.status-badge.not-delivered,
.status-badge.missed {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.exam-badge.missed {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.status-icon-badge.is-exam {
  background-color: var(--status-exam-bg);
  color: var(--status-exam-text);
  border: 1px solid var(--status-exam-border);
}

.status-icon-badge:hover {
  transform: scale(1.08);
}

.late-policy-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.late-policy-tag.blocked {
  color: var(--status-danger-text);
}

.points-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.points-pill.formative {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.points-pill.graded {
  background-color: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.exam-points-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  white-space: nowrap;
}

.snippet-pts {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #a5b4fc;
  background-color: rgba(99, 102, 241, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 0.45rem;
  font-weight: 600;
  white-space: nowrap;
}

.assignment-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.assignment-card-course {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.receipt-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--bg-surface-elevated, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 6px);
  padding: 6px 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 0.73rem;
  min-width: 0;
}

.receipt-pill-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 0%;
  overflow: hidden;
}

.receipt-pill .receipt-label {
  color: var(--text-muted, #94a3b8);
  font-size: 0.72rem;
  font-weight: 500;
  flex-shrink: 0;
}

.receipt-pill .receipt-code {
  color: var(--status-success-text, #4ade80);
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
  display: inline-block;
  word-break: normal;
}

.receipt-pill .receipt-date-tag {
  color: var(--text-tertiary, #64748b);
  font-size: 0.7rem;
  flex-shrink: 0;
  white-space: nowrap;
  opacity: 0.85;
}

@media (max-width: 600px) {
  .receipt-pill .receipt-date-tag {
    display: none;
  }
}

.assignment-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}

.due-time {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.details-prompt {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   VIEW 4: CALENDÁRIO ACADÊMICO (INTERACTIVE)
   ========================================================================== */
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .calendar-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.calendar-card {
  min-width: 0;
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  min-height: 540px;
  display: flex;
  flex-direction: column;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cal-month-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cal-arrow-btn {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cal-arrow-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.75rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 64px;
  gap: 6px;
}

.cal-day-cell {
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 6px 4px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.cal-day-cell.other-month {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.cal-day-cell:not(.other-month):hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-medium);
}

.cal-day-cell.active-selected {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-focus);
  box-shadow: inset 0 0 0 1px var(--border-focus);
}

[data-theme="light"] .cal-day-cell.active-selected {
  background-color: #e5e9f0;
  border-color: #cbd2df;
  box-shadow: inset 0 0 0 1px #cbd2df;
}

.cal-day-number {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-cell:not(.other-month):not(.is-today):hover .cal-day-number {
  color: var(--text-primary);
}

.cal-day-cell.is-today .cal-day-number,
.cal-day-cell.is-today:hover .cal-day-number {
  background-color: var(--text-primary);
  color: var(--bg-app) !important;
  font-weight: 700;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-cell.is-today:hover .cal-day-number {
  transform: scale(1.06);
  transition: transform 0.15s ease;
}

.cal-dots-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 6px;
}

.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cal-dot.exam {
  background-color: var(--status-exam-text);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4);
}

.cal-dot.assignment {
  background-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.cal-dot.delivered {
  background-color: var(--status-success-text);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4);
}

.cal-dot.overdue {
  background-color: var(--status-danger-text);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.4);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Calendar Sidebar */
.calendar-sidebar {
  min-width: 0;
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  min-height: 540px;
}

.sidebar-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.cal-sub-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.25rem;
}

.cal-events-list {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  height: 400px;
  max-height: 400px;
}

.cal-empty-state {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

/* Mobile Optimization for View 4: Calendar */
@media (max-width: 768px) {
  #view-calendar .section-desc {
    display: none !important;
  }
  
  #view-calendar .section-heading {
    margin-bottom: 0.75rem !important;
  }

  .calendar-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.85rem !important;
  }

  .calendar-card {
    padding: 0.85rem 0.75rem !important;
    min-height: 0 !important;
    border-radius: var(--radius-md) !important;
  }

  .cal-nav {
    margin-bottom: 0.5rem !important;
  }

  .cal-month-title {
    font-size: 1rem !important;
  }

  .cal-arrow-btn {
    width: 30px !important;
    height: 30px !important;
  }

  .cal-weekdays {
    font-size: 0.68rem !important;
    padding-bottom: 0.3rem !important;
    margin-bottom: 0.35rem !important;
  }

  .cal-grid {
    grid-auto-rows: 36px !important;
    gap: 3px !important;
  }

  .cal-day-cell {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 2px 0 0 0 !important;
    border-radius: 6px !important;
  }

  .cal-day-number {
    font-size: 0.85rem !important;
  }

  .cal-day-cell.is-today .cal-day-number,
  .cal-day-cell.is-today:hover .cal-day-number {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.8rem !important;
  }

  .cal-dots-container {
    gap: 3px !important;
    margin-top: 2px !important;
  }

  .cal-dot {
    width: 6px !important;
    height: 6px !important;
  }

  .cal-legend {
    gap: 0.35rem 0.65rem !important;
    margin-top: 0.5rem !important;
    padding-top: 0.5rem !important;
    font-size: 0.68rem !important;
    justify-content: space-around !important;
  }

  .cal-legend-item {
    gap: 0.3rem !important;
  }

  .calendar-sidebar {
    padding: 1rem 0.85rem !important;
    border-radius: var(--radius-md) !important;
  }

  .sidebar-header h3 {
    font-size: 1.05rem !important;
  }

  .cal-events-list {
    height: auto !important;
    max-height: 320px !important;
  }
}

/* ==========================================================================
   VIEW 5: MENSAGENS DOS DOCENTES (DEDICATED)
   ========================================================================== */
.messages-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.messages-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#btn-mark-all-read:disabled,
#btn-mark-all-read.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--border-subtle);
  color: var(--text-muted);
  transform: none !important;
  box-shadow: none !important;
}

.filter-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: var(--border-medium);
  color: var(--text-primary);
  margin-left: 2px;
}

.msg-group-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.25rem 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast), opacity var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.message-item:hover {
  border-color: var(--border-medium);
  background-color: var(--bg-surface-elevated);
}

.message-item:not(.has-unread),
.message-item.is-read {
  opacity: 0.78;
}

.message-item:not(.has-unread):hover,
.message-item.is-read:hover {
  opacity: 1;
}

.message-item.has-unread {
  border-left: 3px solid #3b82f6;
  background-color: var(--bg-surface-elevated);
  opacity: 1;
}

.message-left {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.message-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.message-item.has-unread .message-icon-wrap {
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.message-body-wrap {
  flex: 1;
  min-width: 0;
}

.msg-course {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.msg-subject {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.35;
  transition: color var(--transition-fast);
}

.msg-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.msg-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.msg-recipients {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.msg-snippet {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.msg-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.msg-unread-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  background-color: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   MENSAGENS LIDAS: ESTILIZAÇÃO ACINZENTADA UNIFORME
   ========================================================================== */
.message-item:not(.has-unread) .msg-subject,
.message-item.is-read .msg-subject {
  color: var(--text-muted);
  font-weight: 500;
}

.message-item:not(.has-unread) .msg-course,
.message-item.is-read .msg-course {
  color: var(--text-dim);
  font-weight: 500;
}

.message-item:not(.has-unread) .msg-sender,
.message-item.is-read .msg-sender {
  color: var(--text-muted);
  background-color: var(--bg-surface-subtle);
  border-color: var(--border-subtle);
  font-weight: 500;
}

.message-item:not(.has-unread) .msg-recipients,
.message-item.is-read .msg-recipients {
  color: var(--text-dim);
}

.message-item:not(.has-unread) .msg-snippet,
.message-item.is-read .msg-snippet {
  color: var(--text-muted);
}

.message-item:not(.has-unread) .msg-date,
.message-item.is-read .msg-date {
  color: var(--text-dim);
}

.message-item:not(.has-unread) .message-icon-wrap,
.message-item.is-read .message-icon-wrap {
  color: var(--text-dim);
  opacity: 0.7;
}

/* Hover suave em mensagens lidas mantendo tonalidade sóbria e acinzentada */
.message-item:not(.has-unread):hover .msg-subject,
.message-item.is-read:hover .msg-subject {
  color: var(--text-secondary);
}

.message-item:not(.has-unread):hover .msg-sender,
.message-item.is-read:hover .msg-sender {
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .message-item {
    flex-direction: column;
    padding: 0.85rem 0.95rem;
    gap: 0.5rem;
    border-radius: var(--radius-md);
  }
  .message-left {
    width: 100%;
    gap: 0.65rem;
  }
  .message-icon-wrap {
    width: 30px;
    height: 30px;
  }
  .message-icon-wrap svg {
    width: 15px;
    height: 15px;
  }
  .msg-course {
    font-size: 0.68rem;
    margin-bottom: 0.15rem;
  }
  .msg-subject {
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
  }
  .msg-sender {
    font-size: 0.68rem;
    padding: 1px 6px;
  }
  .msg-recipients {
    font-size: 0.68rem;
  }
  .msg-snippet {
    font-size: 0.78rem;
    line-height: 1.35;
  }
  .message-right {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border-subtle);
  }
  .msg-date {
    font-size: 0.7rem;
  }
}

/* Dedicated Message Modal Badges */
.msg-modal-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.msg-unread-badge {
  background-color: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.msg-read-badge {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   DETAILS MODAL / DRAWER & UNIVERSAL SCROLL LOCK
   ========================================================================== */

/* Bloqueio universal de rolagem no background ao abrir qualquer modal */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  overscroll-behavior: contain !important;
  touch-action: none;
}

[data-theme="light"] .modal-backdrop {
  background-color: rgba(15, 17, 21, 0.5);
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  margin: auto;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overscroll-behavior: contain !important;
}

@keyframes modalEnter {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 600px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card {
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin: 0;
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background-color: var(--bg-surface-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.4rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.modal-course-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overscroll-behavior: contain !important;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.meta-cell-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.meta-cell-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Receipt Section */
.receipt-section {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.receipt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.receipt-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--status-success-text);
  min-width: 0;
  flex: 1 1 auto;
}

.receipt-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-download-receipt {
  background-color: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: #3b82f6;
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-download-receipt:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-copy {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.receipt-quick-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-family: var(--font-main);
  font-weight: 500;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: auto;
  transition: all var(--transition-fast);
}

.receipt-quick-dl-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.receipt-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  word-break: break-all;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Exam Safety Box */
.exam-safety-box {
  background-color: var(--status-exam-bg);
  border: 1px solid var(--status-exam-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
}

.safety-box-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--status-exam-text);
  margin-bottom: 0;
}

/* AI Box */
.ai-box {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.ai-box-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.ai-text-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-line;
}

/* Instructions Box */
.instructions-box {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.instructions-box.is-clickable {
  position: relative;
}

.instructions-box.is-clickable:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.instructions-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.instructions-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.instructions-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.inst-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md, 8px);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.inst-icon-btn:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.inst-icon-btn:active {
  transform: translateY(0);
}

.inst-icon-btn.is-success {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.inst-icon-btn.btn-expand-glow {
  color: #6366f1;
}

[data-theme="dark"] .inst-icon-btn.btn-expand-glow {
  color: #a5b4fc;
}

.inst-icon-btn.btn-expand-glow:hover {
  background-color: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .inst-icon-btn.btn-expand-glow:hover {
  background-color: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
}

.instructions-content {
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.65;
  white-space: pre-line;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.instructions-content:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background-color: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .instructions-content:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.instructions-click-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.85;
  cursor: pointer;
  transition: color 0.2s ease;
}

.instructions-click-hint:hover {
  color: #6366f1;
}

[data-theme="dark"] .instructions-click-hint:hover {
  color: #818cf8;
}

/* ==========================================================================
   MODAL DE LEITURA EXPANDIDA (READING MODE)
   ========================================================================== */
.reader-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background-color: rgba(5, 7, 13, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain !important;
  touch-action: none;
}

[data-theme="light"] .reader-backdrop {
  background-color: rgba(15, 23, 42, 0.45);
}

.reader-backdrop.is-active {
  display: flex !important;
}

body.reader-open {
  overflow: hidden !important;
}

.reader-card {
  width: 100%;
  max-width: 880px;
  height: 88vh;
  max-height: 850px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain !important;
}

[data-theme="light"] .reader-card {
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border-subtle);
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-elevated);
  gap: 1rem;
}

.reader-header-info {
  min-width: 0;
  flex: 1 1 0%;
}

.reader-header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.reader-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.reader-badge.course {
  background-color: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .reader-badge.course {
  color: #818cf8;
}

.reader-badge.due {
  background-color: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .reader-badge.due {
  color: #f59e0b;
}

.reader-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.reader-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.reader-icon-btn:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.reader-icon-btn:active {
  transform: translateY(0);
}

.reader-icon-btn.is-success {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.reader-icon-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.reader-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reader-close-btn:hover {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.reader-body {
  flex: 1 1 0%;
  overflow-y: auto;
  padding: 2.25rem 2.75rem;
  background-color: var(--bg-surface);
  overscroll-behavior: contain !important;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.reader-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-line;
  max-width: 780px;
  margin: 0 auto;
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  letter-spacing: 0.012em;
}

@media (max-width: 768px) {
  .reader-backdrop {
    padding: 0.75rem;
  }
  .reader-card {
    height: 94vh;
    border-radius: var(--radius-lg, 12px);
  }
  .reader-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .reader-header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .reader-body {
    padding: 1.25rem 1rem;
  }
  .reader-text {
    font-size: 0.92rem;
    line-height: 1.65;
  }
}

/* Attachments Box */
.attachments-box {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.attachments-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  gap: 0.5rem;
}

.attachment-item a {
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.attachment-item a:hover {
  text-decoration: underline;
}

.attachment-btn-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.btn-bb-external {
  background-color: var(--text-primary);
  color: var(--bg-app);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity var(--transition-fast);
}

.btn-bb-external:hover {
  opacity: 0.9;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  height: calc(54px + env(safe-area-inset-bottom, 0px));
  background-color: var(--botnav-backdrop);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  overscroll-behavior-y: none;
  touch-action: pan-x;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: center;
    justify-content: items-stretch;
  }
}

/* Oculta estritamente a barra de navegação móvel quando a tela de login ou primeiro sync estiver aberta */
body.auth-modal-open .mobile-bottom-nav,
body:has(#auth-gateway:not([style*="display: none"]):not([style*="display:none"])) .mobile-bottom-nav,
body:has(#first-sync-loading:not([style*="display: none"]):not([style*="display:none"])) .mobile-bottom-nav {
  display: none !important;
}

.mob-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.6rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 1px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  transition: color var(--transition-fast);
}

.mob-tab span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  text-align: center;
  line-height: 1;
}

.mob-tab svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.mob-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 400px) {
  .mob-tab {
    font-size: 0.54rem;
    padding: 3px 0;
  }
  .mob-tab svg {
    width: 15px;
    height: 15px;
  }
}

.mob-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mob-dot {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #3b82f6;
}

/* ==========================================================================
   SCHEDULE / GRADE DE AULAS (PORTAL DO ALUNO)
   ========================================================================== */

.today-classes-banner {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin: 1.25rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.today-classes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.today-badge-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
}

.today-classes-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.today-class-item {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.today-class-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-medium);
}

.schedule-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.schedule-day-col {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.schedule-day-col.is-today {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.schedule-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background-color: var(--bg-hover);
  border-bottom: 1px solid var(--border-subtle);
}

.schedule-day-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.today-tag-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.schedule-day-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.schedule-day-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.class-card {
  background-color: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.class-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-highlight);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.class-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.class-time-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.class-modalidade-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.class-modalidade-badge.presencial {
  background-color: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.class-modalidade-badge.remota {
  background-color: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.class-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.class-info-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 0.2rem;
}

.class-info-line svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.class-empty-day {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   VIEW 6: NOTAS & FREQUÊNCIA (PORTAL LYCEUM)
   ========================================================================== */
.academic-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.academic-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.portal-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background-color: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.portal-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.academic-metrics {
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   ACADEMIC MODERN TABLE (Rows & Columns)
   ========================================================================== */
.academic-table-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.academic-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.academic-table thead {
  background-color: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.academic-table th {
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.academic-table th.th-course {
  min-width: 210px;
  position: sticky;
  left: 0;
  z-index: 3;
  background-color: var(--bg-surface-elevated);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08);
}

.academic-table th.th-center {
  text-align: center;
  min-width: 60px;
}

.academic-table th.th-pres {
  min-width: 105px;
}

.academic-table th.th-grade-col {
  text-align: center;
  min-width: 56px;
  padding: 0.65rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .academic-table th.th-grade-col {
  border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.academic-table th.th-status {
  text-align: center;
  min-width: 85px;
}

.academic-table th.th-action {
  width: 38px;
  text-align: center;
}

.academic-table tbody tr.academic-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

.academic-table tbody tr.academic-row:hover {
  background-color: var(--bg-surface-elevated);
}

.academic-table td {
  padding: 0.65rem 0.6rem;
  vertical-align: middle;
}

.academic-table td.td-course-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: var(--bg-surface);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08);
}

.academic-table tbody tr.academic-row:hover td.td-course-col {
  background-color: var(--bg-surface-elevated);
}

.td-center {
  text-align: center;
  white-space: nowrap;
}

/* Cell Elements */
.table-course-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 220px;
}

.table-course-code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.table-course-name {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.table-course-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.table-num-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary);
}

.table-sub-cell {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Presence Cell */
.table-presence-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 110px;
}

.presence-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.presence-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.presence-pill.safe { color: #4ade80; }
.presence-pill.warning { color: #fbbf24; }
.presence-pill.danger { color: #f87171; }

.table-progress-bar {
  width: 100%;
  height: 5px;
  background-color: rgba(255,255,255,0.06);
  border-radius: 9999px;
  overflow: hidden;
}

[data-theme="light"] .table-progress-bar {
  background-color: rgba(0,0,0,0.06);
}

.table-progress-fill {
  height: 100%;
  border-radius: 9999px;
}

.table-progress-fill.safe {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.table-progress-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.table-progress-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Grade Column Cells */
.academic-table td.td-grade {
  text-align: center;
  padding: 0.5rem 0.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .academic-table td.td-grade {
  border-left: 1px solid rgba(0, 0, 0, 0.04);
}

.grade-cell-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 3px 4px;
  border-radius: 5px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  line-height: 1.15;
  transition: all var(--transition-fast);
}

.grade-cell-box .grade-score {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.grade-cell-box .grade-max {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.65;
}

.grade-cell-box.graded {
  background-color: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.grade-cell-box.graded .grade-score {
  color: #4ade80;
  font-weight: 700;
}

.grade-cell-box.graded .grade-max {
  color: #86efac;
  opacity: 0.9;
}

.grade-na {
  color: var(--text-muted);
  opacity: 0.35;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Fallback chips if used */
.table-grades-flex {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.table-grade-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.74rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  cursor: default;
}

.table-status-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background-color: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
  white-space: nowrap;
}

/* Expand Action Button */
.btn-expand-row {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.btn-expand-row:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.btn-expand-row.expanded {
  transform: rotate(180deg);
  color: #38bdf8;
}

/* Sub-row Expandable Drawer */
.academic-detail-row {
  background-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .academic-detail-row {
  background-color: rgba(0, 0, 0, 0.02);
}

.academic-detail-row td {
  padding: 0.5rem 1rem 0.85rem 1rem;
}

.detail-table-wrap {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.detail-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.detail-icon-circle {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background-color: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-title-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.detail-title-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-stats-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.detail-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.detail-pill.active {
  background-color: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

/* Inner Evaluations Sub-Table */
.detail-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.detail-inner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.detail-inner-table thead th {
  background-color: var(--bg-surface-elevated);
  padding: 0.5rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.detail-inner-table thead th.dit-center {
  text-align: center;
}

.detail-inner-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

.detail-inner-table tbody tr:last-child {
  border-bottom: none;
}

.detail-inner-table tbody tr:hover {
  background-color: var(--bg-surface-elevated);
}

.detail-inner-table td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
}

.detail-inner-table th:nth-child(2),
.detail-inner-table td:nth-child(2) {
  min-width: 190px;
  max-width: 320px;
}

.detail-inner-table td.dit-center {
  text-align: center;
  white-space: nowrap;
}

/* Inner Table Cell Elements */
.eval-code-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: #38bdf8;
  display: inline-block;
}

.eval-full-name {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.eval-max-pts {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.eval-score-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.eval-score-val.pending {
  color: var(--text-muted);
}

.eval-score-val.scored {
  color: #4ade80;
}

.eval-date-text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.eval-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.eval-status-badge.pending {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .eval-status-badge.pending {
  background-color: rgba(0, 0, 0, 0.04);
}

.eval-status-badge.graded {
  background-color: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* Gateway de Autenticação Direta do Estudante */
.auth-gateway-screen {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: max(1.5rem, calc(env(safe-area-inset-top, 0px) + 0.75rem));
  padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  overflow-y: auto;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.35s ease,
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.auth-gateway-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.97);
  pointer-events: none;
}

.auth-gateway-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.3s ease-out;
}

/* ==========================================================================
   FIRST-TIME SYNC ONBOARDING SCREEN (BARRA DE PROGRESSO REAL)
   ========================================================================== */
.first-sync-screen {
  position: fixed;
  inset: 0;
  z-index: 99997;
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: max(1.5rem, calc(env(safe-area-inset-top, 0px) + 0.75rem));
  padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  overflow-y: auto;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.first-sync-screen.is-visible {
  opacity: 1;
  transform: scale(1);
}

.first-sync-screen.fade-out {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

.first-sync-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  text-align: center;
  box-sizing: border-box;
  animation: modalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.first-sync-brand {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

.first-sync-brand .splash-logo {
  animation: pulseLogoGlow 2.5s infinite ease-in-out;
}

.first-sync-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.first-sync-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

.first-sync-progress-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.first-sync-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-subtle);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.85rem;
}

.first-sync-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.first-sync-bar-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmerMove 1.8s infinite linear;
}

@keyframes shimmerMove {
  0% { left: -100%; }
  100% { left: 100%; }
}

.first-sync-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.first-sync-step-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.first-sync-pct-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.first-sync-detail-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.first-sync-actions {
  margin-top: 1rem;
}

.gateway-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.gateway-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.gateway-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap .gateway-input {
  padding-right: 2.85rem;
}

.btn-password-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-password-eye:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

.btn-password-eye:focus {
  outline: none;
  color: var(--text-primary);
}

.gateway-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0;
  user-select: none;
}

.gateway-switch-label {
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.gateway-switch-label:hover {
  color: var(--text-primary);
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease;
}

[data-theme="light"] .switch-slider {
  background-color: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.1);
}

.switch-toggle input:checked + .switch-slider {
  background-color: #2563eb;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.switch-toggle input:checked + .switch-slider::before {
  transform: translateX(18px);
}

/* ==========================================================================
   ANIMAÇÃO E ESTADOS DE SINCRONIZAÇÃO
   ========================================================================== */
@keyframes spin-sync {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning,
.icon-sync.spinning,
.icon-refresh.spinning,
.btn-action.is-syncing .icon-sync {
  animation: spin-sync 0.85s linear infinite !important;
  transform-origin: center center;
  display: inline-block;
}

.btn-action.is-syncing {
  opacity: 0.85 !important;
  pointer-events: none !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
  background: rgba(59, 130, 246, 0.12) !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3) !important;
}

/* ==========================================================================
   DUAL VIEW: DESKTOP TABLE vs MOBILE CARDS
   ========================================================================== */
@media (min-width: 769px) {
  .desktop-only-view {
    display: block !important;
  }
  .mobile-only-view {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .desktop-only-view {
    display: none !important;
  }
  .mobile-only-view {
    display: flex !important;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 2rem;
  }
}

/* Mobile Academic Cards (Compact, Highlight Faltas & AV1/AV2/OAT1/OAT2) */
.mob-academic-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.mob-academic-card:hover {
  border-color: var(--border-medium, rgba(255, 255, 255, 0.16));
}

.mob-card-header {
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mob-card-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.mob-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.mob-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mob-card-sub-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mob-course-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--bg-surface-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-subtle);
  color: #38bdf8;
}

.mob-turma-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Destaque 1: Faltas Acumuladas vs Limite Permitido */
.mob-faltas-highlight-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  background-color: var(--bg-surface-elevated, rgba(0, 0, 0, 0.12));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 7px);
  margin-bottom: 0.45rem;
}

[data-theme="light"] .mob-faltas-highlight-row {
  background-color: rgba(0, 0, 0, 0.03);
}

.mob-faltas-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-primary);
}

.mob-faltas-badge svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.mob-faltas-badge.safe {
  color: var(--text-primary);
}

.mob-faltas-badge.safe svg {
  color: var(--text-muted);
}

.mob-faltas-badge.safe .mob-faltas-val {
  color: var(--text-primary);
}

.mob-faltas-badge.warning {
  color: #fbbf24;
}

.mob-faltas-badge.warning svg {
  color: #fbbf24;
}

.mob-faltas-badge.danger {
  color: #f87171;
}

.mob-faltas-badge.danger svg {
  color: #f87171;
}

.mob-faltas-val {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-primary);
}

.mob-faltas-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mob-pres-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  flex-shrink: 0;
}

.mob-pres-badge.safe {
  background-color: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.mob-pres-badge.warning {
  background-color: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.mob-pres-badge.danger {
  background-color: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.mob-pres-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Destaque 2: Grid Quad de Notas Principais (AV1, AV2, OAT1, OAT2) */
.mob-grades-quad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.mob-grade-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
  border-radius: 6px;
  background-color: var(--bg-surface-elevated, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-subtle);
  line-height: 1.15;
  text-align: center;
  transition: all var(--transition-fast);
}

.mob-grade-chip.is-graded {
  background-color: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.28);
}

.mob-grade-chip-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.mob-grade-chip.is-graded .mob-grade-chip-tag {
  color: #38bdf8;
}

.mob-grade-chip-score-box {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  margin-top: 1px;
}

.mob-grade-chip-score {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mob-grade-chip.is-graded .mob-grade-chip-score {
  color: #4ade80;
}

.mob-grade-chip-max {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.65;
}

.mob-grade-chip.is-empty {
  opacity: 0.55;
}

/* Accordion Toggle Bar */
.mob-card-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.15rem;
}

.mob-card-toggle-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.5rem;
}

.mob-card-chevron-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm, 6px);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mob-card-chevron-btn:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.mob-card-chevron-btn svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mob-card-chevron-btn.expanded svg {
  transform: rotate(180deg);
}

/* Collapsible Drawer */
.mob-card-detail-drawer {
  border-top: 1px solid var(--border-subtle);
  background-color: rgba(0, 0, 0, 0.18);
  animation: fadeIn 0.2s ease-out;
}

[data-theme="light"] .mob-card-detail-drawer {
  background-color: rgba(0, 0, 0, 0.02);
}

.mob-card-detail-content {
  padding: 0.75rem 0.85rem;
}

.mob-drawer-aulas-row {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.mob-drawer-aulas-row strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.mob-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.mob-detail-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Evaluation Items List */
.mob-eval-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mob-eval-row {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 7px);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s ease;
}

.mob-eval-row.is-graded {
  border-left: 3px solid #4ade80;
}

.mob-eval-row.is-extra-eval {
  border-left: 3px solid #eab308;
}

.mob-eval-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.mob-eval-tag-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.mob-eval-tags-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mob-extra-tag {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: rgba(234, 179, 8, 0.12);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.25);
  text-transform: uppercase;
}

.mob-eval-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.mob-eval-score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.mob-eval-score-num {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: #4ade80;
}

.mob-eval-score-max {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mob-eval-score-pending {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mob-eval-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9999px;
  white-space: nowrap;
}

.mob-eval-badge.graded {
  background-color: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.mob-eval-badge.pending {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.mob-eval-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.mob-eval-date {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
}

.mob-eval-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.85rem 0;
}

/* ==========================================================================
   EXPANSÃO CIRCULAR NA TROCA DE TEMA (VIEW TRANSITIONS API & FALLBACK)
   ========================================================================== */

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

/* Fallback circular para navegadores sem View Transitions API nativo */
.theme-transition-fallback-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  will-change: clip-path;
}

/* Trava de transições CSS durante a animação de revelação circular do tema */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: none !important;
  animation-duration: 0s !important;
}

/* Micro-interação suave no botão de alternância de tema */
#btn-theme-toggle {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#btn-theme-toggle svg {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#btn-theme-toggle:hover svg {
  transform: rotate(20deg) scale(1.1);
}

#btn-theme-toggle:active svg {
  transform: scale(0.9);
}

/* ==========================================================================
   FIRST-SYNC ONBOARDING BANNER (Feedback Visual no Primeiro Acesso)
   ========================================================================== */
.first-sync-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  margin: 12px 0 16px 0;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.first-sync-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border-subtle);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.first-sync-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.first-sync-content strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.first-sync-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* ==========================================================================
   PWA INSTALLATION & UNIFIED PROFILE MODAL
   ========================================================================== */
.btn-pwa-header {
  border-color: rgba(242, 24, 111, 0.35);
  color: var(--text-primary);
  background: rgba(242, 24, 111, 0.08);
  transition: all var(--transition-fast);
}

.btn-pwa-header:hover {
  background: rgba(242, 24, 111, 0.16);
  border-color: rgba(242, 24, 111, 0.6);
  color: #fff;
}

[data-theme="light"] .btn-pwa-header {
  background: rgba(242, 24, 111, 0.06);
  color: #c01053;
  border-color: rgba(242, 24, 111, 0.3);
}

[data-theme="light"] .btn-pwa-header:hover {
  background: rgba(242, 24, 111, 0.12);
  color: #9c0c43;
}

.pwa-install-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.pwa-install-card-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.pwa-app-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #090a0f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.pwa-card-info {
  flex: 1;
  min-width: 0;
}

.pwa-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.pwa-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pwa-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.pwa-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pwa-badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pwa-badge-installed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-install-cta {
  width: 100%;
  justify-content: center;
  height: 38px;
  font-weight: 600;
  font-size: 0.84rem;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-installed {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  cursor: default !important;
}

.profile-section-card {
  padding: 0.95rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.profile-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.profile-section-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.profile-section-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.profile-section-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.setting-switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.setting-switch-item.highlight {
  border-color: rgba(242, 24, 111, 0.25);
  background: linear-gradient(to right, rgba(242, 24, 111, 0.04), var(--bg-surface-elevated));
}

.setting-switch-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.setting-switch-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-switch-sub {
  font-size: 0.69rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.notif-category-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notif-category-header:first-of-type {
  margin-top: 0.25rem;
}

/* iOS Sheet Drawer */
.ios-sheet-card {
  border-radius: var(--radius-lg);
}

.ios-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ios-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.ios-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #F2186F;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-step-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ios-step-content strong {
  font-size: 0.84rem;
  color: var(--text-primary);
}

.ios-step-content span {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .pwa-header-label {
    display: none;
  }
  .btn-pwa-header {
    padding: 0.45rem !important;
  }
}

/* ==========================================================================
   UNIVERSAL TOAST SYSTEM
   ========================================================================== */
.toast-container {
  display: none !important;
}

.toast-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast-item.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-item.toast-hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

.toast-item.toast-success {
  border-color: rgba(16, 185, 129, 0.45);
  color: #10b981;
}

.toast-item.toast-error {
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

.toast-item.toast-info {
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
}


