/* RESET E VARIÁVEIS */
:root {
  --primary: #4f8cff;
  --primary-hover: #2563eb;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #facc15;
  --background: #dde6f3;
  --container-bg: rgba(255, 255, 255, 0.329); /* NOVA: fundo painel light */
  --card-bg: #fffffff3; /*|#fff*/
  --text: #222;
  --muted: #888;
  --border-radius: 22px;
  --shadow: 0 4px 24px rgba(80, 120, 200, 0.10);
  --input-bg: #f7f8fa;
  --input-border: #e5e7eb;
  --header-height: 64px;
  --transition: 0.18s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', Arial, sans-serif;
}

[data-theme="dark"] {
  --background: #1a1a1a;
  --container-bg: rgba(32, 46, 73, 0.308); /* NOVA: fundo painel dark */
  --card-bg: #23272fea;
  --text: #f3f3f3;
  --muted: #bbb;
  --input-bg: #23272f;
  --input-border: #333;
}

/* Dark mode: fundo, texto, inputs, botões, cards, modais */
[data-theme="dark"] {
  --background: #1a1a1a;
  --card-bg: #23272fe5;
  --text: #f3f3f3;
  --muted: #bbb;
  --input-bg: #23272fc2;
  --input-border: #333;
}

[data-theme="dark"] body {
  background: var(--background);
  color: var(--text);
}

[data-theme="dark"] .main-header {
  background: #23272ffb;
  backdrop-filter: blur(10px) !important;
  color: #fff;
}

[data-theme="dark"] .class-card {
  background: #23272fa2;
  backdrop-filter: blur(10px) !important;
  color: #f3f3f3;
  box-shadow: 0 8px 32px rgba(20,20,30,0.18);
}

[data-theme="dark"] .class-card .card-title {
  color: #f3f3f3;
}

[data-theme="dark"] .turmas-title {
  color: #f3f3f3;
}

[data-theme="dark"] .btn-primary {
  background: #2b313fa4;
  backdrop-filter: blur(10px) !important;
  color: #ffffffdc;
  border: 1.5px solid #444;
}

[data-theme="dark"] .btn-primary:hover {
  background: #181a1b42;
}

[data-theme="dark"] .btn-admin {
  background: #6198fdc0;
  color: #d3def2f0;
  border: 1.5px solid #444;
  backdrop-filter: blur(10px) !important;
}

[data-theme="dark"] .btn-admin:hover {
  background: #202629a4;
}

[data-theme="dark"] .input-search,
[data-theme="dark"] .modal-custom input[type="text"] {
  background: #23272f;
  color: #f3f3f3;
  border: 1.5px solid #333;
}

[data-theme="dark"] .input-search:focus,
[data-theme="dark"] .modal-custom input[type="text"]:focus {
  border-color: #4f8cff;
}

[data-theme="dark"] .modal-custom label {
  color: #f3f3f3;
}

[data-theme="dark"] .modal-custom.visual-modal {
  background: #23272fde;
  backdrop-filter: blur(10px) !important;
  color: #f3f3f3;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(20,20,30,0.7);
  backdrop-filter: blur(10px) !important;
}

[data-theme="dark"] .manage-students-list .btn {
  background: #374151 !important;
  color: #f3f3f3 !important;
  border-color: #4b5563 !important;
}
[data-theme="dark"] .manage-students-list .btn:hover {
  background: #4b5563 !important;
  color: #f3f3f3 !important;
}
.manage-students-list {
  max-height: 300px;
  overflow-y: auto;
}

/* RESET APARÊNCIA DOS ELEMENTOS */
select, textarea, input[type="range"], input[type="file"] { /*input[type="checkbox"] */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.manage-students-list .form-check-input:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}
.manage-students-list .form-check-input {
  border-radius: 8px;
  width: 1.2em;
  height: 1.2em;
}
.manage-students-list .form-check-label {
  margin-left: 0.5em;
  font-weight: 500;
}

/* Ícone do dark mode */
.icon-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: background 0.75s, box-shadow 0.75s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: visible;
  box-sizing: border-box;
  outline: none;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: stroke 0.18s, filter 0.18s;
  overflow: visible;
  display: block;
  margin: auto;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
}

.icon-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon-btn:hover {
  background: rgba(0,0,0,0.10);
  box-shadow: 0 2px 8px rgba(80,120,200,0.10);
}

.icon-btn[title="Voltar"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  margin-right: 0.5rem;
}

.icon-btn[title="Voltar"] svg {
  display: block;
  margin: 0 auto;
  width: 20px;
  height: 20px;
}

/* Menu de perfil do usuário */
.user-profile {
  position: relative;
}

.user-avatar {
  background: #222;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  min-width: 200px;
  display: none;
  z-index: 1000;
  border: 1px solid var(--input-border);
}

