/* Estilos do Sistema Administrativo Metatron - Design Premium */

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

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131a26;
  --bg-tertiary: #1b2433;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: var(--bg-secondary);
  --glass-border: var(--border-color);
  --font-sans: 'Outfit', sans-serif;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --radius-lg: 12px;
  --radius-md: 8px;
}

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

/* Barra de Rolagem Customizada Premium */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  /* Mesma cor do header: #131a26 */
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  /* Tom cinza neutro clássico */
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
  /* Tom cinza mais claro no hover */
}

/* Compatibilidade Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 var(--bg-secondary);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

header.main-header {
  width: 280px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: linear-gradient(180deg, #0d1322 0%, #090d16 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0.75rem 0.85rem 1.25rem;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

header.main-header::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.brand-wrapper {
  width: 100%;
  padding: 0 0.25rem;
  margin-bottom: 0.85rem;
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
}

.brand-logo {
  height: 52px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(61, 166, 255, 0.45));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.brand-badge {
  font-size: 0.75rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22) 0%, rgba(139, 92, 246, 0.18) 100%);
  border: 1px solid rgba(61, 166, 255, 0.4);
  color: #93c5fd;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 0 16px rgba(61, 166, 255, 0.25);
  text-shadow: 0 0 10px rgba(61, 166, 255, 0.5);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-divider {
  display: none;
}

/* Painel de Perfil do Usuário no Sidebar */
.user-profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.user-info-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.user-info-card:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(61, 166, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.avatar-container {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(61, 166, 255, 0.4);
  object-fit: cover;
  box-shadow: 0 0 8px rgba(61, 166, 255, 0.25);
  transition: all 0.25s ease;
}

.user-details {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.user-name-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.role-badge {
  font-size: 0.44rem;
  font-weight: 800;
  padding: 1px 3.5px;
  border-radius: 3px;
  width: fit-content;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.role-badge.role-admin {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(37, 99, 235, 0.2) 100%);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.25);
}

.role-badge.role-professor {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.btn-sidebar-secondary {
  width: 100%;
  background: rgba(61, 166, 255, 0.07);
  border: 1px solid rgba(61, 166, 255, 0.2);
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.48rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: inherit;
}

.btn-sidebar-secondary:hover {
  background: rgba(61, 166, 255, 0.16);
  border-color: #3da6ff;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(61, 166, 255, 0.3);
  transform: translateY(-1px);
}

.btn-sidebar-secondary:hover svg {
  color: #ffffff;
}

.btn-sidebar-secondary.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28) 0%, rgba(6, 182, 212, 0.18) 100%);
  border-color: #3da6ff;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(61, 166, 255, 0.35);
}

.btn-sidebar-secondary.active svg {
  color: #ffffff !important;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.btn-logout-sidebar {
  width: 100%;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.48rem 0.75rem;
  border-radius: 10px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.btn-logout-sidebar:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

/* Links de Navegação Vertical (Sidebar Nav) */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-nav .nav-section-title:first-child {
  margin-top: 0.15rem;
}

.nav-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.08em;
  margin-top: 0.85rem;
  margin-bottom: 0.35rem;
  padding-left: 0.65rem;
}

.nav-section-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3da6ff;
  opacity: 0.6;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 12px;
  border-left: 3.5px solid transparent;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.22s ease;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: all 0.22s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(3px);
  border-left-color: rgba(61, 166, 255, 0.4);
}

.nav-item:hover .nav-icon-wrap {
  background: rgba(61, 166, 255, 0.12);
  color: #3da6ff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.18) 0%, rgba(6, 182, 212, 0.06) 100%);
  border-left-color: #3da6ff;
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 15px rgba(0, 0, 0, 0.25);
}

.nav-item.active .nav-icon-wrap {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(61, 166, 255, 0.5);
}

.nav-item.active .nav-icon {
  color: #ffffff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

/* Hambúrguer móvel */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  line-height: 1.2;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary,
.btn-hero-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  border: 1px solid rgba(59, 130, 246, 0.5) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3) !important;
}

.btn-primary:hover,
.btn-hero-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #3da6ff !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5), 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
  transform: translateY(-2px) !important;
}

.btn-emerald,
.btn-hero-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3) !important;
}

.btn-emerald:hover,
.btn-hero-emerald:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5), 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
  transform: translateY(-2px) !important;
}

.btn-danger,
.btn-hero-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3) !important;
  font-family: inherit;
}

.btn-danger:hover,
.btn-hero-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.5), 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
  transform: translateY(-2px) !important;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary) !important;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff !important;
  transform: translateY(-2px) !important;
}

