/* ============================================================
   styles/index.css — CAFA Emp — Sistema de Avaliação
   Cores Primárias: Laranja Escuro (#D9531E / #E65100), Branco (#FFFFFF) e Preto (#0C0C0E / #16161A)
   ============================================================ */

:root {
  --bg-main: #0c0c0e;
  --bg-card: #16161a;
  --bg-card-hover: #1e1e24;
  --bg-input: #1a1a20;
  --bg-sidebar: #121216;
  --border-color: #272730;
  --border-light: rgba(255, 255, 255, 0.08);

  /* Laranja Escuro & Destaques */
  --orange-primary: #d9531e;
  --orange-hover: #bf360c;
  --orange-glow: rgba(217, 83, 30, 0.25);
  --orange-light: #ff7043;
  --orange-badge: rgba(217, 83, 30, 0.15);

  /* Branco & Textos */
  --text-white: #ffffff;
  --text-primary: #f5f5f7;
  --text-secondary: #9e9ea8;
  --text-muted: #6b6b76;

  /* Status */
  --color-success: #2e7d32;
  --color-success-bg: rgba(46, 125, 50, 0.15);
  --color-danger: #c62828;
  --color-danger-bg: rgba(198, 40, 40, 0.15);
  --color-warning: #f57f17;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--orange-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--orange-primary);
}

/* ============================================================
   TELA DE LOGIN
   ============================================================ */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, #1a1512 0%, #0c0c0e 90%);
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: #d9531e;
  top: -80px;
  left: -80px;
}

.blob-2 {
  width: 350px;
  height: 350px;
  background: #bf360c;
  bottom: -60px;
  right: -60px;
}

.login-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 900px;
  width: 100%;
  overflow: hidden;
}

.login-card {
  flex: 1.1;
  padding: 44px;
}

.login-side {
  flex: 0.9;
  background: linear-gradient(135deg, #181513 0%, #12100f 100%);
  border-left: 1px solid var(--border-color);
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--orange-primary);
  color: var(--text-white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px var(--orange-glow);
}

.logo-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

.logo-title span {
  color: var(--orange-primary);
}

.logo-sub {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-heading {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 6px;
}

.login-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.side-content h3 {
  font-size: 20px;
  color: var(--text-white);
  margin-bottom: 12px;
}

.side-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.side-features {
  list-style: none;
}

.side-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-primary);
}

.side-features li i {
  color: var(--orange-primary);
}

.login-demo-box {
  margin-top: 24px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.login-demo-box .demo-title {
  color: var(--orange-light);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-demo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.login-demo-row + .login-demo-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
  padding-top: 6px;
}

.login-demo-row code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  color: #ffb74d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}


/* ============================================================
   FORMULÁRIOS & INPUTS
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group label i {
  color: var(--orange-primary);
  margin-right: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--orange-primary);
  box-shadow: 0 0 0 3px var(--orange-glow);
}

.input-icon-right {
  position: relative;
}

.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

.toggle-pass:hover {
  color: var(--text-white);
}

.field-error {
  display: block;
  font-size: 12px;
  color: #ff5252;
  margin-top: 4px;
}

/* Botões */
.btn-primary,
.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--orange-primary);
  color: var(--text-white);
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary:hover,
.btn-login:hover {
  background: var(--orange-hover);
  color: var(--text-white);
  box-shadow: 0 4px 15px var(--orange-glow);
}

