/* ==========================================================================
   SISTEMA DE CHAMADA ESCOLAR - DESIGN SYSTEM MODERNO & RESPONSIVO
   ========================================================================== */

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

:root {
  /* Cores Principais */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --primary-dark: #1d4ed8;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  
  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --success-dark: #047857;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --danger-dark: #b91c1c;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-dark: #b45309;

  --info: #06b6d4;
  --info-light: #ecfeff;

  /* Neutros e Backgrounds */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #93c5fd;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  /* Sombras e Elevação */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);

  /* Bordas e Espaçamentos */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Fontes */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Global e Compatibilidade Safari */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header & Navbar */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.nav-brand .brand-badge {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

.nav-mobile-toggle {
  display: none;
}

.nav-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.925rem;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-color);
}

.user-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
}

.user-tag .role-admin {
  color: var(--accent);
}

/* Menu Dropdown de Navegação e Usuário */
.nav-dropdown-wrapper,
.user-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.925rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-tag-btn .role-admin {
  color: var(--accent);
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active,
.user-tag-btn:hover,
.nav-dropdown-wrapper.open .nav-dropdown-toggle,
.user-dropdown-wrapper.open .user-tag-btn {
  color: var(--primary);
  background: var(--primary-light);
  border-color: rgba(59, 130, 246, 0.2);
}

.dropdown-arrow {
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
  opacity: 0.7;
}

.nav-dropdown-wrapper.open .dropdown-arrow,
.user-dropdown-wrapper.open .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu,
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.nav-dropdown-wrapper .nav-dropdown-menu {
  left: 0;
  right: auto;
}

.nav-dropdown-wrapper.open .nav-dropdown-menu,
.user-dropdown-wrapper.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header-info {
  padding: 0.5rem 0.75rem 0.35rem 0.75rem;
  display: flex;
  flex-direction: column;
}

.dropdown-header-info strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.dropdown-header-info small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 0.35rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Cards & Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.925rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: var(--success-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  padding: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}

/* Formulários */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
}

.form-control, .form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1.1rem;
}

.search-input-wrapper .form-control {
  padding-left: 2.75rem;
  padding-right: 2.5rem;
  font-size: 1.05rem;
  height: 52px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.search-clear-btn {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  display: none;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger-dark);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning-dark);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-subtle {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* Grids e Métricas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-info .stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-info .stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

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

.custom-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

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

.custom-table tr:hover td {
  background: #f8fafc;
}

/* ==========================================================================
   LISTA DE ALUNOS NO PAINEL DO GESTOR (1 LINHA POR ALUNO)
   ========================================================================== */
.alunos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.aluno-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  min-height: 58px;
}

.aluno-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.aluno-card.status-chamado {
  background: #f8fafc;
  border-left: 4px solid var(--success);
}

.aluno-card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.aluno-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aluno-card.status-chamado .aluno-avatar {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: var(--success-dark);
}

.aluno-details {
  flex: 1;
  min-width: 0;
}

