/* =========================================================================
   SISTEMA NEXO — ESCOLA JEAN PIAGET (EJEP)
   Design System Unificado & Tokens Globais ("Enterprise Warmth / Refined SaaS")
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta Cromática Institucional Oficial da EJEP */
  --ejep-blue: #1A4FA0;          /* Azul Cobalto Real — Cor Primária */
  --ejep-blue-hover: #133E80;    /* Estado hover/ativo primário */
  --ejep-blue-soft: #EEF4FF;     /* Fundo sutil de destaque e badges neutros */
  --ejep-red: #C5222F;           /* Vermelho Carmim Acetinado — Alertas e Ações Críticas */
  --ejep-red-soft: #FDE8EA;      /* Fundo sutil de avisos e notificações urgentes */
  --ejep-silver: #E2E8F0;        /* Linhas divisórias, bordas de cards e contornos */
  --bg-page: #F8F9FA;            /* Off-white acolhedor para canvas de fundo */
  --card-bg: #FFFFFF;            /* Superfície limpa dos cards e modais */
  --text-main: #0F172A;          /* Grafite escuro para tipografia principal */
  --text-muted: #64748B;         /* Cinza neutro para legendas e placeholders */

  /* Aliases Semânticos e Compatibilidade Legada */
  --primary: var(--ejep-blue);
  --primary-hover: var(--ejep-blue-hover);
  --primary-soft: var(--ejep-blue-soft);
  --accent: var(--ejep-red);
  --accent-soft: var(--ejep-red-soft);
  --border: var(--ejep-silver);
  --border-focus: var(--ejep-blue);
  --bg-base: var(--bg-page);
  --bg-surface: var(--card-bg);

  --danger: #C5222F;
  --danger-soft: #FDE8EA;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --info: #0284C7;
  --info-soft: #E0F2FE;

  /* Tipografia & Formas */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Sombras Sutis (Refined SaaS — sem excesso) */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-drawer: 0 20px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 10px -6px rgba(15, 23, 42, 0.15);

  /* Dimensões do Layout */
  --sidebar-width: 260px;
  --sidebar-mobile-width: 280px;
  --topbar-height: 64px;
  --mobile-header-height: 58px;
}

/* =========================================================================
   RESET E BASE TIPOGRÁFICA
   ========================================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  min-height: 100%;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
}

body {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Bloqueio de rolagem quando a gaveta mobile estiver aberta */
body.nexo-drawer-open {
  overflow: hidden !important;
}

/* =========================================================================
   HEADER MOBILE & BOTÃO HAMBÚRGUER (Apenas em telas < 992px)
   ========================================================================= */
.nexo-mobile-header {
  display: none; /* Oculto no Desktop */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--mobile-header-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--ejep-silver);
  padding: 0 1rem;
  z-index: 900;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.nexo-mobile-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nexo-hamburger-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--ejep-silver);
  border-radius: var(--radius-md);
  color: var(--ejep-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.nexo-hamburger-btn:hover,
.nexo-hamburger-btn:active {
  background: var(--ejep-blue-soft);
  border-color: var(--ejep-blue);
}

.nexo-mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
}

.nexo-mobile-brand i {
  color: var(--ejep-red);
  font-size: 1.35rem;
}

.nexo-mobile-brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nexo-mobile-brand-title strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ejep-blue);
}