.user-menu.active {
  display: block;
  animation: menuIn 0.2s ease-out;
}

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

.user-menu-item {
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}

.user-menu-item:hover {
  background: var(--input-bg);
  border-radius: 12px;
}

.user-menu-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.user-menu-divider {
  height: 1px;
  background: var(--input-border);
  margin: 0.3rem 0;
}

[data-theme="dark"] .user-menu {
  background: #23272f;
  border-color: #333;
}

[data-theme="dark"] .user-menu-item:hover {
  background: #181a1b;
}

/* RESET BÁSICO */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* LAYOUT PRINCIPAL */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* FIX: Prevenir quadrados brancos na lateral */
html::before, html::after,
body::before, body::after,
.row::before, .row::after,
.container::before, .container::after,
.container-fluid::before, .container-fluid::after {
  display: none !important;
}

.main-header {
  position: sticky;
  top: -0.1px;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #23272f;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  padding: 0 2rem;
  width: 100%;
  margin: 0;
}

.content-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  margin: 0;
  z-index: auto;
}

.page-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem 5rem 1rem;
  padding-top: 0 !important;
  z-index: auto;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.main-footer {
  flex-shrink: 0;
  padding: 1.2rem 0 1.5rem 0;
  position: static !important;
  z-index: 0 !important;
  width: 100%;
  text-align: center;
  font-size: 1.05rem;
  margin-top: 0;
  border-top: none;
}

[data-theme="dark"] .main-footer {
  color: #fff !important;
}

/* TÍTULOS E CONTROLES */
.turmas-title {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem 0;
  color: var(--text);
  letter-spacing: -0.01em;
  text-align: center;
  max-width: 100%;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem 0;
  padding: 0;
}

.turmas-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.turmas-controls-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
@media (max-width: 900px) {
  .turmas-controls {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .turmas-controls-left {
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
  }
}

/* GRID DE CARDS */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin: 1rem auto;
  background-color: transparent !important;
}
@media (min-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* CARDS */
.class-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px) !important;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.5rem 1rem 1.5rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.2s, transform 0.18s;
  font-size: 1.08rem;
}

.class-card:hover {
  box-shadow: 0 8px 32px rgba(80,120,200,0.13);
  transform: translateY(-2px) scale(1.012);
}

.class-card .card-actions {
  position: static;
  gap: 0.4rem;
  margin-left: 0.5rem;
}

.class-card .card-actions .icon-btn {
  margin: 0 2px;
}

.class-card .card-title {
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  font-size: 1.18rem;
  font-weight: 700;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

.class-card .card-period {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

.class-card .card-students {
  color: var(--muted);
  font-size: 1.01rem;
  margin-top: 0.7rem;
  text-align: right;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

/* LOGO E CABEÇALHO */
.logo {
  width: 40px;
  height: 40px;
  margin-right: 0.4rem;
  object-fit: contain;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.school-name {
  font-weight: 600;
  color: #fff;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  margin-left: 0.05rem;
}

.header-left { display: flex; align-items: center; gap: 0.15rem; margin-left: 0.2rem; }
.header-right { display: flex; align-items: center; gap: 1rem; }

/* ÍCONES E BOTÕES */
.icon-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: background 0.75s, box-shadow 0.75s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: visible;
  box-sizing: border-box;
  outline: none;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: stroke 0.18s, filter 0.18s;
  overflow: visible;
  display: block;
  margin: auto;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
}

.icon-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon-btn:hover {
  background: rgba(0,0,0,0.10);
  box-shadow: 0 2px 8px rgba(80,120,200,0.10);
}

.icon-btn[title="Voltar"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  margin-right: 0.5rem;
}

.icon-btn[title="Voltar"] svg {
  display: block;
  margin: 0 auto;
  width: 20px;
  height: 20px;
}

/* BOTÕES PILL */
.btn-primary, .btn-admin, a.btn-primary, a.btn-admin {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.6rem;
  font-weight: 600;
  font-size: 1.08rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-radius 0.18s;
  box-shadow: 0 2px 8px rgba(80,120,200,0.07);
  text-decoration: none;
}
.btn-primary {
  background: #19202c;
  color: #fff;
}
.btn-primary:hover {
  background: #111827;
}
.btn-admin {
  background: #c7e0f7;
  color: #2563eb;
  margin-right: 0.7rem;
}
.btn-admin:hover {
  background: #b3d4f7;
}

/* INPUTS E BUSCA */
.input-search {
  background: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 2.5rem 0.7rem 1.2rem;
  font-size: 1.08rem;
  width: 100%;
  box-shadow: 0 2px 8px rgba(80,120,200,0.07);
  outline: none;
  color: var(--text);
  transition: border-color var(--transition);
  margin-bottom: 0;
  position: relative;
  height: 46px;
}

.input-search:focus {
  box-shadow: 0 4px 16px rgba(80,120,200,0.13);
}

.input-search-icon {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #b3b3b3;
  pointer-events: none;
  line-height: 1;
  height: 28px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-search-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Fix for white squares on sides */
.container, 
.container-fluid,
.row,
.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-sm, .col-md, .col-lg, .col-xl {
  background-color: var(--background) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .page-container {
    margin-top: 5px !important; /* Smaller spacing on mobile */
  }
}

/* Modal styling */
#visualModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: #f8f8f8e3;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(80,120,200,0.18);
  padding: 2rem;
  min-width: 340px;
  max-width: 95vw;
  min-height: 120px;
  max-height: 90vh;
  overflow-y: auto;
  display: none;
}

#visualModal.active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#modalBackdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.35);
  display: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  margin-bottom: 0.25rem;
  border-bottom: none;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  font-size: 1.7rem;
  line-height: 1;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0 0.5rem;
  box-shadow: none;
}

#visualForm {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

#visualForm label {
  font-weight: 600;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.5rem;
}

#visualForm input[type="text"] {
  margin-top: 0.01rem;
  width: 100%;
  background-color: var(--input-bg);
}