main {
  flex: 1;
  padding: 2rem 2.5rem !important;
  margin-left: 280px !important;
  /* Offset para a sidebar fixa */
  max-width: calc(100% - 280px) !important;
  width: calc(100% - 280px) !important;
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Padronização Universal de Largura e Centralização (Padrão Relatório de Certificados) */
main > * {
  width: 100%;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

.portal-container,
.report-container,
.presence-report-container,
.presence-container,
.upload-container,
.history-container,
.hours-bank-container,
.profile-container,
.audit-container {
  width: 100% !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* Blindagem Global de Estabilidade da GPU contra descarte de texturas (Tile Dropping) no scroll rápido */
.kpi-card-modern,
.kpi-card,
.stat-card,
.module-card,
.bday-student-card,
.card-modern,
.dashboard-hero,
.card {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Glass Card */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

/* Padronização de Título Neon Gradient e Spacing de Cabeçalho (Estilo Relatório de Certificados) */
.page-header-standard,
.report-header-section,
.dashboard-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem !important;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
}

.page-title-block h1,
.page-title-block h2,
.report-title-block h1,
.report-title-block h2,
.dashboard-header-container h1,
.dashboard-header-container h2 {
  font-size: 1.8rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  margin-top: 0 !important;
  margin-bottom: 0.25rem !important;
  letter-spacing: -0.02em !important;
}

.page-title-block p,
.report-title-block p,
.dashboard-header-container p {
  color: var(--text-secondary) !important;
  font-size: 0.9rem !important;
  margin: 0 !important;
  font-weight: 400 !important;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title-blue,
.card-title h3,
.card-title span.title-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3da6ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Dashboard Toolbar */
.toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: #3da6ff;
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.4), 0 0 0 2px rgba(30, 144, 255, 0.15);
}

.filter-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}

/* Alunos Table */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

th {
  background-color: var(--bg-secondary);
  padding: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  transition: all 0.2s ease;
}

tr td:first-child {
  border-left: 3px solid transparent;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(61, 166, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(61, 166, 255, 0.12), inset 0 -1px 0 rgba(61, 166, 255, 0.12);
}

tr:hover td:first-child {
  border-left-color: #3da6ff !important;
}

.student-name-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.avatar-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  /* Quadrado com cantos levemente arredondados */
  object-fit: cover;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: block;
  overflow: hidden;
  text-indent: -9999px;
  /* Oculta texto alternativo se a imagem falhar, prevenindo quebras */
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-active {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn-icon:not(:last-child) {
  margin-right: 8px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Forms styling */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.col-12 {
  grid-column: span 12;
}

.col-11 {
  grid-column: span 11;
}

.col-10 {
  grid-column: span 10;
}

.col-9 {
  grid-column: span 9;
}

.col-8 {
  grid-column: span 8;
}

.col-7 {
  grid-column: span 7;
}

.col-6 {
  grid-column: span 6;
}

.col-5 {
  grid-column: span 5;
}

.col-4 {
  grid-column: span 4;
}

.col-3 {
  grid-column: span 3;
}

.col-2 {
  grid-column: span 2;
}

.col-1 {
  grid-column: span 1;
}

.form-control {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

input[type="date"].form-control {
  width: 100%;
  min-width: 150px;
  box-sizing: border-box;
  font-size: 0.88rem !important;
  padding: 0.6rem 0.3rem 0.6rem 0.6rem !important;
  letter-spacing: -0.3px;
}

input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.85);
  opacity: 0.85;
  margin-left: 0.15rem;
  padding: 0;
}

@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }

  header.main-header {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.5rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  header.main-header .brand {
    flex-direction: row;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
    align-items: center;
    width: auto;
    gap: 0.75rem;
  }

  header.main-header .brand img {
    height: 40px !important;
  }

  .sidebar-nav {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  main {
    margin-left: 0;
    max-width: 100%;
    padding: 1.5rem;
  }

  /* Gaveta do menu quando aberta no celular */
  header.main-header.mobile-open {
    height: 100vh;
    position: fixed;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background-color: var(--bg-secondary);
    overflow-y: auto;
  }

  header.main-header.mobile-open .sidebar-nav {
    display: flex;
    margin-top: 1.5rem;
  }

  header.main-header.mobile-open .sidebar-footer {
    display: block;
    margin-top: auto;
  }
}

@media (max-width: 768px) {

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

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: #3da6ff;
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.4), 0 0 0 2px rgba(30, 144, 255, 0.15);
}

.form-control:disabled {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Signature & File Upload Containers */
.file-upload-wrapper {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.01);
  transition: all 0.2s ease;
  position: relative;
}

.file-upload-wrapper:hover {
  border-color: var(--accent-color);
  background-color: rgba(59, 130, 246, 0.02);
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-preview {
  margin-top: 0.75rem;
  max-height: 120px;
  max-width: 100%;
  border-radius: 4px;
  display: none;
}

/* Canvas Signature Pad */
.signature-pad-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.signature-pad-canvas {
  width: 100%;
  height: 180px;
  background-color: #fff;
  border-radius: 4px;
  touch-action: none;
  /* Previne rolagem da página ao assinar no celular */
  cursor: crosshair;
}

.signature-pad-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Feedback messages */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: none;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
  box-sizing: border-box;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Custom Premium Toasts */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999999;
  pointer-events: none;
}

.toast {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.96) 0%, rgba(15, 23, 42, 0.92) 100%);
  color: #f1f5f9;
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  transform: translateX(40px) scale(0.95);
  opacity: 0;
  pointer-events: auto;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  max-width: 420px;
}