.btn-login {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

.btn-secondary {
  background: #25252e;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #30303b;
  color: var(--text-white);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger {
  background: rgba(198, 40, 40, 0.2);
  color: #ef5350;
  border: 1px solid rgba(229, 57, 53, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-danger:hover {
  background: var(--color-danger);
  color: var(--text-white);
}

/* ============================================================
   LAYOUT DO SISTEMA (SIDEBAR + CONTEÚDO)
   ============================================================ */
.dashboard-body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white);
  overflow: hidden;
  flex: 1;
}

.sidebar-logo a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.sidebar-logo-img {
  height: 52px;
  width: auto;
  max-width: 185px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.sidebar-logo a:hover .sidebar-logo-img {
  transform: scale(1.02);
}

.sidebar-logo-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: none;
}

.sidebar.collapsed .sidebar-logo-img {
  display: none;
}

.sidebar.collapsed .sidebar-logo-icon {
  display: block;
}

.sidebar-logo i {
  color: var(--orange-primary);
  font-size: 20px;
}

.sidebar-logo span strong {
  color: var(--orange-primary);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

.sidebar-toggle:hover {
  color: var(--text-white);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 3px;
  transition: var(--transition);
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-white);
}

.nav-item.active {
  background: var(--orange-badge);
  color: var(--orange-light);
  border-left: 3px solid var(--orange-primary);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: #25252e;
  border: 1px solid var(--orange-primary);
  color: var(--orange-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.btn-logout:hover {
  color: #ff5252;
}

/* ============================================================
   CONTEÚDO PRINCIPAL & TOPBAR
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 76px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 18px;
  cursor: pointer;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
}

.page-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-perfil {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-perfil.admin {
  background: rgba(217, 83, 30, 0.2);
  color: #ff8a65;
  border: 1px solid rgba(217, 83, 30, 0.4);
}

.badge-perfil.professor {
  background: rgba(33, 150, 243, 0.15);
  color: #90caf9;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.content-area {
  padding: 32px;
  flex: 1;
}

/* ============================================================
   CARDS & GRIDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-card.orange .stat-icon {
  background: var(--orange-badge);
  color: var(--orange-primary);
}

.stat-card.white .stat-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.stat-card.green .stat-icon {
  background: var(--color-success-bg);
  color: #81c784;
}

.stat-card.blue .stat-icon {
  background: rgba(33, 150, 243, 0.15);
  color: #64b5f6;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  background: #111114;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:hover td {
  background: var(--bg-card-hover);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: var(--color-success-bg);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-warning {
  background: rgba(245, 127, 23, 0.15);
  color: #ffb74d;
  border: 1px solid rgba(245, 127, 23, 0.3);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: #e57373;
  border: 1px solid rgba(229, 57, 53, 0.3);
}

.badge-orange {
  background: var(--orange-badge);
  color: var(--orange-light);
  border: 1px solid rgba(217, 83, 30, 0.4);
}

/* ============================================================
   ESTILOS ESPECÍFICOS DO FORMULÁRIO DE AVALIAÇÃO DO GRUPO
   ============================================================ */
.eval-group-banner {
  background: linear-gradient(135deg, #1c1815 0%, #16161a 100%);
  border: 1px solid var(--orange-primary);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 8px 24px var(--orange-glow);
}

.eval-group-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 4px;
}

.eval-group-theme {
  font-size: 15px;
  color: var(--orange-light);
  margin-bottom: 18px;
}

.eval-students-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.eval-students-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-chip {
  background: #25252d;
  border: 1px solid #363642;
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.student-chip i {
  color: var(--orange-primary);
}

.student-chip .student-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-white);
}

.student-chip .student-turma {
  font-size: 11px;
  background: #16161a;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--orange-light);
}

/* Cards de Parâmetros */
.param-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 18px;
  transition: var(--transition);
}

.param-card:focus-within,
.param-card:hover {
  border-color: var(--orange-primary);
}

.param-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.param-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
}

.param-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.param-max-badge {
  font-size: 12px;
  padding: 3px 10px;
  background: #222228;
  border: 1px solid #33333d;
  border-radius: 12px;
  color: #bbb;
  white-space: nowrap;
}

.param-input-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.param-slider {
  flex: 1;
  accent-color: var(--orange-primary);
  height: 6px;
  background: #2b2b36;
  border-radius: 3px;
  cursor: pointer;
}

.param-score-input {
  width: 90px !important;
  text-align: center;
  font-size: 18px !important;
  font-weight: 700;
  color: var(--orange-light) !important;
}

/* Barra Flutuante ou Resumo de Nota */
.eval-summary-card {
  background: #1c1815;
  border: 2px solid var(--orange-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}

.eval-score-preview {
  font-size: 38px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1;
}

.eval-score-preview span {
  color: var(--orange-primary);
  font-size: 20px;
}

/* Alertas */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-sucesso {
  background: var(--color-success-bg);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #a5d6a7;
}

.alert-erro {
  background: var(--color-danger-bg);
  border: 1px solid rgba(229, 57, 53, 0.4);
  color: #ef9a9a;
}

/* ============================================================
   OVERLAY & BACKDROP MOBILE
   ============================================================ */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   SISTEMA DE MODAL POPUP (RESPONSIVO & MOBILE-FIRST)
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: translateY(15px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box.modal-lg {
  max-width: 820px;
}

/* REGRA CRÍTICA: Permite que formulários dentro de modais flexibilizem e permitam rolagem no modal-body */
.modal-box form,
.modal-box > form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.modal-overlay.active .modal-box,
.modal-overlay[style*="display: flex"] .modal-box,
.modal-overlay[style*="display:flex"] .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  flex-shrink: 0 !important;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-white);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 24px;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.modal-footer {
  flex-shrink: 0 !important;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================================
   ABAS DE NAVEGAÇÃO (RELATÓRIOS & MÓDULOS)
   ============================================================ */
.report-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition);
  text-decoration: none;
}

.report-tab-btn:hover {
  color: var(--text-white);
}

.report-tab-btn.active {
  color: var(--orange-light);
  border-bottom-color: var(--orange-primary);
  background: rgba(217, 83, 30, 0.06);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

/* Grids Flexíveis com Fallback Responsivo */
.page-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

.page-full {
  width: 100%;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============================================================
   RESPONSIVIDADE COMPLETA (TABLETS & SMARTPHONES)
   ============================================================ */

/* --- TABLETS E TELAS MÉDIAS (<= 1024px) --- */
@media (max-width: 1024px) {
  .page-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
    width: 100%;
  }

  .topbar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
  }

  .topbar {
    padding: 0 20px;
  }

  .content-area {
    padding: 24px 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* --- SMARTPHONES (iPhone 13, 14, 15, 16, Androids <= 768px) --- */
@media (max-width: 768px) {
  /* Tela de Login Responsiva Mobile */
  .login-body {
    padding: 20px 14px;
    align-items: center;
  }

  .login-wrapper {
    flex-direction: column !important;
    max-width: 440px !important;
    width: 100% !important;
    margin: auto !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  }

  .login-side {
    display: none !important;
  }

  .login-card {
    padding: 30px 20px !important;
    width: 100% !important;
  }

  .login-logo img {
    max-height: 52px !important;
    max-width: 200px !important;
  }

  .login-heading {
    font-size: 21px !important;
    text-align: center;
  }

  .login-desc {
    text-align: center;
    font-size: 13px !important;
    margin-bottom: 20px !important;
  }

  /* Previne auto-zoom no iOS Safari (iPhone 13, 14, 15, 16) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px !important;
  }

  .btn-login {
    height: 48px !important;
    font-size: 15px !important;
  }

  .sidebar {
    width: 82%;
    max-width: 300px;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar-left {
    gap: 10px;
  }

  .page-title {
    font-size: 17px;
  }

  .page-sub {
    display: none;
  }

  .user-name {
    display: none;
  }

  .badge-perfil {
    font-size: 11px;
    padding: 3px 8px;
  }

  .content-area {
    padding: 16px 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 16px;
    gap: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .card {
    padding: 18px 14px;
    margin-bottom: 20px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-header h3 {
    font-size: 15px;
  }

  /* Tabelas Adaptáveis com Rolagem Suave */
  .table-responsive {
    margin: 0 -14px;
    padding: 0 14px;
    -webkit-overflow-scrolling: touch;
  }

  .table th, .table td {
    padding: 10px 12px;
    font-size: 12.5px;
  }

  /* Formulário de Avaliação (avaliar.php) */
  .eval-group-banner {
    padding: 18px 14px;
    margin-bottom: 20px;
  }

  .eval-group-title {
    font-size: 20px;
  }

  .eval-group-theme {
    font-size: 13.5px;
  }

  .param-card {
    padding: 16px 14px;
  }

  .param-header {
    flex-direction: column;
    gap: 6px;
  }

  .param-input-box {
    flex-wrap: wrap;
    gap: 12px;
  }

  .param-slider {
    width: 100%;
    order: 2;
  }

  .param-score-input {
    order: 1;
    width: 100% !important;
    height: 44px;
    font-size: 20px !important;
  }

  .eval-summary-card {
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    text-align: center;
  }

  .eval-score-preview {
    font-size: 32px;
  }

  /* Botões e Ações Touch-Friendly */
  .btn, button, input[type="submit"] {
    min-height: 44px; /* Touch target Apple / Google */
  }

  /* Linhas dinâmicas de adição de alunos (grupos.php) */
  .linha-novo-aluno {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Modais em Dispositivos Móveis (iPhone 13, 14, 15, 16 e Androids) */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important; /* Estilo Bottom Sheet suave */
  }

  .modal-box {
    max-width: 100% !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    height: 92vh !important;
    height: 92dvh !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    transform: translateY(100%);
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .modal-box form,
  .modal-box > form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .modal-overlay.active .modal-box,
  .modal-overlay[style*="display: flex"] .modal-box,
  .modal-overlay[style*="display:flex"] .modal-box {
    transform: translateY(0) !important;
  }

  .modal-header {
    flex-shrink: 0 !important;
    padding: 16px 18px !important;
  }

  .modal-body {
    padding: 18px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .modal-footer {
    flex-shrink: 0 !important;
    padding: 14px 16px !important;
    flex-direction: column-reverse !important;
    gap: 10px !important;
  }

  .modal-footer .btn,
  .modal-footer button {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* --- TELAS COMPACTAS (iPhone SE, Androids <= 375px) --- */
@media (max-width: 375px) {
  .topbar {
    padding: 10px;
  }

  .page-title {
    font-size: 15px;
  }

  .content-area {
    padding: 12px 8px;
  }

  .card {
    padding: 14px 10px;
  }

  .btn {
    font-size: 13px;
    padding: 10px 14px;
  }
}

/* --- ESTILOS DE PÓDIO E RANKING POR PARÂMETRO DA BANCA --- */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.podium-card {
  background: #141419;
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #23232e;
}

.podium-card:hover {
  transform: translateY(-3px);
}

.podium-card.gold {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
  background: linear-gradient(145deg, #1b1710, #141419);
}

.podium-card.silver {
  border-color: rgba(203, 213, 225, 0.4);
  box-shadow: 0 4px 16px rgba(203, 213, 225, 0.1);
  background: linear-gradient(145deg, #16181c, #141419);
}

.podium-card.bronze {
  border-color: rgba(180, 83, 9, 0.4);
  box-shadow: 0 4px 16px rgba(180, 83, 9, 0.1);
  background: linear-gradient(145deg, #1a1411, #141419);
}

.podium-badge-place {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}

.podium-badge-place.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.podium-badge-place.silver {
  background: rgba(203, 213, 225, 0.15);
  color: #e2e8f0;
  border: 1px solid rgba(203, 213, 225, 0.3);
}

.podium-badge-place.bronze {
  background: rgba(180, 83, 9, 0.2);
  color: #f97316;
  border: 1px solid rgba(180, 83, 9, 0.4);
}

.podium-score-val {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  margin: 6px 0;
}

.banca-jurado-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e1e26;
  border: 1px solid #323240;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #ddd;
}

/* --- ESTILOS DE SETORES E PRESENÇA / FALTAS --- */
.setor-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: #aaa;
  transition: all 0.2s;
  user-select: none;
}
.setor-chip-toggle input[type="checkbox"] {
  display: none;
}
.setor-chip-toggle.ativo {
  color: #fff;
  border-color: currentColor;
}

.aluno-card-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}
.aluno-card-check:hover {
  background: rgba(255, 255, 255, 0.05);
}

.card-presenca-aluno {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s;
}
.card-presenca-aluno.is-faltou {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: #ef4444 !important;
}

.badge-status-presenca {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.status-presente-bg {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.status-faltou-bg {
  background: #ef4444;
  color: #ffffff;
  border: 1px solid #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
  .linha-novo-aluno {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .aluno-card-check {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .aluno-card-check > div {
    min-width: 100% !important;
  }
  .card-presenca-aluno {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .card-presenca-aluno label {
    width: 100% !important;
    justify-content: space-between !important;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}




/* ============================================================
   RESPONSIVIDADE PARA LAPTOPS E DESKTOPS COMPACTOS (992px - 1366px)
   ============================================================ */
@media (min-width: 992px) and (max-width: 1366px) {
  .sidebar {
    width: 225px !important;
  }
  
  .main-content {
    margin-left: 225px !important;
    width: calc(100% - 225px) !important;
  }

  .topbar {
    padding: 0 22px !important;
    height: 64px !important;
  }

  .content-area {
    padding: 20px 22px !important;
  }

  .page-title {
    font-size: 19px !important;
  }

  .card {
    padding: 18px 20px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 14px !important;
  }

  .grupos-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  .table th, .table td {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
}

/* ============================================================
   DESIGN SYSTEM: CARDS EXECUTIVOS DE GRUPOS & ALUNOS
   ============================================================ */
.view-toggle-bar {
  display: flex;
  align-items: center;
  background: #181820;
  border: 1px solid #2d2d3c;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.btn-view-toggle {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
}

.btn-view-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-view-toggle.active {
  background: var(--orange-primary, #ea580c);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

.grupos-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.grupo-card-box {
  background: #14141a;
  border: 1px solid #262635;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.grupo-card-box:hover {
  transform: translateY(-3px);
  border-color: rgba(234, 88, 12, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.grupo-card-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.grupo-card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.grupo-card-id-badge {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  background: #1e1e28;
  border: 1px solid #333345;
  padding: 2px 8px;
  border-radius: 6px;
}

.grupo-card-title {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 4px;
}

.grupo-card-tema {
  font-size: 13px;
  color: #fdba74;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.grupo-card-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grupo-card-body {
  padding: 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.grupo-card-setores-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.grupo-setor-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.grupo-card-alunos-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grupo-card-alunos-title {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.grupo-card-alunos-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 2px;
}

.grupo-card-alunos-wrap::-webkit-scrollbar {
  width: 4px;
}
.grupo-card-alunos-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.aluno-chip-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 16px;
  background: #1b1b24;
  border: 1px solid #313142;
  font-size: 0.82rem;
  color: #e2e8f0;
  transition: all 0.15s ease;
  white-space: nowrap;
  max-width: 100%;
}

.aluno-chip-card:hover {
  border-color: var(--orange-primary, #ea580c);
  background: #242430;
}

.aluno-chip-card .aluno-chip-nome {
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aluno-chip-turma {
  font-size: 10px;
  font-weight: 700;
  background: rgba(234, 88, 12, 0.18);
  color: #fb923c;
  padding: 1px 5px;
  border-radius: 6px;
}

.aluno-chip-setor {
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.grupo-card-footer {
  padding: 14px 18px;
  background: #101015;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.grupo-card-score {
  display: flex;
  flex-direction: column;
}

.grupo-card-score-val {
  font-size: 18px;
  font-weight: 900;
  color: #fdba74;
  display: flex;
  align-items: center;
  gap: 5px;
}

.grupo-card-score-sub {
  font-size: 11px;
  color: #64748b;
}

.grupo-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   ESTADO RECOLHIDO DO SIDEBAR (DESKTOP)
   ============================================================ */
.sidebar.collapsed {
  width: 76px !important;
}

.main-content.expanded {
  margin-left: 76px !important;
}

.sidebar.collapsed .sidebar-header {
  padding: 0 10px !important;
  justify-content: center !important;
  position: relative !important;
}

.sidebar.collapsed .sidebar-logo {
  display: none !important;
}

.sidebar.collapsed .sidebar-logo-img {
  display: none !important;
}

.sidebar.collapsed .sidebar-logo-icon {
  display: block !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
}

.sidebar.collapsed .sidebar-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  margin: 0 auto !important;
  color: var(--text-white) !important;
}

.sidebar.collapsed .sidebar-nav {
  padding: 16px 6px !important;
  overflow-x: hidden !important;
}

.sidebar.collapsed .nav-section-title {
  display: none !important;
}

.sidebar.collapsed .nav-item {
  justify-content: center !important;
  padding: 13px 0 !important;
  margin: 4px 0 !important;
  border-radius: 10px !important;
  gap: 0 !important;
  position: relative !important;
  width: 100% !important;
}

.sidebar.collapsed .nav-item span {
  display: none !important;
}

.sidebar.collapsed .nav-item i {
  font-size: 19px !important;
  margin: 0 !important;
  min-width: unset !important;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 6px !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
}

.sidebar.collapsed .sidebar-footer .user-info {
  justify-content: center !important;
  padding: 0 !important;
  width: 100% !important;
}

.sidebar.collapsed .sidebar-footer .user-info > div:not(.user-avatar) {
  display: none !important;
}

.sidebar.collapsed .sidebar-footer .user-avatar {
  margin: 0 auto !important;
  width: 38px !important;
  height: 38px !important;
  font-size: 13px !important;
}

.sidebar.collapsed .btn-logout {
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  border-radius: 8px !important;
}

/* Tooltip nativo suave ao passar o mouse com menu recolhido */
@media (min-width: 1025px) {
  .sidebar.collapsed .nav-item:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 84px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e1e24;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1000;
    pointer-events: none;
  }
}

/* ============================================================
   REFINAMENTO GERAL DE RESPONSIVIDADE MOBILE (< 768px e <= 480px)
   ============================================================ */
@media (max-width: 768px) {
  /* Evitar transbordamento horizontal em qualquer página */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .app-container {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .main-content {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Topbar mais compacta e amigável para dedos */
  .topbar {
    padding: 10px 14px !important;
    gap: 8px !important;
  }

  .topbar-left {
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .page-title {
    font-size: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Modais com ajuste ergonômico no celular */
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-end !important; /* Bottom-sheet feel on mobile */
  }

  .modal-box {
    max-height: 92vh !important;
    max-height: 92dvh !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    width: 100% !important;
  }

  .modal-header {
    padding: 14px 16px !important;
  }

  .modal-body {
    padding: 14px 16px !important;
  }

  .modal-footer {
    padding: 12px 16px !important;
    flex-wrap: wrap !important;
  }

  .modal-footer button {
    flex: 1 1 auto !important;
  }

  /* Cards de Grupos no Mobile */
  .grupos-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .grupo-card-box {
    margin: 0 0 10px 0 !important;
  }

  .grupo-card-header {
    padding: 12px 14px !important;
  }

  .grupo-card-body {
    padding: 10px 12px !important;
    gap: 10px !important;
  }

  .grupo-card-alunos-box {
    padding: 8px 10px !important;
  }

  .grupo-card-alunos-wrap {
    max-height: 120px !important;
    gap: 5px !important;
  }

  .aluno-chip-card {
    font-size: 0.78rem !important;
    padding: 2.5px 7px !important;
  }

  .aluno-chip-card .aluno-chip-nome {
    max-width: 105px !important;
  }

  .grupo-card-footer {
    padding: 10px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .grupo-card-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .grupo-card-actions button,
  .grupo-card-actions a {
    flex: 1 1 auto !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Formulário de Avaliação e Lista de Chamada */
  .setor-attendance-box {
    padding: 12px 10px !important;
  }

  .attendance-item {
    padding: 10px 8px !important;
    min-height: 48px !important;
  }

  .attendance-item input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
  }
}

@media (max-width: 480px) {
  .topbar-right {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .card-header {
    padding: 14px 12px !important;
  }
}
/* ============================================================
   TEMA ESPORTIVO: CAFA OPEN (data-theme="cafa-open")
   ============================================================ */
:root[data-theme="cafa-open"],
body[data-theme="cafa-open"] {
  --bg-primary: #0b1120;
  --bg-secondary: #0f172a;
  --bg-card: #151f32;
  --bg-card-hover: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;
  --orange-primary: #10b981;
  --orange-light: #34d399;
  --orange-dark: #059669;
  --sport-royal: #0ea5e9;
  --sport-gold: #f59e0b;
  --sport-silver: #94a3b8;
  --sport-bronze: #d97706;
  --text-white: #f8fafc;
  --text-muted: #94a3b8;
}

.module-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s ease;
}
.module-switcher:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.module-switcher.to-open {
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.module-switcher.to-emp {
  border-color: rgba(249, 115, 22, 0.4);
  color: #fb923c;
}