#visualForm input[type="color"] {
  margin-left: 1rem;
  vertical-align: middle;
}

#visualForm hr {
  border: none;
  border-top: 1px solid #ececec;
  margin: 0.2rem 0;
}

.switch-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2.5rem;
  margin: 1.2rem 0 1.2rem 0;
}

.switch-container > div {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.switch-container span {
  font-weight: 500;
  font-size: 1.01rem;
}

.preview-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.2rem 0 0.7rem 0;
  padding: 1.1rem 0.7rem;
  border-radius: 14px;
  background: var(--input-bg);
  min-height: 70px;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  text-overflow: ellipsis;
}

#logoPreview {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: none;
  display: block;
}

#schoolNamePreview {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0 0.7rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

#faviconPreview {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: none;
  display: block;
}

/* Remove any white background from container divs */
.container, .container-fluid, .row, .col, div[class^="col-"] {
  background-color: transparent !important;
}

/* Page header styles */
.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem 0;
  padding: 0;
}

.back-btn {
  background: rgba(36, 41, 51, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  border-radius: 50%;
  padding: 0.18rem 0.18rem;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  box-shadow: 0 2px 12px rgba(80,120,200,0.10);
  transition: background 0.18s, box-shadow 0.18s, filter 0.18s;
  border: none;
  opacity: 0.92;
  z-index: 2;
}

.back-btn:hover {
  background: rgba(36, 41, 51, 0.95);
  box-shadow: 0 4px 18px rgba(80,120,200,0.18);
  filter: brightness(1.08);
  opacity: 1;
}

.back-btn svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.5;
  stroke: #fff;
  display: block;
  margin: auto;
}

@media (max-width: 600px) {
  .back-btn {
    margin-left: 0;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
  }
}

/* Search container */
.search-container {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 350px;
}

/* Filter styles */
.turmas-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.01rem;
  color: var(--muted);
}

.turmas-filter select, .school-order-select {
  border-radius: 22px !important;
  background: #f7f8fa;
  border: 1.5px solid #549bf8 !important;
  font-weight: 600 !important;
  color: #1f65fc !important;
  box-shadow: 0 2px 8px rgba(80,120,200,0.07) !important;
  padding: 0.5rem 0.8rem !important;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  align-items: center;
}
[data-theme="dark"] .turmas-filter select, [data-theme="dark"] .school-order-select {
  background: #23272f !important;
  border: 1.5px solid #549bf8 !important;
  color: #1f65fc !important;
  padding: 0.5rem 0.8rem !important;
  position: relative;
}
.turmas-filter select:focus, .school-order-select:focus {
  border-color: #2563eb !important;
  background: #e0edff !important;
  color: #174ea6 !important;
}

@media (max-width: 900px) {
  .page-container {
    margin-top: 0 !important;
  }
  .turmas-title {
    font-size: 1.3rem;
    margin-top: 1.2rem;
  }
}

@media (max-width: 600px) {
  .back-btn {
    margin-left: 0;
  }
  .main-footer {
    position: static !important;
  }
}

/* MODAIS MODERNOS */
.modal-custom, .modal-content, .visual-modal, #visualModal {
  background: var(--card-bg) !important;
  border-radius: 22px !important;
  box-shadow: 0 8px 32px rgba(80,120,200,0.18);
  padding: 2.2rem 2.5rem 1.7rem 2.5rem;
  border: none;
  max-width: 480px;
  margin: auto;
}