.toast.active {
  transform: translateX(0) scale(1);
  opacity: 1;
}

/* Linha colorida superior curvando e afinando nos cantos dos Toasts (estilo foto 1) */
.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  z-index: 2;
  -webkit-mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M 0,14 C 0,6.25 6.25,0 14,0 L 14,3 C 7.5,3 3,7.5 0,14 Z' fill='%23000'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M 14,14 C 14,6.25 7.75,0 0,0 L 0,3 C 6.5,3 11,7.5 14,14 Z' fill='%23000'/%3E%3C/svg%3E"),
    linear-gradient(to right, black, black);
  mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M 0,14 C 0,6.25 6.25,0 14,0 L 14,3 C 7.5,3 3,7.5 0,14 Z' fill='%23000'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M 14,14 C 14,6.25 7.75,0 0,0 L 0,3 C 6.5,3 11,7.5 14,14 Z' fill='%23000'/%3E%3C/svg%3E"),
    linear-gradient(to right, black, black);
  -webkit-mask-position: top left, top right, top 0px left 13px;
  mask-position: top left, top right, top 0px left 13px;
  -webkit-mask-size: 14px 14px, 14px 14px, calc(100% - 26px) 3px;
  mask-size: 14px 14px, 14px 14px, calc(100% - 26px) 3px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  background: #3da6ff;
}

.toast-success::before {
  background: #10b981 !important;
}

.toast-error::before {
  background: #ef4444 !important;
}

.toast-warning::before {
  background: #f59e0b !important;
}

.toast-info::before {
  background: #3da6ff !important;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(16, 185, 129, 0.25);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(239, 68, 68, 0.25);
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.25);
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(59, 130, 246, 0.25);
}

.toast-icon {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-countdown {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
  flex-shrink: 0;
  margin-left: 8px;
}

.toast-countdown-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 4;
}

.toast-countdown-fill {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.toast.active .toast-countdown-fill {
  animation: toast-countdown-anim 4s linear forwards;
}

@keyframes toast-countdown-anim {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: 100;
  }
}

/* Zoom de Imagem Premium (Lightbox) */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  /* Fica acima do Toast inclusive */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  outline: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.zoom-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.zoom-overlay img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 25px rgba(61, 166, 255, 0.15);
  border: 3px solid rgba(61, 166, 255, 0.2);
  transform: scale(0.9);
  transition: transform 0.2s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.zoom-overlay.active img {
  transform: scale(1);
}

.zoom-controls {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10000000;
}

.zoom-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(19, 26, 38, 0.85);
  border: 1px solid rgba(61, 166, 255, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  outline: none;
}

