/* ==========================================================================
   DIÁRIO DE CLASSE DIGITAL - DESIGN SYSTEM & MAIN CSS
   Inspirado no diário escolar oficial com visual moderno e de alta produtividade
   ========================================================================== */

:root {
  /* Palette de Cores Primárias (Azul Institucional / Cabeçalho de Alunos) */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;

  /* Palette de Cores de Destaque / Bimestre / Frequência (Verde Oficial) */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --emerald-900: #064e3b;

  /* Palette Neutra / Superfície */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Cores de Alerta e Status */
  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  --info-50: #f0f9ff;
  --info-100: #e0f2fe;
  --info-500: #0ea5e9;
  --info-600: #0284c7;

  /* Cores Temáticas de Aplicação */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0b1329;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f8fafc;

  --border-light: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Sombras Modernas */
  --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.06);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 30px -6px rgba(15, 23, 42, 0.1), 0 8px 12px -6px rgba(15, 23, 42, 0.06);

  /* Dimensões */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --header-height: 70px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-full: 9999px;

  /* Transições */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 15px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.02) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.02) 0px, transparent 50%), #f8fafc;
}

/* Layout Principal */
#app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Container Principal de Conteúdo */
#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Previne overflow flexbox */
  background: transparent;
}

#main-content {
  flex: 1;
  padding: 24px;
  max-width: 100%;
  overflow-y: auto;
}

/* Barra Superior de Data e Hora Centralizada com Fundo Azul e Ações */
.top-datetime-bar {
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #1e3a8a 100%);
  color: #ffffff;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
  z-index: 50;
  letter-spacing: 0.3px;
  min-height: 42px;
}

.datetime-single-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 90px; /* Evita sobreposição com o botão em telas menores */
}

.top-bar-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 2;
}

.topbar-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.topbar-theme-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.topbar-theme-btn:active {
  transform: scale(0.96);
}

.topbar-theme-btn .theme-btn-icon {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.topbar-theme-btn:hover .theme-btn-icon {
  transform: rotate(15deg);
}

/* Tipografia e Títulos de Páginas */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-group h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.page-title-group p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Utilitários Visuais */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary {
  background-color: var(--primary-100);
  color: var(--primary-800);
  border: 1px solid var(--primary-200);
}

.badge-success {
  background-color: var(--emerald-100);
  color: var(--emerald-800);
  border: 1px solid var(--emerald-200);
}

.badge-danger {
  background-color: var(--danger-100);
  color: var(--danger-700);
  border: 1px solid var(--danger-100);
}

.badge-warning {
  background-color: var(--warning-100);
  color: var(--warning-700);
  border: 1px solid var(--warning-100);
}

.badge-neutral {
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

/* Indicadores de Status de Salvamento */
.save-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--border-radius-full);
  transition: var(--transition-normal);
}

.save-status-indicator.saving {
  background-color: var(--warning-50);
  color: var(--warning-700);
  border: 1px solid var(--warning-200);
}

.save-status-indicator.saved {
  background-color: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-200);
}

.save-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--warning-500);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Animações de entrada */
.fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

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

/* Responsividade básica */
@media (max-width: 1024px) {
  #main-content {
    padding: 16px;
  }
}

/* ==========================================================================
   TEMA DARK (DARK MODE) - DESIGN SYSTEM COMPLETO & ERGONÔMICO
   Padronizado com o tom Slate-Navy (#1e293b) e nomes em branco (#ffffff)
   ========================================================================== */

[data-theme="dark"] {
  /* Paleta Primária */
  --primary-50: #172554;
  --primary-100: #1e3a8a;
  --primary-200: #1d4ed8;
  --primary-300: #2563eb;
  --primary-400: #3b82f6;
  --primary-500: #60a5fa;
  --primary-600: #3b82f6;
  --primary-700: #60a5fa;
  --primary-800: #93c5fd;

  /* Paleta Emerald */
  --emerald-50: #064e3b;
  --emerald-100: #065f46;
  --emerald-200: #047857;
  --emerald-300: #059669;
  --emerald-400: #10b981;
  --emerald-500: #34d399;
  --emerald-600: #10b981;
  --emerald-700: #6ee7b7;

  /* Paleta Neutra Escura (Slate / Navy) */
  --slate-50: #1e293b;
  --slate-100: #243044;
  --slate-200: #334155;
  --slate-300: #475569;
  --slate-400: #94a3b8;
  --slate-500: #cbd5e1;
  --slate-600: #e2e8f0;
  --slate-700: #f1f5f9;
  --slate-800: #f8fafc;
  --slate-900: #ffffff;
  --slate-950: #ffffff;

  /* Superfícies e Fundos com Tom Padrão (#1e293b e #0f172a) */
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273549;
  --bg-sidebar: #0b1329;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #2563eb;

  /* Textos */
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #ffffff;

  /* Bordas */
  --border-light: #334155;
  --border-strong: #475569;

  /* Sombras */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 16px -2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 14px 28px -4px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 24px 38px -6px rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] body {
  background: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.06) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%), #0f172a;
  color: var(--text-primary);
}