.modal-header, .modal-footer {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.modal-close, .btn-close {
  font-size: 1.7rem;
  line-height: 1;
  background: none !important;
  border: none !important;
  color: #888 !important;
  cursor: pointer;
  padding: 0 0.5rem;
  box-shadow: none !important;
}

.modal-body, .modal-footer {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* INPUTS MODERNOS */

/*  ---   para checkbox usar esse css, subir e colocar no css que tira o padrão do navegador na linha 112
  input[type="checkbox"] {
  background: var(--input-bg);
  color: var(--text);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  padding: 0.5rem 1.1rem;
  box-shadow: 0 1px 4px rgba(80,120,200,0.07);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}
input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: #248bdf9f !important;
  color: #fff !important;
}
  */


input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="tel"], input[type="url"], input[type="search"], input[type="color"], input[type="file"], input[type="range"], .form-control, select, textarea, option {
  background: var(--input-bg);
  color: var(--text);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  padding: 0.5rem 1.1rem 0.5rem 1.1rem;
  font-size: 1.08rem;
  margin-top: 0.3rem;
  box-shadow: 0 1px 4px rgba(80,120,200,0.07);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  outline: none;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="date"]:focus, input[type="time"]:focus, input[type="datetime-local"]:focus, input[type="tel"]:focus, input[type="url"]:focus, input[type="search"]:focus, input[type="color"]:focus, input[type="file"]:focus, input[type="range"]:focus, .form-control:focus, select:focus, textarea:focus, option:focus {
  border-color: var(--primary);
  background: #f0f6ff;
}
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="color"],
[data-theme="dark"] input[type="file"],
[data-theme="dark"] input[type="range"],
[data-theme="dark"] textarea,
[data-theme="dark"] .form-control,
[data-theme="dark"] select,
[data-theme="dark"] option {
  background: #23272f;
  color: #f3f3f3;
  border: 1.5px solid #333;
}
[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="time"]:focus,
[data-theme="dark"] input[type="datetime-local"]:focus,
[data-theme="dark"] input[type="tel"]:focus,
[data-theme="dark"] input[type="url"]:focus,
[data-theme="dark"] input[type="search"]:focus,
[data-theme="dark"] input[type="color"]:focus,
[data-theme="dark"] input[type="file"]:focus,
[data-theme="dark"] input[type="range"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] option:focus {
  border-color: #4f8cff;
  background: #232a36;
  color: #f3f3f3;
}

label {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  display: block;
}

.input-modern {
  background: var(--input-bg);
  color: var(--text);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  padding: 0.5rem 1.1rem;
  font-size: 1.08rem;
  box-shadow: 0 1px 4px rgba(80,120,200,0.07);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}


/* BOTÕES MODERNOS */
.btn-primary, .btn-admin {
  border-radius: 999px !important;
  font-size: 1.08rem;
  font-weight: 600;
  padding: 0.7rem 2.2rem;
  margin-top: 0.5rem;
  box-shadow: 0 2px 8px rgba(80,120,200,0.07);
  transition: background 0.18s, color 0.18s;
}

/* BOTÃO DE UPLOAD CUSTOMIZADO */
.input-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}
.input-upload input[type="file"] {
  display: none;
}
.input-upload-label {
  background: var(--input-bg);
  color: var(--text);
  border: 1.5px solid var(--input-border);
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  font-size: 1.01rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border 0.18s;
  display: inline-block;
}
.input-upload-label:hover {
  background: #e6f0ff;
  border-color: var(--primary);
}
[data-theme="dark"] .input-upload-label {
  background: #23272f;
  color: #f3f3f3;
  border: 1.5px solid #333;
}
[data-theme="dark"] .input-upload-label:hover {
  background: #232a36;
  border-color: #4f8cff;
}

/* Espaçamento entre campos do modal */
.modal-body > label {
  margin-bottom: 0.2rem;
}
.modal-body > input,
.modal-body > .form-control,
.modal-body > select {
  margin-bottom: 0.7rem;
}

/* Modal dark mode */
[data-theme="dark"] .modal-custom, [data-theme="dark"] .modal-content, [data-theme="dark"] .visual-modal, [data-theme="dark"] #visualModal {
  background: #23272f !important;
  color: #f3f3f3 !important;
}

.modal-footer {
  flex-direction: row !important;
  gap: 1.2rem;
  justify-content: center !important;
  align-items: center !important;
}
@media (max-width: 700px) {
  .modal-footer {
    flex-direction: column !important;
    gap: 0.7rem;
  }
}

#editStudentModal .modal-dialog,
#newStudentModal .modal-dialog {
  display: flex;
  align-items: center;
  min-height: 100vh;
  justify-content: center;
}

#editStudentModal .modal-content,
#newStudentModal .modal-content {
  margin: auto;
}

#editTeacherModal .modal-dialog,
#newTeacherModal .modal-dialog {
  display: flex;
  align-items: center;
  min-height: 100vh;
  justify-content: center;
}