.zoom-btn:hover,
.zoom-btn.btn-active {
  background: var(--bg-tertiary);
  border-color: #3da6ff;
  color: #3da6ff;
  transform: scale(1.1);
  box-shadow: 0 0 18px rgba(61, 166, 255, 0.65);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.zoom-overlay img.zoomed-in {
  cursor: grab;
}

.zoom-overlay img.zoomed-in:active {
  cursor: grabbing;
}

@media (max-width: 900px) {
  .zoom-controls {
    right: 20px;
    gap: 12px;
  }

  .zoom-btn {
    width: 46px;
    height: 46px;
  }
}

/* Permitir cursor de ponteiro em imagens de perfil clicáveis */
#p-photo,
.signature-display,
.avatar-thumbnail,
.zoomable-img {
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#p-photo:hover,
.signature-display:hover,
.avatar-thumbnail:hover,
.zoomable-img:hover {
  transform: scale(1.03);
  box-shadow: 0 0 15px rgba(61, 166, 255, 0.3);
}

/* Botão de Remoção de Card - Padrão Vermelho Neon Translúcido Unificado */
.btn-remove-item {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.btn-remove-item:hover {
  background: #ef4444 !important;
  color: white !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Estilos de Autenticação na Barra de Navegação */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #ef4444 !important;
  color: white !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

/* Badges de Cargos */
.role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  user-select: none;
}

.role-admin {
  background: rgba(139, 92, 246, 0.15) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  color: #c084fc !important;
}

.role-professor {
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  color: #93c5fd !important;
}

/* KPIs Grid e Cards (Estilos Compartilhados Globais) */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-active::before {
  background: #10b981;
  /* Verde */
}

.kpi-alert::before {
  background: #f59e0b;
  /* Laranja/Alerta */
}

.kpi-info::before {
  background: #3b82f6;
  /* Azul */
}

.kpi-purple::before {
  background: #a855f7;
  /* Roxo */
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-active .kpi-icon {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.kpi-alert .kpi-icon {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
}

.kpi-info .kpi-icon {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.kpi-purple .kpi-icon {
  background: rgba(168, 85, 247, 0.08);
  color: #a855f7;
}

.kpi-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 0.25rem;
}

.kpi-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Modal Overlay Global - Ocupa 100% da tela cheia em qualquer monitor (incluindo ultrawide e monitores grandes) */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 1rem !important;
  background: rgba(3, 7, 18, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 999999 !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

/* Fio colorido superior curvo nos Modais (Padrão Neon Metatron) */
.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  pointer-events: none;
  z-index: 2;
  -webkit-mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M 0,22 C 0,9.85 9.85,0 22,0 L 22,4 C 12,4 4,11 0,22 Z' fill='%23000'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M 22,22 C 22,9.85 12.15,0 0,0 L 0,4 C 10,4 18,11 22,22 Z' fill='%23000'/%3E%3C/svg%3E"),
    linear-gradient(to right, black, black);
  mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M 0,22 C 0,9.85 9.85,0 22,0 L 22,4 C 12,4 4,11 0,22 Z' fill='%23000'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M 22,22 C 22,9.85 12.15,0 0,0 L 0,4 C 10,4 18,11 22,22 Z' fill='%23000'/%3E%3C/svg%3E"),
    linear-gradient(to right, black, black);
  -webkit-mask-position: top left, top right, top 0px left 21px;
  mask-position: top left, top right, top 0px left 21px;
  -webkit-mask-size: 22px 22px, 22px 22px, calc(100% - 42px) 4px;
  mask-size: 22px 22px, 22px 22px, calc(100% - 42px) 4px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  background: #3da6ff;
}

/* Estados Dinâmicos do QR Code Modal */
.qr-loading-state {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 218px;
  height: 218px;
}

.qr-ready-state {
  background: #ffffff !important;
  padding: 14px !important;
  border-radius: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(59, 130, 246, 0.25) !important;
  border: 3px solid #3b82f6 !important;
  min-width: 218px;
  min-height: 218px;
  animation: qrFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qrFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.qr-spinner-circle {
  width: 48px;
  height: 48px;
  border: 3.5px solid rgba(59, 130, 246, 0.15);
  border-top-color: #3b82f6;
  border-right-color: #60a5fa;
  border-radius: 50%;
  animation: spinQr 0.85s linear infinite;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

@keyframes spinQr {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Botões de Ação de QR Code no Formulário (Foto e Assinatura - Padrão Neon Metatron) */
.btn-qr-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(30, 144, 255, 0.08);
  border: 1px solid rgba(30, 144, 255, 0.35);
  color: #3da6ff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(30, 144, 255, 0.15);
  transition: all 0.25s ease;
  letter-spacing: 0.2px;
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-qr-action:hover {
  background: rgba(30, 144, 255, 0.18);
  border-color: #1e90ff; /* Borda neon azul padrão do site */
  color: #ffffff;
  box-shadow: 0 0 14px rgba(30, 144, 255, 0.55); /* Glow azul neon suave */
  transform: translateY(-1px);
}

.btn-qr-action:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(30, 144, 255, 0.4);
}

.btn-qr-action svg {
  color: #3da6ff;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-qr-action:hover svg {
  color: #ffffff;
  filter: drop-shadow(0 0 4px #1e90ff);
}