/* Barra Superior de Data/Hora no Dark Mode */
[data-theme="dark"] .top-datetime-bar {
  background: linear-gradient(90deg, #090d16 0%, #1e3a8a 50%, #090d16 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .topbar-theme-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .topbar-theme-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .topbar-theme-btn .theme-btn-icon i {
  color: #facc15;
}

/* Header Secundário */
[data-theme="dark"] #top-header {
  background: #1e293b;
  border-bottom-color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .header-class-selector {
  background: #243044;
  border-color: #334155;
}

[data-theme="dark"] .header-class-selector select {
  color: #ffffff;
  background: #243044;
}

[data-theme="dark"] .header-class-selector select option {
  background: #1e293b;
  color: #ffffff;
}

[data-theme="dark"] .segmented-control {
  background: #243044;
  border-color: #334155;
}

[data-theme="dark"] .segmented-btn {
  color: #cbd5e1;
}

[data-theme="dark"] .segmented-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .segmented-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .user-profile-badge {
  background: #243044;
  border-color: #334155;
}

[data-theme="dark"] .user-name {
  color: #ffffff !important;
}

/* Cards, Seções e Caixas com Fundo Padrão #1e293b */
[data-theme="dark"] .card,
[data-theme="dark"] div[style*="background: #ffffff"],
[data-theme="dark"] div[style*="background: #f8fafc"],
[data-theme="dark"] div[style*="background: #f1f5f9"],
[data-theme="dark"] div[style*="background: linear-gradient(135deg, #ffffff"] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .card-title,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] strong {
  color: #ffffff !important;
}

[data-theme="dark"] .card-header {
  border-bottom-color: #334155;
}

[data-theme="dark"] .page-title-group h1 {
  color: #ffffff !important;
}

[data-theme="dark"] .page-title-group p {
  color: #cbd5e1 !important;
}

/* Botões no Dark Mode */
[data-theme="dark"] .btn-secondary {
  background: #243044 !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #2f3e58 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .btn-toggle-sidebar-header {
  background: #243044;
  color: #ffffff;
  border-color: #334155;
}

[data-theme="dark"] .btn-toggle-sidebar-header:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

[data-theme="dark"] .btn-ghost {
  color: #cbd5e1;
}

[data-theme="dark"] .btn-ghost:hover {
  background: #243044;
  color: #ffffff;
}

/* Estatísticas e Widgets KPI */
[data-theme="dark"] .stat-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .stat-card:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.6) !important;
  background: #243044 !important;
}

[data-theme="dark"] .stat-label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .stat-value {
  color: #ffffff !important;
}

[data-theme="dark"] .stat-helper {
  color: #94a3b8 !important;
}