#editTeacherModal .modal-content,
#newTeacherModal .modal-content {
  margin: auto;
}

[data-theme="dark"] html,
[data-theme="dark"] body,
[data-theme="dark"] .main-footer,
[data-theme="dark"] .content-wrapper,
[data-theme="dark"] .page-container {
  background: var(--background) !important;
}

.icon-btn.active-presenca {
  background: #22c55e22;
  color: #22c55e !important;
  box-shadow: 0 0 0 2px #22c55e44;
}
.icon-btn.active-falta {
  background: #fee2e2;
  color: #dc2626 !important;
  box-shadow: 0 0 0 2px #f8717144;
}
.icon-btn.active-abono {
  background: #fef9c3;
  color: #b45309 !important;
  box-shadow: 0 0 0 2px #facc1544;
}

.card-description {
  max-height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  /*-webkit-line-clamp: 3;*/
  -webkit-box-orient: vertical;
  word-break: break-word;
  white-space: normal;
}

/* PRESENÇA - Botões maiores e alinhados */
.presenca-btn {
  min-width: 110px !important;
  font-size: 1.12em !important;
  padding: 0.55em 1.2em !important;
  margin-right: 0.3rem;
}
@media (max-width: 700px) {
  .presenca-btn {
    min-width: 90px !important;
    font-size: 1em !important;
    padding: 0.45em 0.7em !important;
  }
  .presenca-controls {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.7rem !important;
  }
  .presenca-search-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.7rem;
  }
}
.presenca-controls {
  margin-bottom: 1.2rem;
}
.presenca-search-container {
  margin-left: 1.2rem;
}
/* Cards: ícones na linha do checkbox, título abaixo */
.class-card .card-actions {
  position: static;
  gap: 0.4rem;
  margin-left: 0.5rem;
}
.class-card .card-title {
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  font-size: 1.18rem;
  font-weight: 700;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}
/* Centralizar modais verticalmente */
.modal-dialog-centered {
  display: flex !important;
  align-items: center !important;
  min-height: 100vh !important;
}

.presenca-btn#btnPresencaTodos {
  background: #22c55e !important;
  color: #fff !important;
}
.presenca-btn#btnFaltaTodos {
  background: #f87171 !important;
  color: #fff !important;
}
.presenca-btn#btnAbonoTodos {
  background: #facc15 !important;
  color: #b45309 !important;
}
@media (max-width: 700px) {
  .presenca-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.7rem !important;
  }
  .presenca-btn-group {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 0.2rem;
    margin-bottom: 0.7rem;
  }
  .presenca-btn {
    min-width: 110px !important;
    font-size: 1.13em !important;
    padding: 0.55em 1.2em !important;
  }
}
.presenca-btn-group {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  justify-content: flex-start;
}

.select-excluir-group, .conteudo-excluir-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 700px) {
  .select-excluir-group, .conteudo-excluir-group {
    width: 100%;
    justify-content: center !important;
    margin: 0.7rem 0 0.7rem 0;
  }
}
.card-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.7rem;
}

/* Centralização forçada dos modais */
.modal.show .modal-dialog {
  display: flex !important;
  align-items: center !important;
  min-height: 100vh !important;
}

/* Responsividade aba Conteúdos */
@media (max-width: 700px) {
  .conteudo-excluir-group, .select-excluir-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.7rem !important;
  }
  #btnNovoConteudo, #btnNovaAvaliacao {
    width: 100%;
    margin-bottom: 0.7rem;
    order: 1;
  }
  #searchConteudo, #searchAvaliacao {
    display: block !important;
    margin: 0.7rem auto 0.7rem auto !important;
    width: 100% !important;
    max-width: 320px !important;
    min-width: 0 !important;
    text-align: center;
    order: 2;
  }
  .select-todos-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    order: 3;
  }
  #btnExcluirSelecionadosConteudo, #btnExcluirSelecionadosAvaliacao {
    width: 100%;
    margin-bottom: 0.7rem;
    order: 4;
  }
}

/* Desktop: barra de pesquisa alinhada ao botão Excluir */
@media (min-width: 701px) {
  .conteudo-excluir-group, .select-excluir-group {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
  }
  #searchConteudo, #searchAvaliacao {
    margin-left: auto !important;
    max-width: 220px;
    min-width: 180px;
  }
}