.nexo-mobile-brand-title span {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.nexo-mobile-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nexo-mobile-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--radius-full);
  background: var(--ejep-blue-soft);
  color: var(--ejep-blue);
  border: 1.5px solid var(--ejep-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

/* =========================================================================
   BACKDROP / OVERLAY (Para Off-Canvas Drawer)
   ========================================================================= */
.nexo-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 12, 26, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 995;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nexo-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================================
   SIDEBAR GLOBAL (Desktop Fixa & Mobile Off-Canvas Drawer)
   ========================================================================= */
aside.nexo-sidebar {
  width: var(--sidebar-width);
  background: #FFFFFF;
  color: #0F172A;
  padding: 1.15rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1000;
  border-right: 1px solid #E2E8F0;
  box-shadow: 1px 0 3px rgba(15, 23, 42, 0.02);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cabeçalho da Sidebar (Limpo e Integrado) */
.nexo-brand {
  font-size: 1.1rem;
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.35rem 0.85rem 0.35rem;
  background: transparent;
  border: none;
  border-radius: 0;
  position: relative;
}

.nexo-brand::before {
  display: none !important;
}

.nexo-brand-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nexo-brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nexo-brand-icon-box i,
.nexo-brand-info > i {
  color: #2563EB;
  font-size: 1.15rem;
  filter: none !important;
}

.nexo-brand-title {
  display: flex;
  align-items: center;
  line-height: 1.2;
}

.nexo-brand-info span {
  color: #0F172A;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}

.nexo-brand-badge {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  margin-left: 0.4rem;
  letter-spacing: 0.04em;
  display: inline-block;
  box-shadow: none !important;
}

.nexo-brand-info small {
  font-size: 0.7rem;
  color: #64748B;
  display: block;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* Botão de Fechar Gaveta (Exibido apenas em Mobile) */
.nexo-drawer-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #64748B;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexo-drawer-close-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
  box-shadow: none !important;
}

/* Navegação Principal */
.nexo-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.nexo-nav-scroll,
.nexo-nav > div:first-child {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
}

.nexo-nav-scroll::-webkit-scrollbar,
.nexo-nav > div:first-child::-webkit-scrollbar,
.nexo-nav ul::-webkit-scrollbar {
  width: 4px;
}

.nexo-nav-scroll::-webkit-scrollbar-track,
.nexo-nav > div:first-child::-webkit-scrollbar-track,
.nexo-nav ul::-webkit-scrollbar-track {
  background: transparent;
}

.nexo-nav-scroll::-webkit-scrollbar-thumb,
.nexo-nav > div:first-child::-webkit-scrollbar-thumb,
.nexo-nav ul::-webkit-scrollbar-thumb {
  background: #E2E8F0;
  border-radius: 999px;
}

.nexo-nav-scroll::-webkit-scrollbar-thumb:hover,
.nexo-nav > div:first-child::-webkit-scrollbar-thumb:hover,
.nexo-nav ul::-webkit-scrollbar-thumb:hover {
  background: #CBD5E1;
}

.nexo-nav a {
  text-decoration: none;
}

.nexo-sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: none;
}

/* Botão de Logout (Vermelho Claro) */
.btn-sidebar-logout {
  width: 100%;
  margin-top: auto;
  color: #DC2626 !important;
  background: #FEF2F2 !important;
  border: 1px solid #FEE2E2 !important;
  font-weight: 600 !important;
  font-size: 0.84rem !important;
  padding: 0.62rem 0.8rem !important;
  border-radius: 10px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: all 0.2s ease;
  box-shadow: none !important;
}

.btn-sidebar-logout i {
  width: 18px;
  min-width: 18px;
  text-align: center;
  font-size: 0.92rem;
  color: #DC2626;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-sidebar-logout:hover {
  background: #FEE2E2 !important;
  color: #B91C1C !important;
  border-color: #FECACA !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sidebar-logout:hover i {
  color: #B91C1C;
}

/* =========================================================================
   ÁREA DE CONTEÚDO PRINCIPAL (WRAPPER)
   ========================================================================= */
.nexo-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-page);
}

/* TOPBAR DESKTOP */
.nexo-topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--ejep-silver);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 800;
  box-shadow: var(--shadow-xs);
}

.nexo-topbar-title h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ejep-blue);
  letter-spacing: -0.01em;
}

.nexo-topbar-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.nexo-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.9rem;
  background: var(--ejep-blue-soft);
  border: 1px solid var(--ejep-silver);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ejep-blue);
}