.aluno-nome {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.aluno-subinfo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aluno-sala-badge {
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.aluno-resp-badge {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.aluno-card-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.aluno-status-badge {
  font-size: 0.8rem;
}

.aluno-actions .btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

/* Modais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition-normal);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Notificações / Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.925rem;
  font-weight: 600;
  min-width: 280px;
  max-width: 420px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all var(--transition-fast);
}

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

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

.toast-info {
  border-left: 4px solid var(--primary);
  color: var(--text-main);
}

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

/* ==========================================================================
   TELA DA SALA (PROJETOR / SMART TV / SMARTPHONE / WEB)
   ========================================================================== */
.sala-body {
  background: #090d16;
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sala-topbar {
  background: rgba(15, 23, 42, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Estilos de botões de filtro no tema escuro (Monitor e Sala) */
.sala-body .btn-sala-filter {
  -webkit-appearance: none;
  appearance: none;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}

.sala-body .btn-sala-filter:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.sala-body .btn-sala-filter.active,
.sala-body .btn-sala-filter.btn-primary {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

.sala-brand-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sala-badge-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  flex-shrink: 0;
}

.sala-title-wrap {
  display: flex;
  flex-direction: column;
}

.sala-title-main {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.sala-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
}

.sala-status-clock {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.sala-controls-group {
  display: flex;
  gap: 0.5rem;
}

.digital-clock {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  padding: 0.2rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sala-pills-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}

.sala-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
}

.sala-validity-pill {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.sala-content-area {
  flex: 1;
  padding: 1.75rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Banner de Cabeçalho dos Chamados */
.sala-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.85rem;
}

.sala-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sala-header-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
}

.sala-counter-badge {
  font-size: 0.95rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.sala-header-hint {
  color: #94a3b8;
  font-size: 0.85rem;
}

.sala-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: rgba(30, 41, 59, 0.35);
  border-radius: var(--radius-xl);
  border: 2px dashed rgba(255, 255, 255, 0.1);
}

.sala-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 0.85rem;
  opacity: 0.85;
}

.sala-empty-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: #f1f5f9;
}

.sala-empty-desc {
  font-size: 1.05rem;
  color: #94a3b8;
  max-width: 550px;
  margin: 0 auto;
}

/* Lista de Alunos Chamados (1 LINHA POR ALUNO) */
.sala-chamados-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sala-chamado-card {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: cardPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-height: 60px;
}

@keyframes cardPopIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sala-chamado-card.is-new {
  border-color: #10b981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.45);
  animation: pulseNew 2s infinite;
}

@keyframes pulseNew {
  0%, 100% { border-color: #10b981; }
  50% { border-color: #38bdf8; }
}

.sala-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.sala-aluno-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
  flex-shrink: 0;
  overflow: hidden;
}

.sala-aluno-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.sala-aluno-avatar img,
.aluno-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.sala-card-body {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  margin-left: auto;
}

.sala-aluno-turma {
  font-size: 0.85rem;
  font-weight: 700;
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.sala-aluno-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.sala-card-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.sala-aluno-time {
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.sala-time-ago {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.sala-aluno-destaque {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

/* Card Status: Pendente de Saída da Sala (Borda Vermelha) */
.sala-chamado-card.status-pendente-sala {
  border: 2px solid #ef4444 !important;
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.12) 0%, #0f172a 100%) !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

/* Card Status: Já Saiu da Sala (Borda Verde) */
.sala-chamado-card.status-saiu-sala {
  border: 2px solid #22c55e !important;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.12) 0%, #0f172a 100%) !important;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
  opacity: 0.85;
}

/* Animação Shake para alertas com mais de 30 segundos pendentes */
@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-7px); }
  30%, 60%, 90% { transform: translateX(7px); }
}

.sala-chamado-card.shake-alert {
  animation: shakeAlert 1.2s infinite ease-in-out !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.7) !important;
}

/* Botão Marcar como Saiu */
.btn-marcar-saiu {
  background: #22c55e;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.15s, background-color 0.15s;
}

.btn-marcar-saiu:hover {
  background: #16a34a;
  transform: scale(1.03);
}

.btn-desfazer-saiu {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-desfazer-saiu:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ==========================================================================
   RESPONSIVIDADE PARA SMARTPHONE (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Navbar Hambúrguer Mobile */
  .nav-container {
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    position: relative;
  }
  
  .nav-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .nav-mobile-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
  }

  .nav-menu-wrapper {
    display: none;
    width: 100%;
  }

  .nav-menu-wrapper.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--shadow-xl);
    padding: 1rem 1.25rem;
    gap: 0.85rem;
    z-index: 100;
  }

  .nav-menu-wrapper.mobile-open .nav-links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.35rem;
  }

  .nav-menu-wrapper.mobile-open .nav-link,
  .nav-menu-wrapper.mobile-open .nav-dropdown-toggle {
    width: 100%;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .nav-menu-wrapper.mobile-open .nav-dropdown-wrapper {
    width: 100%;
  }

  .nav-menu-wrapper.mobile-open .nav-dropdown-toggle {
    justify-content: space-between;
  }

  .nav-menu-wrapper.mobile-open .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 1px solid var(--border-color);
    margin-top: 0.35rem;
    display: none;
    width: 100%;
  }

  .nav-menu-wrapper.mobile-open .nav-dropdown-wrapper.open .nav-dropdown-menu {
    display: block;
  }

  .nav-menu-wrapper.mobile-open .nav-user {
    width: 100%;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-top: 0.85rem;
    margin-top: 0.25rem;
  }

  .nav-menu-wrapper.mobile-open .user-dropdown-wrapper {
    width: 100%;
  }

  .nav-menu-wrapper.mobile-open .user-tag-btn {
    width: 100%;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
  }

  /* Gestor e Alunos (1 Linha Compacta em Mobile) */
  .aluno-card {
    padding: 0.6rem 0.75rem;
    min-height: 52px;
    gap: 0.5rem;
  }

  .aluno-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .aluno-nome {
    font-size: 0.95rem;
  }

  .aluno-subinfo {
    font-size: 0.725rem;
    gap: 0.35rem;
  }

  .aluno-card-right {
    gap: 0.4rem;
  }

  .badge-text-chamado,
  .badge-text-aguardando {
    display: none;
  }

  .aluno-actions .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }

  /* Tela da Sala no Smartphone */
  .sala-topbar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
  }

  .sala-brand-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
  }

  .sala-badge-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .sala-title-main {
    font-size: 1.3rem;
  }

  .sala-subtitle {
    font-size: 0.75rem;
  }

  .sala-status-clock {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sala-controls-group {
    display: flex;
    gap: 0.35rem;
    align-items: center;
  }

  .sala-controls-group .btn-label {
    display: none;
  }

  .sala-controls-group .btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
  }

  .digital-clock {
    font-size: 1.25rem;
    padding: 0.15rem 0.6rem;
  }

  .sala-pills-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.1rem;
  }

  .sala-sync-pill, .sala-validity-pill {
    font-size: 0.725rem;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
  }

  .sala-content-area {
    padding: 1rem;
  }

  .sala-header-bar {
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
  }

  .sala-header-title {
    font-size: 1.15rem;
  }

  .sala-header-hint {
    display: none;
  }

  /* Layout de Smartphone do Card do Aluno */
  .sala-chamado-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    min-height: auto;
  }

  .sala-card-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
  }

  .sala-aluno-avatar {
    width: 70px !important;
    height: 70px !important;
    font-size: 1.5rem !important;
    flex-shrink: 0 !important;
  }

  .sala-aluno-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
  }

  .sala-aluno-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2;
    margin: 0;
  }

  .sala-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
    margin-left: 0;
  }

  /* Linha 2: Classe / Turma */
  .sala-aluno-turma {
    font-size: 0.85rem;
    font-weight: 700;
    color: #60a5fa;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
  }

  /* Linha 3: Chamado: HORA */
  .sala-aluno-time {
    font-size: 0.85rem;
    font-weight: 700;
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
  }

  .sala-time-ago {
    font-size: 0.8rem;
    color: #94a3b8;
    display: inline;
  }

  /* Linha 4: Botão de Marcar / Ação */
  .sala-card-action {
    width: 100%;
    margin-top: 0.25rem;
  }

  .btn-marcar-saiu {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
  }

  .btn-marcar-saiu .btn-text {
    display: inline !important;
  }

  .btn-desfazer-saiu {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .badge-text-saiu {
    display: inline !important;
  }
}