/* Selecionar todos em negrito e alinhado */
.select-todos-group label, .select-excluir-group label, .conteudo-excluir-group label {
  font-weight: bold;
  margin-left: 0.4rem;
  display: inline-block;
  vertical-align: middle;
}
.select-todos-group, .select-excluir-group, .conteudo-excluir-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 700px) {
  /* Conteúdos e Avaliações - responsividade mobile */
  .conteudo-excluir-group, .select-excluir-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.7rem !important;
  }
  .select-todos-group, .select-excluir-group, .conteudo-excluir-group {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
  }
  .select-todos-group label, .select-excluir-group label, .conteudo-excluir-group label {
    font-weight: bold;
    margin-left: 0.4rem;
    display: inline-block;
    vertical-align: middle;
  }
  #btnNovoConteudo, #btnNovaAvaliacao {
    width: 100%;
    margin-bottom: 0.7rem;
    order: 3;
  }
  #searchConteudo, #searchAvaliacao {
    display: block !important;
    margin: 0.7rem auto 0.7rem auto !important;
    width: 100% !important;
    max-width: 320px !important;
    min-width: 0 !important;
    text-align: center;
    order: 4;
  }
}

/* Presença - botões maiores no mobile */
@media (max-width: 700px) {
  .presenca-btn {
    min-width: 130px !important;
    font-size: 1.22em !important;
    padding: 0.7em 1.4em !important;
  }
  .presenca-btn-group {
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 0.7rem !important;
  }
}

/* Centralizar título principal */
.turmas-title, h2[style*="Boas vindas à turma"] {
  text-align: center !important;
  width: 100%;
  display: block;
}

.school-order-select {
  border-radius: 22px !important;
  background: #f7f8fa !important;
  border: 1.5px solid #dbeafe !important;
  font-weight: 600 !important;
  color: #2563eb !important;
  box-shadow: 0 2px 8px rgba(80,120,200,0.07) !important;
  padding: 0.5rem 1.3rem !important;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}
.school-order-select:focus {
  border-color: #2563eb !important;
  background: #e0edff !important;
  color: #174ea6 !important;
}

.search-actions-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1.2rem 0 1.5rem 0;
  flex-wrap: wrap;
  justify-content: space-between;
}
@media (max-width: 700px) {
  .search-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .search-actions-bar .btn-admin {
    width: 100%;
    margin-left: 0;
  }
}

/* Estilização para o Select2 - ADICIONADO */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: var(--input-bg) !important;
  border: 1.5px solid var(--input-border) !important;
  border-radius: 12px !important;
  height: auto !important;
  min-height: 40px;
  padding: 0.3rem 0.6rem !important;
  color: var(--text) !important;
  transition: border-color 0.18s, background 0.18s;
  box-shadow: 0 1px 4px rgba(80,120,200,0.07) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important;
  line-height: 28px !important;
  padding-left: 0.5rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    color: var(--text) !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px !important;
  right: 10px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text) transparent transparent transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--text) transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: var(--primary) !important;
  background: var(--input-bg-focus) !important;
}

[data-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single,
[data-theme="dark"] .select2-container--default.select2-container--open .select2-selection--multiple {
    background: #232a36 !important;
    border-color: #4f8cff !important;
}

.select2-dropdown {
  background-color: var(--input-bg) !important;
  border: 1.5px solid var(--primary) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  box-shadow: 0 4px 15px rgba(80,120,200,0.15);
}

[data-theme="dark"] .select2-dropdown {
    background: #232a36 !important;
    border-color: #4f8cff !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary) !important;
  color: white !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #eef4ff !important;
    color: var(--text) !important;
}

[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #2c344a !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #2d3345 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary) !important;
    border: none !important;
    color: white !important;
    padding: 4px 10px !important;
    border-radius: 8px;
    font-size: 0.95rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
    margin-right: 5px;
    font-size: 1.2rem;
    line-height: 1;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #e0e0e0 !important;
}

/* Estilos para Edição de Avatar no Card de Presença */
.student-avatar-container {
    position: relative;
    width: 70px; /* Ajuste o tamanho conforme necessário */
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
}

.student-avatar-presenca {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    cursor: pointer;
    border-radius: 50%;
}

.student-avatar-container:hover .edit-avatar-overlay {
    opacity: 1;
}

.edit-avatar-overlay .edit-icon {
    width: 28px; /* Tamanho do ícone */
    height: 28px;
    stroke: white; /* Cor do ícone */
}

/* Estilos para Edição de Avatar no Card de Presença */
.profile-pic-container {
    position: relative;
    width: 100%; /* Ocupa a largura do contêiner pai */
    height: 100%; /* Ocupa a altura do contêiner pai */
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%; /* Garante que a imagem seja redonda */
}

.edit-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    cursor: pointer;
    border-radius: 50%;
}

.profile-pic-container:hover .edit-avatar-overlay {
    opacity: 1;
}

.edit-avatar-overlay .edit-icon {
    width: 28px; /* Tamanho do ícone */
    height: 28px;
    stroke: white; /* Cor do ícone */
}