/* Formulários e Inputs Padronizados com Fundo #1e293b */
[data-theme="dark"] .form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .search-box input {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .search-box input:focus {
  background-color: #243044 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #94a3b8 !important;
}

[data-theme="dark"] .form-label {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .form-hint {
  color: #94a3b8 !important;
}

/* Modais Padronizados */
[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-dialog {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #334155;
}

[data-theme="dark"] .modal-header h3 {
  color: #ffffff !important;
}

[data-theme="dark"] .modal-footer {
  background: #182234 !important;
  border-top-color: #334155 !important;
}

[data-theme="dark"] .modal-close-btn {
  color: #cbd5e1;
}

[data-theme="dark"] .modal-close-btn:hover {
  background: #243044;
  color: #ffffff;
}

/* Tabela do Diário Oficial & Tabelas Gerais */
[data-theme="dark"] .diary-header-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .diary-main-title h2 {
  color: #ffffff !important;
}

[data-theme="dark"] .meta-chip {
  background: #243044 !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .meta-chip.chip-highlight {
  background: #064e3b !important;
  border-color: #059669 !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .diary-container {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .diary-toolbar {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .diary-legend {
  background: #182234 !important;
  border-bottom-color: #334155 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .table-scroll-wrapper {
  background: #1e293b !important;
  scrollbar-color: #334155 #182234;
}

[data-theme="dark"] .table-scroll-wrapper::-webkit-scrollbar-track {
  background: #182234;
}

[data-theme="dark"] .table-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: #334155;
}

[data-theme="dark"] .diary-table thead tr:nth-child(2) th,
[data-theme="dark"] table th,
[data-theme="dark"] .diary-table thead th {
  background: #182234 !important;
  color: #e2e8f0 !important;
  border-bottom: 2px solid #334155 !important;
  border-right-color: #334155 !important;
  border-left-color: #334155 !important;
}

[data-theme="dark"] .th-day-column {
  background: #172554 !important;
  color: #93c5fd !important;
  border-right: 1px solid #1e3a8a !important;
}

[data-theme="dark"] .th-day-column:hover {
  background: #1e3a8a !important;
}

[data-theme="dark"] .th-day-column.th-day-inactive,
[data-theme="dark"] .th-day-column.th-day-feriado {
  background: #450a0a !important;
  color: #fca5a5 !important;
  border-right: 1px solid #7f1d1d !important;
}

[data-theme="dark"] .th-day-column.th-day-emenda {
  background: #2e1065 !important;
  color: #d8b4fe !important;
  border-right: 1px solid #581c87 !important;
}

/* Colunas Congeladas (Sticky) */
[data-theme="dark"] .sticky-col-num,
[data-theme="dark"] .sticky-col-name,
[data-theme="dark"] .sticky-col-status {
  background: #1e293b !important;
  color: #ffffff !important;
  border-right-color: #334155 !important;
}

[data-theme="dark"] .diary-table thead .sticky-col-num,
[data-theme="dark"] .diary-table thead .sticky-col-name,
[data-theme="dark"] .diary-table thead .sticky-col-status {
  background: #182234 !important;
  color: #e2e8f0 !important;
}

/* Linhas e Células da Tabela */
[data-theme="dark"] .diary-table tbody tr,
[data-theme="dark"] table tbody tr {
  background: #1e293b !important;
}

[data-theme="dark"] .diary-table tbody tr:nth-child(even),
[data-theme="dark"] table tbody tr:nth-child(even) {
  background: #1a2436 !important;
}

[data-theme="dark"] .diary-table tbody tr:nth-child(even) .sticky-col-num,
[data-theme="dark"] .diary-table tbody tr:nth-child(even) .sticky-col-name,
[data-theme="dark"] .diary-table tbody tr:nth-child(even) .sticky-col-status {
  background: #1a2436 !important;
}

[data-theme="dark"] .diary-table tbody tr:hover,
[data-theme="dark"] .diary-table tbody tr:hover .sticky-col-num,
[data-theme="dark"] .diary-table tbody tr:hover .sticky-col-name,
[data-theme="dark"] .diary-table tbody tr:hover .sticky-col-status,
[data-theme="dark"] table tr:hover td {
  background: #28374d !important;
}

[data-theme="dark"] .diary-table tbody tr.student-inactive {
  background: #182234 !important;
  opacity: 0.6;
}

[data-theme="dark"] .diary-table tbody td,
[data-theme="dark"] table td {
  border-bottom-color: #334155 !important;
  border-right-color: #334155 !important;
  border-left-color: #334155 !important;
  color: #ffffff !important;
}

/* ESCRITA DOS NOMES DOS ALUNOS EM BRANCO (#ffffff) */
[data-theme="dark"] .student-name-text,
[data-theme="dark"] .sticky-col-name,
[data-theme="dark"] .aluno-nome-text,
[data-theme="dark"] td.sticky-col-name,
[data-theme="dark"] .diary-table tbody td.sticky-col-name,
[data-theme="dark"] div[style*="font-weight: 700"][style*="color: #0f172a"],
[data-theme="dark"] td[style*="color: #0f172a"] {
  color: #ffffff !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .cell-attendance.status-empty {
  background-color: transparent !important;
  color: #475569 !important;
}

[data-theme="dark"] .cell-attendance.status-empty:hover {
  background-color: #243044 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .attendance-popover {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .attendance-popover-header {
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .popover-option-btn {
  color: #ffffff !important;
}

[data-theme="dark"] .popover-option-btn:hover {
  background: #243044 !important;
}

[data-theme="dark"] .grade-input {
  color: #ffffff !important;
  background: transparent !important;
}

[data-theme="dark"] .grade-input:hover {
  border-color: #475569 !important;
  background: #243044 !important;
}

[data-theme="dark"] .grade-input:focus {
  border-color: #3b82f6 !important;
  background: #243044 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .cell-final-average {
  background: inherit !important;
  color: #ffffff !important;
}

[data-theme="dark"] .final-average-badge,
[data-theme="dark"] .average-satisfactory,
[data-theme="dark"] .average-unsatisfactory {
  background: transparent !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

[data-theme="dark"] .average-empty {
  color: #94a3b8 !important;
}

/* Ficha Individual do Aluno */
[data-theme="dark"] .ficha-profile-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .ficha-student-bar {
  background: #182234 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .ficha-metric-box {
  background: #243044 !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .ficha-section-title {
  color: #ffffff !important;
  border-bottom-color: #334155 !important;
}

/* Badges e Tags */
[data-theme="dark"] .badge-neutral {
  background-color: #243044;
  color: #cbd5e1;
  border-color: #334155;
}

[data-theme="dark"] .badge-primary {
  background-color: #172554;
  color: #93c5fd;
  border-color: #1e40af;
}

[data-theme="dark"] .badge-success {
  background-color: #064e3b;
  color: #6ee7b7;
  border-color: #047857;
}

[data-theme="dark"] .badge-danger {
  background-color: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

[data-theme="dark"] .badge-warning {
  background-color: #451a03;
  color: #fde047;
  border-color: #78350f;
}

/* Ações em Massa */
[data-theme="dark"] .batch-actions-bar {
  background: linear-gradient(135deg, #450a0a, #7f1d1d);
  border-color: #991b1b;
}

[data-theme="dark"] .batch-actions-title {
  color: #fca5a5;
}