.nexo-role-pill {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-ADMIN { background: #FAE8FF; color: #86198F; border: 1px solid #F0ABFC; }
.role-DIRECAO { background: var(--ejep-blue-soft); color: var(--ejep-blue); border: 1px solid #BFDBFE; }
.role-COORDENACAO { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.role-SECRETARIA { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.role-PROFESSOR { background: #E0E7FF; color: #3730A3; border: 1px solid #C7D2FE; }

/* CONTAINER DA PÁGINA */
main.nexo-page-main {
  flex: 1;
  padding: 1.75rem 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* =========================================================================
   SISTEMA DE BENTO GRID (Modular & Responsivo)
   ========================================================================= */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.bento-col-12 { grid-column: span 12; }
.bento-col-8  { grid-column: span 8; }
.bento-col-6  { grid-column: span 6; }
.bento-col-4  { grid-column: span 4; }
.bento-col-3  { grid-column: span 3; }

.bento-card {
  background: var(--card-bg);
  border: 1px solid var(--ejep-silver);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

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

.bento-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ejep-blue);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bento-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.bento-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* =========================================================================
   CONTÊINERES RESPONSIVOS DE TABELAS (Prevenção de Quebra em Telas Pequenas)
   ========================================================================= */
.table-responsive,
.table-container,
.tabela-container,
[class*="table-wrapper"],
.hub-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ejep-silver);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: 1.25rem;
  position: relative;
}

/* Indicador de rolagem horizontal suave */
.table-responsive::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.table-responsive table,
.table-container table {
  min-width: 620px; /* Garante que as colunas respirem sem quebrar */
  width: 100%;
  border-collapse: collapse;
}

/* =========================================================================
   BOTÕES E COMPONENTES PADRONIZADOS (Touch Target Friendly)
   ========================================================================= */
.btn,
.btn-ejep-primary,
.btn-ejep-secondary,
.btn-ejep-danger {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.25rem;
  line-height: 1.3;
  user-select: none;
  white-space: nowrap;
}

.btn:active,
.btn-ejep-primary:active,
.btn-ejep-secondary:active,
.btn-ejep-danger:active {
  transform: translateY(1px);
}

.btn-primary,
.btn-ejep-primary {
  background: var(--ejep-blue);
  color: #FFFFFF !important;
  border: 1px solid var(--ejep-blue);
  box-shadow: 0 1px 3px rgba(26, 79, 160, 0.2);
}

.btn-primary:hover,
.btn-ejep-primary:hover {
  background: var(--ejep-blue-hover);
  border-color: var(--ejep-blue-hover);
  box-shadow: 0 4px 12px rgba(26, 79, 160, 0.3);
  transform: translateY(-1px);
}

.btn-secondary,
.btn-ejep-secondary {
  background: #FFFFFF;
  color: var(--text-main) !important;
  border: 1.5px solid var(--ejep-silver);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover,
.btn-ejep-secondary:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: var(--ejep-blue) !important;
  transform: translateY(-1px);
}

.btn-success {
  background: #16A34A;
  color: #FFFFFF !important;
  border: 1px solid #16A34A;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.2);
}

.btn-success:hover {
  background: #15803D;
  border-color: #15803D;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
  transform: translateY(-1px);
}

.btn-danger,
.btn-ejep-danger {
  background: var(--ejep-red);
  color: #FFFFFF !important;
  border: 1px solid var(--ejep-red);
  box-shadow: 0 1px 3px rgba(197, 34, 47, 0.2);
}

.btn-danger:hover,
.btn-ejep-danger:hover {
  background: #A81B26;
  border-color: #A81B26;
  box-shadow: 0 4px 12px rgba(197, 34, 47, 0.3);
  transform: translateY(-1px);
}

/* =========================================================================
   MEDIA QUERIES MOBILE-FIRST (Max-Width: 991px — Telas de Celulares e Tablets)
   ========================================================================= */
@media (max-width: 991px) {
  body {
    flex-direction: column;
    padding-top: var(--mobile-header-height);
  }

  /* 1. Header Mobile exibido fixo no topo */
  .nexo-mobile-header {
    display: flex !important;
  }

  /* 2. Topbar Desktop ocultada para não poluir tela do celular */
  .nexo-topbar {
    display: none !important;
  }

  /* 3. Sidebar Oculta por padrão em formato Off-Canvas Drawer */
  aside.nexo-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar-mobile-width) !important;
    max-width: 85vw !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    box-shadow: none;
    z-index: 1000 !important;
  }

  /* Quando ativada pelo hambúrguer, desliza suavemente sobre a tela */
  aside.nexo-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.18), inset -1px 0 0 rgba(226, 232, 240, 0.9) !important;
  }

  /* Botão de fechar gaveta exibido no celular */
  .nexo-drawer-close-btn {
    display: inline-flex !important;
  }

  /* 4. Área de conteúdo se expande 100% da largura do celular */
  .nexo-content-wrapper {
    height: auto !important;
    min-height: calc(100vh - var(--mobile-header-height)) !important;
    width: 100% !important;
    overflow-y: visible !important;
  }

  main.nexo-page-main {
    padding: 1rem 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 5. Adaptação do Bento Grid e Grids Específicos para telas menores */
  .bento-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .bento-col-12, .bento-col-8, .bento-col-6, .bento-col-4, .bento-col-3 {
    grid-column: span 1 !important;
  }

  .grid-stats-exec,
  .dashboard-grid,
  .grid-shortcuts,
  .pdv-grid,
  .prontuario-grid,
  .hub-controls-grid {
    grid-template-columns: 1fr !important;
  }

  .grid-col-12, .grid-col-8, .grid-col-6, .grid-col-4,
  .col-12, .col-8, .col-6, .col-4, .col-3 {
    grid-column: span 12 !important;
  }

  /* 6. Navegação em Abas com Rolagem Horizontal Touch Fluida */
  .tab-nav,
  .nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    gap: 0.5rem !important;
    padding-bottom: 6px !important;
    scrollbar-width: none !important;
  }
  .tab-nav::-webkit-scrollbar,
  .nav-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .tab-btn {
    flex-shrink: 0 !important;
  }

  /* 7. Barras de Filtros e Controles em Coluna */
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .filter-group,
  .filter-group.grow-2,
  .hub-control-group {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* 8. Cabeçalho de Ficha do Aluno em Telas Móveis */
  .aluno-header-card {
    padding: 1.25rem 1rem !important;
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    gap: 1rem !important;
  }
  .aluno-header-info {
    text-align: center !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  .aluno-meta-badges,
  .aluno-quick-actions {
    justify-content: center !important;
  }
  .academic-summary-bar {
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  /* 9. Garantia de alvos de toque mínimos de 44px */
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-acao,
  .tab-btn,
  .btn-print,
  .btn-action,
  .cat-pill,
  button:not(.btn-qty),
  select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"] {
    min-height: 44px !important;
  }

  .btn-acao {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

/* =========================================================================
   SELETOR GLOBAL DE ANO LETIVO & BANNER DE ANO ENCERRADO
   ========================================================================= */
.nexo-topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nexo-ano-selector-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #FFFFFF;
  border: 1px solid var(--ejep-silver);
  border-radius: var(--radius-full);
  padding: 0.32rem 0.8rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nexo-ano-selector-wrap:hover {
  border-color: var(--ejep-blue-light);
  box-shadow: 0 2px 6px rgba(26, 79, 160, 0.1);
}

.nexo-ano-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}

.nexo-ano-select {
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ejep-blue);
  cursor: pointer;
  outline: none;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  font-family: inherit;
}

.nexo-ano-select:focus {
  background: var(--ejep-blue-soft);
}

.nexo-ano-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.nexo-ano-badge.badge-aberto {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.nexo-ano-badge.badge-encerrado {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.nexo-ano-badge.badge-planejamento {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #D8B4FE;
}

.ano-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.badge-aberto .ano-dot {
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulseDot 2s infinite;
}

.badge-encerrado .ano-dot {
  background: #F59E0B;
}

.badge-planejamento .ano-dot {
  background: #A855F7;
}

/* BANNER DE ALERTA DE ANO ENCERRADO */
.nexo-banner-alerta-encerrado {
  background: linear-gradient(90deg, #FEF3C7 0%, #FFFBEB 100%);
  border-bottom: 2px solid #F59E0B;
  color: #92400E;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  position: sticky;
  top: 57px;
  z-index: 790;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
  animation: slideDownBanner 0.25s ease-out;
}

@keyframes slideDownBanner {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.nexo-banner-alerta-encerrado i {
  font-size: 1.1rem;
  color: #D97706;
  flex-shrink: 0;
}

@media (max-width: 991px) {
  .nexo-topbar-actions {
    gap: 0.5rem;
  }
  .nexo-banner-alerta-encerrado {
    top: 56px;
    padding: 0.6rem 0.85rem;
    font-size: 0.78rem;
  }
}

/* =========================================================================
   ACCORDION DA SIDEBAR (Strict Accordion / 4 Grupos Temáticos)
   Estilo Cristal Claro com Destaque Neon Azul (Inspirado no modelo Iconsax)
   ========================================================================= */
/* =========================================================================
   ACCORDION DA SIDEBAR (Minimalista Moderno / 4 Grupos Temáticos)
   Estilo Clean & Sofisticado (Fundo claro, sem vidro e sem efeitos de luz)
   ========================================================================= */
.nexo-nav-group {
  margin-bottom: 0.35rem;
  display: flex;
  flex-direction: column;
}

.nexo-group-btn {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: #475569;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.2s ease;
  user-select: none;
  min-height: 38px;
}

.nexo-group-btn:hover {
  color: #0F172A;
  background: #F8FAFC;
}

.nexo-nav-group.open .nexo-group-btn {
  color: #0F172A;
  background: #F8FAFC;
  font-weight: 600;
}

/* Sem feixes ou sombras neon */
.nexo-nav-group.open .nexo-group-btn::before {
  display: none !important;
}

.nexo-group-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.nexo-group-icon-badge {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 7px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #64748B;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nexo-group-header-left i {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  font-size: 0.88rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.nexo-group-btn:hover .nexo-group-icon-badge {
  background: #E2E8F0;
  color: #1E293B;
}

.nexo-group-btn:hover .nexo-group-header-left i {
  color: #1E293B;
}

.nexo-nav-group.open .nexo-group-icon-badge {
  background: #EFF6FF;
  border-color: #DBEAFE;
  color: #2563EB;
  box-shadow: none !important;
}

.nexo-nav-group.open .nexo-group-header-left i {
  color: #2563EB;
  filter: none !important;
}

.nexo-group-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  line-height: 1.2;
}

.nexo-group-btn:hover .nexo-group-title,
.nexo-nav-group.open .nexo-group-title {
  color: #1E293B;
}

.nexo-group-chevron {
  width: 14px;
  min-width: 14px;
  font-size: 0.65rem;
  text-align: center;
  transition: transform 0.22s ease, color 0.2s ease;
  color: #94A3B8;
  flex-shrink: 0;
}

.nexo-nav-group.open .nexo-group-chevron {
  transform: rotate(180deg);
  color: #64748B;
}

.nexo-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.15rem 0 0.35rem 0;
  padding: 0;
  border-left: none;
  position: relative;
}

.nexo-nav-group.open .nexo-group-items {
  max-height: 500px;
  border-left: none;
  box-shadow: none !important;
}

.nexo-group-items a {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #475569;
  font-size: 0.83rem;
  font-weight: 500;
  min-height: 36px;
  transition: all 0.18s ease;
  position: relative;
}

.nexo-group-items a i {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  text-align: center;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  flex-shrink: 0;
  transition: color 0.18s ease;
}

.nexo-group-items a span,
.nexo-item-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.nexo-group-items a:hover {
  background: #F8FAFC;
  color: #0F172A;
  border-color: transparent;
}

.nexo-group-items a:hover i {
  color: #2563EB;
}

/* ITEM ATIVO: Pílula azul suave limpa (sem barra vertical, sem neon ou vidro) */
.nexo-group-items a.active {
  background: #EFF6FF !important;
  border-color: #DBEAFE !important;
  color: #1D4ED8 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transform: none !important;
  position: relative;
}

.nexo-group-items a.active::before {
  display: none !important;
}

.nexo-group-items a.active i {
  color: #2563EB !important;
  filter: none !important;
}

/* =========================================================================
   TOPBAR ENRIQUECIDA (BREADCRUMBS, QUICK PONTO & USER DROPDOWN)
   ========================================================================= */
.nexo-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}

.nexo-breadcrumbs span.category {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
}

.nexo-breadcrumbs i.separator {
  font-size: 0.6rem;
  color: #94A3B8;
}

.nexo-breadcrumbs span.current {
  color: var(--ejep-blue);
  font-weight: 700;
}

.nexo-btn-quick-ponto {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  background: linear-gradient(135deg, #1A4FA0 0%, #133E80 100%);
  color: #FFFFFF !important;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(26, 79, 160, 0.25);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

.nexo-btn-quick-ponto:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 79, 160, 0.35);
  background: linear-gradient(135deg, #205bc0 0%, #174aa0 100%);
}

.nexo-btn-quick-ponto i {
  font-size: 0.95rem;
  color: #93C5FD;
}

.nexo-user-menu-wrapper {
  position: relative;
}

.nexo-user-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem;
  background: var(--ejep-blue-soft);
  border: 1px solid var(--ejep-silver);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ejep-blue);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexo-user-badge-btn:hover {
  background: #E2ECFE;
  border-color: var(--ejep-blue);
}

.nexo-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  padding: 0.75rem 0;
  animation: fadeInDropdown 0.2s ease;
}

.nexo-user-dropdown.open {
  display: block;
}

.nexo-dropdown-header {
  padding: 0.6rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.nexo-dropdown-header strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.2;
}

.nexo-dropdown-header small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.nexo-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  font-size: 0.84rem;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}

.nexo-dropdown-item:hover {
  background: var(--bg-page);
  color: var(--primary);
}

.nexo-dropdown-item.logout {
  color: var(--danger);
  border-top: 1px solid var(--border);
  margin-top: 0.35rem;
  padding-top: 0.7rem;
}

.nexo-dropdown-item.logout:hover {
  background: var(--danger-soft);
}

@keyframes fadeInDropdown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   HUB DE AÇÕES RÁPIDAS (ACTION HUB - DASHBOARDS)
   ========================================================================= */
.nexo-action-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.nexo-action-card {
  background: var(--card-bg);
  border: 1px solid var(--ejep-silver);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nexo-action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #93C5FD;
}

.nexo-action-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.nexo-action-icon.blue { background: #EEF4FF; color: #1A4FA0; }
.nexo-action-icon.green { background: #DCFCE7; color: #15803D; }
.nexo-action-icon.amber { background: #FEF3C7; color: #B45309; }
.nexo-action-icon.purple { background: #F3E8FF; color: #7E22CE; }
.nexo-action-icon.red { background: #FEE2E2; color: #B91C1C; }

.nexo-action-info {
  flex: 1;
  min-width: 0;
}

.nexo-action-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.nexo-action-badge.blue { background: #DBEAFE; color: #1E40AF; }
.nexo-action-badge.green { background: #DCFCE7; color: #166534; }
.nexo-action-badge.amber { background: #FEF3C7; color: #92400E; }
.nexo-action-badge.purple { background: #F3E8FF; color: #6B21A8; }
.nexo-action-badge.red { background: #FEE2E2; color: #991B1B; }

.nexo-action-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.nexo-action-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* =========================================================================
   SISTEMA GLOBAL DE BUSCAS & FILTROS ("Enterprise Warmth / Refined SaaS")
   ========================================================================= */
.nexo-filter-toolbar,
.filters-grid,
.filter-panel,
.card-filtros {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}

/* Wrapper de Input de Busca com Ícone */
.nexo-search-wrap,
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
}

.nexo-search-wrap i.search-icon,
.search-box i.search-icon {
  position: absolute;
  left: 0.95rem;
  color: #94A3B8;
  font-size: 0.9rem;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.nexo-search-wrap input,
.search-box input,
.filters-grid input[type="text"],
.filter-panel input[type="text"],
.card-filtros input[type="text"],
.filter-bar input[type="text"],
.filter-group input[type="text"],
.filtro-item input[type="text"],
.filter-grid-cascade input[type="text"],
.filter-field input[type="text"],
.cal-input {
  width: 100%;
  padding: 0.65rem 0.95rem;
  background: #FFFFFF;
  border: 1.5px solid var(--ejep-silver);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.nexo-search-wrap input,
.search-box:has(.search-icon) input {
  padding-left: 2.45rem;
}

.nexo-search-wrap input:hover,
.search-box input:hover,
.filters-grid input[type="text"]:hover,
.filter-panel input[type="text"]:hover,
.card-filtros input[type="text"]:hover,
.filter-bar input[type="text"]:hover,
.filter-group input[type="text"]:hover,
.filtro-item input[type="text"]:hover,
.filter-grid-cascade input[type="text"]:hover,
.filter-field input[type="text"]:hover,
.cal-input:hover {
  border-color: #CBD5E1;
}

.nexo-search-wrap input:focus,
.search-box input:focus,
.filters-grid input[type="text"]:focus,
.filter-panel input[type="text"]:focus,
.card-filtros input[type="text"]:focus,
.filter-bar input[type="text"]:focus,
.filter-group input[type="text"]:focus,
.filtro-item input[type="text"]:focus,
.filter-grid-cascade input[type="text"]:focus,
.filter-field input[type="text"]:focus,
.cal-input:focus {
  border-color: var(--ejep-blue);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(26, 79, 160, 0.12);
}

.nexo-search-wrap:focus-within i.search-icon,
.search-box:focus-within i.search-icon {
  color: var(--ejep-blue);
}

/* Dropdown Selects com Estilização Refinada & Custom Chevron */
.nexo-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 150px;
  flex: 1;
}

.nexo-select-wrap select,
select.nexo-select-wrap,
select.form-control,
.form-group select,
.modal-body select,
.filters-grid select,
.filter-panel select,
.card-filtros select,
.filter-bar select,
.filter-group select,
.filtro-item select,
.cascata-filtros select,
.filter-grid-cascade select,
.filter-field select,
.cal-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0.65rem 2.2rem 0.65rem 0.95rem;
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 13px;
  border: 1.5px solid var(--ejep-silver);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.nexo-select-wrap select:hover,
select.nexo-select-wrap:hover,
select.form-control:hover,
.form-group select:hover,
.modal-body select:hover,
.filters-grid select:hover,
.filter-panel select:hover,
.card-filtros select:hover,
.filter-bar select:hover,
.filter-group select:hover,
.filtro-item select:hover,
.cascata-filtros select:hover,
.filter-grid-cascade select:hover,
.filter-field select:hover,
.cal-select:hover {
  border-color: #CBD5E1;
  background-color: #F8FAFC;
}

.nexo-select-wrap select:focus,
select.nexo-select-wrap:focus,
select.form-control:focus,
.form-group select:focus,
.modal-body select:focus,
.filters-grid select:focus,
.filter-panel select:focus,
.card-filtros select:focus,
.filter-bar select:focus,
.filter-group select:focus,
.filtro-item select:focus,
.cascata-filtros select:focus,
.filter-grid-cascade select:focus,
.filter-field select:focus,
.cal-select:focus {
  border-color: var(--ejep-blue);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(26, 79, 160, 0.12);
}

/* Botão Limpar Filtros */
.nexo-btn-clear-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: #F1F5F9;
  border: 1.5px solid var(--ejep-silver);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 40px;
}

.nexo-btn-clear-filters:hover {
  background: #FEE2E2;
  color: var(--danger);
  border-color: #FCA5A5;
}

/* =========================================================================
   REGRAS DE IMPRESSÃO (@media print)
   ========================================================================= */
@media print {
  aside.nexo-sidebar,
  .nexo-topbar,
  .nexo-mobile-header,
  .nexo-backdrop,
  .no-print {
    display: none !important;
  }

  body {
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  .nexo-content-wrapper {
    height: auto !important;
    overflow: visible !important;
  }

  main.nexo-page-main {
    padding: 0 !important;
    max-width: 100% !important;
  }
}
