:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.75);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-focus: rgba(99, 102, 241, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-accent: #6366f1;
  --color-accent-hover: #4f46e5;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, #6366f1, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tabs Navigation */
.tab-navigation {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

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

.tab-btn.active {
  color: #fff;
  background: var(--color-accent);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

/* Sub-Tabs Navigation (Gestão de Docentes - Design Moderno & Elegante) */
.sub-tab-navigation {
  display: flex;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.subtab-btn {
  flex: 1;
  min-width: 150px;
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  outline: none;
  font-family: inherit;
  white-space: nowrap;
}

.subtab-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.subtab-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border-color: #818cf8 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

.teacher-subtab-content,
.room-subtab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.teacher-subtab-content.active,
.room-subtab-content.active {
  display: block;
}

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

/* Botões */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--color-danger);
  color: var(--text-primary);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Grid de KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
}

.card-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-value {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

.value-success { color: var(--color-success); }
.value-warning { color: var(--color-warning); }

/* Seções Principais */
.main-sections {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .main-sections {
    grid-template-columns: 1fr;
  }
}

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

/* Formulários */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.form-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-control {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: 0.4rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.badge-subject {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.checkbox-group input {
  accent-color: var(--color-accent);
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

/* Drag and Drop Zone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: 0.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-accent);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.01);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

/* Matriz de Restrições Horárias */
.matrix-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.matrix-grid {
  display: grid;
  grid-template-columns: 85px repeat(5, 1fr);
  gap: 0.45rem;
  min-width: 600px;
}

.matrix-header {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.matrix-header-clickable {
  cursor: pointer;
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.matrix-header-clickable:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.matrix-shift-divider {
  grid-column: 1 / -1;
  font-weight: 700;
  font-size: 0.82rem;
  color: #818cf8;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  padding: 0.55rem 0.85rem;
  margin-top: 0.65rem;
  margin-bottom: 0.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.matrix-shift-divider:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0.12) 100%);
  border-color: rgba(99, 102, 241, 0.6);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.matrix-slot-label {
  font-weight: 700;
  font-size: 0.78rem;
  color: #c7d2fe;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5rem;
  padding: 0.3rem 0.4rem;
  line-height: 1.25;
}

.matrix-slot-time {
  font-size: 0.7rem;
  font-weight: 400;
  color: #94a3b8;
}

.matrix-cell {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 0.5rem;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #6ee7b7;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.matrix-cell:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3), 0 0 10px rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.6);
}

.matrix-cell.selected {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.24) 0%, rgba(239, 68, 68, 0.12) 100%);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(239, 68, 68, 0.15);
}

.matrix-cell.selected:hover {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3), 0 0 12px rgba(239, 68, 68, 0.35);
}

/* Painel de Estatísticas do Docente */
.teacher-stats-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
}

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

.stat-item-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

/* Botões de Ação Rápida */
.btn-quick-action {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-quick-action:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-quick-alt {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.btn-quick-alt:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #ffffff;
}

.btn-quick-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.btn-quick-success:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

.btn-quick-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-quick-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* Tabela */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

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

tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Seção de Auditoria e Extrato - Tipografia Reduzida em 50% nos Dados */
.auctions-card .section-title {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

.auctions-card .table-container {
  max-height: 420px;
  overflow-y: auto;
}

.auctions-card .table-container::-webkit-scrollbar {
  width: 6px;
}

.auctions-card .table-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

.auctions-card .table-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}

.auctions-card .table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

.auctions-table th {
  font-size: 0.8rem;
  padding: 0.6rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auctions-table tbody td {
  font-size: 0.53rem;
  padding: 0.25rem 0.4rem;
  line-height: 1.2;
}

.auctions-table tbody td strong,
.auctions-table tbody td span {
  font-size: inherit;
}

.auctions-table tbody .status-badge {
  font-size: 0.48rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* Seção de Relatórios: 25% de aumento no tamanho das fontes de dados (0.53rem -> 0.66rem, badges 0.48rem -> 0.60rem) */
#reports-tab .auctions-table tbody td {
  font-size: 0.66rem;
  padding: 0.35rem 0.5rem;
}

#reports-tab .auctions-table tbody .status-badge {
  font-size: 0.60rem;
  padding: 0.15rem 0.4rem;
}

#reports-tab .auctions-table tbody td strong,
#reports-tab .auctions-table tbody td span {
  font-size: inherit;
}

/* Preserva o tamanho da fonte da coluna 'Disciplinas & Horários Alocados' */
#reports-tab .alloc-badge-tag {
  font-size: 0.78rem !important;
}

/* Painel de Controle e Status */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-bar-container {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  height: 0.75rem;
  overflow: hidden;
  margin-top: 0.5rem;
  display: none;
}

.progress-bar {
  background: linear-gradient(to right, #6366f1, #10b981);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-queued { background-color: rgba(245, 158, 11, 0.2); color: var(--color-warning); }
.status-running { background-color: rgba(99, 102, 241, 0.2); color: var(--color-accent); }
.status-completed { background-color: rgba(16, 185, 129, 0.2); color: var(--color-success); }

/* Toasts de Notificação */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  min-width: 280px;
  padding: 0.9rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideInRight 0.3s forwards;
  font-size: 0.9rem;
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-danger { border-left: 4px solid var(--color-danger); }
.toast-warning { border-left: 4px solid var(--color-warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal de Confirmação */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  max-width: 480px;
  width: 90%;
  padding: 1.5rem;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.modal-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Shimmer Loading (Skeleton) */
.shimmer {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: 0.25rem;
  height: 1.25rem;
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Botões Secundários e Estilos de Impressão */
.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }
  header, .tab-navigation, button, .status-badge {
    display: none !important;
  }
  .card {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    color: #000000 !important;
  }
}

/* Form Controls e Badges de Alocação */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-control {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--border-color-focus);
}

.alert-warning-badge {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Multi-selection Pills de Sub-Slots de Aula */
.subslot-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.subslot-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.subslot-pill:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.subslot-pill.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.subslot-pill.active:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

/* Custom Checkbox Grid based on mcheckbox.png */
.subslot-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 1.1rem 1.5rem;
  border-radius: 1rem;
  border: 2px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mcheckbox-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  padding: 0.35rem 0.6rem;
  border-radius: 0.4rem;
}

.mcheckbox-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.mcheckbox-item.checked {
  color: #ffffff;
}

.mcheckbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.mcheckbox-box {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background-color: rgba(15, 23, 42, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
  box-sizing: border-box;
}

.mcheckbox-item:hover .mcheckbox-box {
  border-color: var(--color-accent);
}

.mcheckbox-item.checked .mcheckbox-box,
.mcheckbox-item input[type="checkbox"]:checked + .mcheckbox-box {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.mcheckbox-item.checked .mcheckbox-box::after,
.mcheckbox-item input[type="checkbox"]:checked + .mcheckbox-box::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
  display: block;
}

.mcheckbox-label {
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.mcheckbox-label strong {
  font-weight: 700;
  color: var(--text-primary);
}

.mcheckbox-time {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}

.badge-subslot-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 1rem;
  transition: all 0.2s ease;
}

/* Widget Guia Interativo e Flutuante de IA */
.ai-guide-widget {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 1px rgba(255, 255, 255, 0.2);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  user-select: none;
}

.ai-guide-widget.dragging {
  box-shadow: 0 18px 40px rgba(99, 102, 241, 0.3);
}

.ai-guide-header {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: grab;
}

.ai-guide-header:active {
  cursor: grabbing;
}

.ai-guide-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-guide-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-font-scale {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-font-scale:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
}

.btn-close-guide {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 0.25rem;
}

.btn-close-guide:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

.ai-guide-body {
  padding: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  user-select: text;
  transition: font-size 0.15s ease;
}

.ai-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.ai-guide-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.9rem;
}

.ai-guide-card-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================
   ESTILOS DA LANDING PAGE E AUTENTICAÇÃO
   ========================================== */

.landing-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 3rem;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-logo h2 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.landing-nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.landing-nav-links a:hover {
  color: #fff;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-landing-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-landing-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-landing-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s;
}

.btn-landing-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 3rem 1rem 4rem;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -1px;
}

.hero-title span {
  background: linear-gradient(135deg, #818cf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.hero-stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.hero-stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
}

.hero-stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 0.35rem;
}

.hero-stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Features Grid */
.features-section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.features-section,
#recursos,
#diferenciais {
  scroll-margin-top: 80px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 140px;
}

.feature-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: inline-block;
  align-self: flex-start;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.feature-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #fff;
  line-height: 1.35;
}

.feature-card h4:last-child {
  margin-bottom: 0;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.55;
}

#recursos .section-header p,
#recursos .feature-card p,
#diferenciais .section-header p,
#diferenciais .feature-card p,
.hero-subtitle,
.footer-desc-secondary {
  display: none !important;
}

/* Landing Footer */
.landing-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Modais de Autenticação */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.auth-modal-box {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  width: 100%;
  max-width: 440px;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
}

.auth-modal-header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.auth-modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.auth-modal-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.auth-form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.auth-form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.auth-btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.auth-btn-submit:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

.auth-switch-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1.25rem;
}

.auth-switch-text a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch-text a:hover {
  text-decoration: underline;
}

.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.35rem;
}

.auth-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: none;
}

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

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

/* User Badge Header */
.user-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-role-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-gestor {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.role-coordenador {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.role-docente {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.role-doctor-chef {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.tenant-status-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tenant-status-online {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tenant-status-offline {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.tenant-status-provisioning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ======================================================== */
/* GESTÃO DE USUÁRIOS & RBAC (TOOLBAR, BADGES, MODAIS CRUD) */
/* ======================================================== */

.users-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.users-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.users-search-input {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  min-width: 220px;
  outline: none;
  transition: all 0.2s;
}

.users-search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.users-filter-select {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.users-filter-select:focus {
  border-color: var(--color-accent);
}

.badge-teacher-linked {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-teacher-na {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge-lgpd-force {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-left: 0.35rem;
}

.credential-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
  font-family: monospace;
  font-size: 1.15rem;
  color: #a5b4fc;
  letter-spacing: 1px;
  word-break: break-all;
  user-select: all;
}