.card-period,
.card-info,
.card-title,
.card-students,
.card-email,
.card-status {
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

.card-period,
.card-students {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Sistema de Notificações */
.notification-container {
  position: relative;
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card-bg);
  min-width: 18px;
  padding: 0;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 380px;
  max-height: 500px;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 8px;
}

.notification-dropdown.show {
  opacity: 0.925;
  backdrop-filter: blur(10px) !important;
  visibility: visible;
  transform: translateY(0);
}

.notification-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--input-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.notification-actions {
  display: flex;
  gap: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

.btn-link.text-danger:hover {
  color: #dc2626;
}

.notification-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0;
}

.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--input-border);
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.notification-item.unread {
  background-color: rgba(79, 140, 255, 0.05);
}

.notification-item.unread:hover {
  background-color: rgba(79, 140, 255, 0.08);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.notification-message {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 6px;
  word-wrap: break-word;
}

.notification-time {
  color: var(--muted);
  font-size: 11px;
  opacity: 0.8;
}

.notification-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 8px;
  border-radius: 9999px;
  margin-left: 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification-delete:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-hover);
  transform: scale(1.1);
}

.notification-delete svg {
  width: 24px;
  height: 24px;
  stroke: var(--danger);
  transition: all 0.2s ease;
  margin-top: 2px;
}

/* Dark mode para notificações */
[data-theme="dark"] .notification-dropdown {
  background: var(--card-bg);
  border-color: var(--input-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .notification-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .notification-item.unread {
  background-color: rgba(79, 140, 255, 0.1);
}

[data-theme="dark"] .notification-item.unread:hover {
  background-color: rgba(79, 140, 255, 0.15);
}

[data-theme="dark"] .notification-delete:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* Modal de Confirmação Personalizado */
.custom-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.custom-confirm-modal.show {
  opacity: 1;
  visibility: visible;
}

.custom-confirm-content {
  background: #f8f8f8e3;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.custom-confirm-modal.show .custom-confirm-content {
  transform: scale(1);
}

.custom-confirm-header {
  padding: 20px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-confirm-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.custom-confirm-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.custom-confirm-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.custom-confirm-body {
  padding: 16px 24px;
}

.custom-confirm-body p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.custom-confirm-footer {
  padding: 0 24px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-secondary {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--input-border);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: 1px solid var(--danger);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Dark mode para modal de confirmação */
[data-theme="dark"] .custom-confirm-content {
  background: var(--card-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .custom-confirm-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-secondary {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--input-border);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--input-border);
}

/* Responsividade para notificações */
@media (max-width: 480px) {
  .notification-dropdown {
    width: calc(100vw - 40px);
    right: -10px;
    max-width: 320px;
  }
  
  .notification-header {
    padding: 12px 16px;
  }
  
  .notification-item {
    padding: 12px 16px;
  }
  
  .notification-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .custom-confirm-content {
    width: 95%;
    margin: 20px;
  }
  
  .custom-confirm-header,
  .custom-confirm-body,
  .custom-confirm-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .notification-badge {
    width: 16px;
    height: 16px;
    font-size: 10px;
    top: -3px;
    right: -3px;
  }
}

@media (max-width: 600px) {
  .notification-dropdown {
    position: fixed !important;
    top: 17% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 98vw !important;
    max-width: 98vw !important;
    min-width: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.18) !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1200 !important;
  }
  body {
    overflow-x: hidden !important;
  }
  .notification-dropdown.show {
    position: fixed !important;
    top: 10em !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* Modo escuro e scroll para sugestões de alunos */
[data-theme="dark"] .sugestoesAlunosBusca,
[data-theme="dark"] .sugestoesAlunosBusca * {
  background: #333946b9 !important;
  color: #f3f3f3d8 !important;
  border: none !important;
}
[data-theme="dark"] .sugestoesAlunosBusca:hover,
[data-theme="dark"] .sugestoesAlunosBusca *:hover {
  background: #3c475fb9 !important;
  color: #f3f3f3d8 !important;
  border: none !important;
}
.sugestoesAlunosBusca {
  max-height: 180px;
  overflow-y: auto;
  border-radius: 8px;
  padding: 2px 0;
}

.modal-backdrop.show {
  backdrop-filter: blur(6px) !important;
  z-index: 1050 !important;
}

[data-theme="dark"] .aluno-chip,
[data-theme="dark"] .select2-selection__choice {
  background: #2563eb !important;
  color: #fff !important;
  border: none !important;
}
[data-theme="dark"] .aluno-chip:hover,
[data-theme="dark"] .select2-selection__choice:hover {
  background: #1d4ed8 !important;
  color: #fff !important;
}
.alunos-adicionados-list {
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
} 



.turmas-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}
.turmas-controls-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}
.turmas-filter {
  min-width: 140px;
  max-width: 200px;
  flex: 1 1 140px;
}
@media (max-width: 900px) {
  .turmas-controls-left {
    flex-wrap: wrap;
    gap: 0.15rem;
  }
  .turmas-filter {
    min-width: 120px;
    max-width: 100%;
    flex: 1 1 100%;
  }
}
@media (max-width: 600px) {
  .turmas-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .turmas-controls-left {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .turmas-filter {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  #newClassBtn {
    width: 100%;
    margin-top: 0.7rem;
  }
}
/* Ajuste visual dos selects para modo escuro */
body.dark .form-control, body.dark select, body.dark .select2-container--default .select2-selection--single {
  background:rgb(32, 38, 58);
  color: #f3f3f3;
  border-radius: 0.3rem !important;
}
body.dark .select2-container--default .select2-selection--single {
  background:rgba(24, 24, 27, 0.86) !important;
  color: #f3f3f3 !important;
  border-color: #333 !important;
  border-radius: 0.3rem !important;
}
body.dark .select2-container--default .select2-selection--multiple {
  background:rgba(24, 24, 27, 0.86) !important;
  color: #f3f3f3 !important;
  border-color: #333 !important;
  border-radius: 0.3rem !important;
}
body.dark .select2-dropdown {
  background: #23232a !important;
  color: #f3f3f3 !important;
  border-radius: 0.3rem !important;
}
body.dark .select2-results__option {
  background: #23232a !important;
  color: #f3f3f3 !important;
  border-radius: 0.3rem !important;
}

/* ========================================= */
/* PASSWORD EYE ICON - UNIVERSAL STYLES     */
/* ========================================= */

/* Password Eye Icon - Versão melhorada e mais elegante */
/* Desabilitar APENAS os ícones visuais nativos, preservando funcionalidades */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-strong-password-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Configurações para remover apenas aparências visuais */
input[type="password"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-text-security: disc !important;
}

/* Especificamente para ícones de revelação visual */
input[type="password"]::-webkit-inner-spin-button,
input[type="password"]::-webkit-outer-spin-button,
input[type="password"]::-webkit-search-decoration,
input[type="password"]::-webkit-search-cancel-button,
input[type="password"]::-webkit-search-results-button,
input[type="password"]::-webkit-search-results-decoration {
  display: none !important;
  -webkit-appearance: none !important;
}

/* Para Firefox - apenas ícone de revelação */
input[type="password"]::-moz-reveal {
  display: none !important;
}

/* Garantir que campos em modais também não tenham ícones visuais nativos */
.modal input[type="password"]::-ms-reveal,
.modal input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none !important;
}

/* Preservar funcionalidade de autocomplete - IMPORTANTE */
input[type="password"]:-webkit-autofill,
input[type="password"]:-webkit-autofill:hover,
input[type="password"]:-webkit-autofill:focus {
  -webkit-text-fill-color: inherit !important;
  -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

.input-eye {
  position: absolute;
  right: 18px;
  top: 70%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: all 0.3s ease;
  padding: 4px;
  border-radius: 6px;
}

.input-eye:hover {
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-50%) scale(1.05);
}

.input-eye.visible {
  opacity: 1;
}

.input-eye svg {
  stroke: #6b7280;
  transition: all 0.3s ease;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.input-eye:hover svg {
  stroke: #2563eb;
}

.input-eye.showing svg {
  stroke: #2563eb;
  filter: drop-shadow(0 1px 3px rgba(37, 99, 235, 0.3));
}

[data-theme="dark"] .input-eye svg {
  stroke: #9ca3af;
}

[data-theme="dark"] .input-eye:hover {
  background: rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .input-eye:hover svg {
  stroke: #60a5fa;
}

[data-theme="dark"] .input-eye.showing svg {
  stroke: #60a5fa;
  filter: drop-shadow(0 1px 3px rgba(96, 165, 250, 0.3));
}

[data-theme="dark"] input[type="password"]:focus {
  color: #fff !important;
  background: #232a36 !important;
}

/* Ensure parent container has relative positioning for password fields */
.password-container {
  position: relative;
}

/* ========================================= */
/* MODAL STYLES - UNIVERSAL                  */
/* ========================================= */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--card-bg);
  margin: 15% auto;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 480px;
  text-align: center;
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal h3 {
  margin: 0 0 1rem 0;
  color: var(--text);
  font-weight: 600;
}

.modal p {
  margin: 0 0 1.5rem 0;
  color: var(--text);
  line-height: 1.5;
}

.modal .btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.modal .btn-success {
  background: #22c55e;
  color: white;
}

.modal .btn-success:hover {
  background: #16a34a;
}

.modal .btn-danger {
  background: #ef4444;
  color: white;
}

.modal .btn-danger:hover {
  background: #dc2626;
}

.modal .btn-warning {
  background: #f59e0b;
  color: white;
}

.modal .btn-warning:hover {
  background: #d97706;
}