:root {
  --primary: #1a237e;
  --primary-light: #534bae;
  --primary-dark: #000051;
  --accent: #ff6f00;
  --accent-light: #ffa040;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #212121;
  --text-secondary: #616161;
  --border: #e0e0e0;
  --success: #2e7d32;
  --error: #c62828;
  --warning: #f57f17;
  --info: #1565c0;
  --etihc: #1565C0;
  --etiam: #C2185B;
  --empjj: #2E7D32;
  --bg-secondary: #ececf1;
  --surface: #fafafa;
  --primary-hover: #0d47a1;
  --primary-bg: rgba(21,101,192,0.06);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family:'Inter',sans-serif; background:var(--bg); color:var(--text); min-height:100vh;
  -webkit-overflow-scrolling:touch; overscroll-behavior-y:contain;
  padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom);
  padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right);
}
/* iOS/Android: inputs sem estilo nativo, font >= 16px evita zoom no iOS */
input:not([type="checkbox"]):not([type="radio"]), textarea {
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  font-size:16px; /* iOS auto-zoom se < 16px */
}
input[type="checkbox"], input[type="radio"] {
  width:18px; height:18px; cursor:pointer; accent-color:var(--primary);
  flex-shrink:0;
}
select {
  font-size:16px; /* iOS auto-zoom se < 16px */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:12px;
  padding-right:28px;
}
button {
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
}

/* === LOGIN SCREEN === */
.login-screen {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
  padding:20px;
}
.login-box {
  background:var(--card); border-radius:16px; padding:40px 32px; width:100%; max-width:400px;
  box-shadow:0 20px 60px rgba(0,0,0,0.3); text-align:center;
}
.login-logo { font-family:'Orbitron',sans-serif; font-size:28px; color:var(--primary); margin-bottom:4px; }
.login-subtitle { color:var(--text-secondary); font-size:13px; margin-bottom:24px; }
.login-box h2 { font-size:18px; color:var(--text); margin-bottom:20px; }
.form-group { margin-bottom:16px; text-align:left; }
#modalAvaliacao .modal-body { padding:16px; }
#modalAvaliacao .form-group { margin-bottom:10px; }
#modalAvaliacao .form-row { gap:8px; }
#modalAvaliacao .form-group input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]), #modalAvaliacao .form-group select { padding:8px 10px; font-size:14px; }
#modalAvaliacao input[type="checkbox"] { width:auto !important; padding:0 !important; border:none !important; border-radius:0 !important; margin:0; }
#modalAvaliacao .form-group label { margin-bottom:2px; }
#modalAvaliacao .modal-footer { padding:12px 16px; }
.form-group label { display:block; font-size:13px; font-weight:600; color:var(--text-secondary); margin-bottom:4px; }
.form-group input, .form-group select, .form-group textarea {
  width:100%; padding:12px 14px; border:2px solid var(--border); border-radius:10px;
  font-size:15px; font-family:'Inter',sans-serif; transition:border-color .2s;
  background:#fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline:none; border-color:var(--primary);
}
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 24px; border:none; border-radius:10px; font-size:15px; font-weight:600;
  cursor:pointer; transition:all .2s; font-family:'Inter',sans-serif;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-light); }
.btn-accent { background:var(--accent); color:#fff; }
.btn-accent:hover { background:var(--accent-light); }
.btn-outline { background:transparent; border:2px solid var(--border); color:var(--text); }
.btn-outline:hover { border-color:var(--primary); color:var(--primary); }
.btn-danger { background:var(--error); color:#fff; }
.btn-danger:hover { background:#b71c1c; }
.btn-sm { padding:8px 16px; font-size:13px; border-radius:8px; }
.btn-block { width:100%; }
.login-error { color:var(--error); font-size:13px; margin-top:8px; display:none; }
.login-links { margin-top:16px; font-size:13px; color:var(--text-secondary); }
.login-links a { color:var(--primary); cursor:pointer; text-decoration:none; }
.login-links a:hover { text-decoration:underline; }

/* === APP SHELL === */
.app-shell { display:none; min-height:100vh; }
.app-header {
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color:#fff; padding:12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); position:sticky; top:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  box-shadow:0 2px 12px rgba(0,0,0,0.15);
}
.header-left { display:flex; align-items:center; gap:12px; }
.header-logo { font-family:'Orbitron',sans-serif; font-size:20px; font-weight:900; }
.header-badge { font-size:11px; background:var(--accent); padding:2px 8px; border-radius:20px; font-weight:600; }
.header-right { display:flex; align-items:center; gap:12px; }
.header-user { font-size:13px; opacity:.9; }
.btn-logout {
  background:rgba(255,255,255,.15); border:1px solid rgba(255,255,255,.3); color:#fff;
  padding:6px 14px; border-radius:8px; font-size:12px; cursor:pointer; font-weight:600;
  transition:background .2s;
}
.btn-logout:hover { background:rgba(255,255,255,.25); }

/* === NAV TABS === */
.nav-tabs {
  display:flex; background:#fff; border-bottom:2px solid var(--border);
  overflow-x:auto; -webkit-overflow-scrolling:touch; position:sticky; top:56px; z-index:99;
}
.nav-tab {
  flex:0 0 auto; padding:12px 18px; font-size:13px; font-weight:600;
  color:var(--text-secondary); cursor:pointer; border-bottom:3px solid transparent;
  transition:all .2s; white-space:nowrap; display:flex; align-items:center; gap:6px;
}
.nav-tab:hover { color:var(--primary); background:rgba(26,35,126,.04); }
.nav-tab.active { color:var(--primary); border-bottom-color:var(--accent); }
.nav-tab .tab-icon { font-size:16px; }

/* === MAIN CONTENT === */
.main-content { padding:20px; max-width:1200px; margin:0 auto; }
.page { display:none; }
.page.active { display:block; }

/* === CARDS === */
.card {
  background:var(--card); border-radius:12px; padding:20px;
  box-shadow:0 2px 8px rgba(0,0,0,.06); margin-bottom:16px;
  border:1px solid var(--border);
}
.card-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:16px; flex-wrap:wrap; gap:12px;
}
.card-title { font-size:18px; font-weight:700; color:var(--primary); }
.card-subtitle { font-size:13px; color:var(--text-secondary); margin-top:2px; }

/* === STATS === */
/* Unified Dashboard Grid */
.dash-unified-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px,1fr)); gap:14px; margin-bottom:24px; }
.dash-ucard {
  background:var(--card); border-radius:14px; padding:18px 14px; text-align:center;
  box-shadow:0 2px 8px rgba(0,0,0,.06); border:2px solid var(--border);
  transition:all .2s; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:110px;
}
.dash-ucard:hover { border-color:var(--primary); transform:translateY(-3px); box-shadow:0 6px 16px rgba(0,0,0,.12); }
.dash-ucard:active { transform:translateY(0); }
.dash-ucard .du-icon { font-size:30px; margin-bottom:6px; }
.dash-ucard .du-value { font-size:26px; font-weight:700; color:var(--primary); line-height:1.1; }
.dash-ucard .du-label { font-size:12px; font-weight:600; color:var(--text-secondary); margin-top:4px; line-height:1.2; }
.dash-ucard.nav-only .du-icon { font-size:28px; margin-bottom:8px; }
.dash-ucard.nav-only .du-label { font-size:13px; color:var(--text); }
/* Legacy stat-card kept for Gincana module */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr)); gap:16px; margin-bottom:24px; }
.stat-card {
  background:var(--card); border-radius:12px; padding:20px; text-align:center;
  box-shadow:0 2px 8px rgba(0,0,0,.06); border:1px solid var(--border);
  transition:transform .2s;
}
.stat-card:hover { transform:translateY(-2px); }
.stat-icon { font-size:32px; margin-bottom:8px; }
.stat-value { font-size:28px; font-weight:700; color:var(--primary); }
.stat-label { font-size:13px; color:var(--text-secondary); margin-top:4px; }

/* === TABLE === */
.table-container { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
thead th {
  background:var(--primary); color:#fff; padding:12px 14px;
  font-size:13px; font-weight:600; text-align:left; white-space:nowrap;
}
tbody td { padding:12px 14px; font-size:14px; border-bottom:1px solid var(--border); }
tbody tr:nth-child(even) { background:#fafafa; }
tbody tr:hover { background:#f0f0ff; }
.badge {
  display:inline-block; padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:600; white-space:nowrap;
}
.badge-success { background:#e8f5e9; color:var(--success); }
.badge-info { background:#e3f2fd; color:var(--info); }
.badge-warning { background:#fff8e1; color:var(--warning); }
.badge-accent { background:#fff3e0; color:var(--accent); }
.badge-escola {
  padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; color:#fff;
}
.hist-badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; white-space:nowrap; }
.hist-badge-info { background:#e3f2fd; color:#1565c0; }
.hist-badge-danger { background:#fce4ec; color:#c62828; }
.hist-badge-success { background:#e8f5e9; color:#2e7d32; }
.hist-badge-warning { background:#fff8e1; color:#f57f17; }
.hist-badge-default { background:#f5f5f5; color:#616161; }

/* === MODAL === */
.modal-overlay {
  display:none; position:fixed; top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,.5); z-index:200; align-items:center; justify-content:center;
  padding:20px;
}
.modal-overlay.active { display:flex; }
.modal {
  background:#fff; border-radius:16px; width:100%; max-width:560px; max-height:90vh;
  overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,.2);
}
.modal-header {
  padding:20px 24px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; background:#fff; border-radius:16px 16px 0 0; z-index:1;
}
.modal-header h3 { font-size:18px; color:var(--primary); }
.modal-close { background:none; border:none; font-size:24px; cursor:pointer; color:var(--text-secondary); padding:10px; min-width:44px; min-height:44px; display:flex; align-items:center; justify-content:center; }
.modal-body { padding:24px; }
.modal-footer { padding:16px 24px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:12px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:500px) { .form-row { grid-template-columns:1fr; } }

/* === TOAST === */
.toast-container { position:fixed; top:70px; right:20px; z-index:300; display:flex; flex-direction:column; gap:8px; }
.toast {
  padding:14px 20px; border-radius:10px; color:#fff; font-size:14px; font-weight:500;
  box-shadow:0 4px 16px rgba(0,0,0,.15); animation:slideIn .3s ease;
  display:flex; align-items:center; gap:8px; max-width:360px;
}
.toast-success { background:var(--success); }
.toast-error { background:var(--error); }
.toast-info { background:var(--info); }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* === EMPTY STATE === */
.empty-state { text-align:center; padding:40px 20px; color:var(--text-secondary); }
.empty-state .empty-icon { font-size:48px; margin-bottom:12px; }
.empty-state p { font-size:15px; }

/* === SEARCH BAR === */
.search-bar {
  display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap;
}
.search-input {
  flex:1; min-width:200px; padding:10px 14px; border:2px solid var(--border);
  border-radius:10px; font-size:14px; font-family:'Inter',sans-serif;
}
.search-input:focus { outline:none; border-color:var(--primary); }
.filter-select {
  padding:10px 14px; border:2px solid var(--border); border-radius:10px;
  font-size:14px; font-family:'Inter',sans-serif; background:#fff;
}

/* === LOADING === */
.loading { text-align:center; padding:40px; }
.spinner {
  width:36px; height:36px; border:4px solid var(--border); border-top-color:var(--primary);
  border-radius:50%; animation:spin .8s linear infinite; margin:0 auto 12px;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* === RESPONSIVE === */
@media (max-width:768px) {
  .header-logo { font-size:16px; }
  .header-user { display:none; }
  .main-content { padding:10px; }
  .dash-unified-grid { grid-template-columns:repeat(3,1fr); gap:10px; }
  .dash-ucard { padding:14px 10px; min-height:95px; }
  .dash-ucard .du-icon { font-size:24px; }
  .dash-ucard .du-value { font-size:20px; }
  .dash-ucard .du-label { font-size:11px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); gap:10px; }
  .stat-card { padding:14px; }
  .stat-value { font-size:22px; }
  .nav-tab { padding:12px 14px; font-size:12px; min-height:44px; }
  .form-row { grid-template-columns:1fr; }
  .card { padding:14px; }
  .card-header { flex-direction:column; align-items:flex-start; gap:8px; }
  .theme-selector label { display:none; }
  .theme-btn { width:26px; height:26px; }
  .app-header { flex-wrap:wrap; gap:8px; padding:10px 12px; }
  .header-logo { font-size:14px; }
  .header-badge { font-size:10px; padding:2px 6px; }
  .btn-logout { padding:6px 10px; font-size:11px; }
  .btn-icon { width:44px; height:44px; font-size:16px; }
  .btn { min-height:44px; padding:10px 16px; font-size:14px; }
  .btn-sm { min-height:44px; padding:10px 12px; font-size:13px; }
  table { font-size:12px; }
  table th, table td { padding:8px 6px; }
  .dash-section-title { font-size:15px; }
  .school-summary-card { padding:12px; }
  .turma-row-clickable td { padding:10px 6px; }
  .aluno-link { font-size:13px; }
}
@media (max-width:400px) {
  .dash-unified-grid { grid-template-columns:repeat(2,1fr); gap:8px; }
  .dash-ucard { padding:10px 8px; min-height:85px; border-radius:12px; }
  .dash-ucard .du-icon { font-size:22px; margin-bottom:4px; }
  .dash-ucard .du-value { font-size:18px; }
  .dash-ucard .du-label { font-size:10px; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .stat-card { padding:10px; }
  .stat-value { font-size:20px; }
  .stat-label { font-size:10px; }
  .login-box { padding:28px 20px; }
  .login-logo { font-size:22px; }
  .main-content { padding:8px; }
  .nav-tab { padding:10px 10px; font-size:11px; }
  .btn-icon { width:44px; height:44px; }
  table { font-size:11px; }
  table th, table td { padding:6px 4px; }
}
/* === ACTION BUTTONS in table === */
.actions { display:flex; gap:6px; }
.btn-icon {
  width:36px; height:36px; border-radius:8px; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:14px;
  transition:background .2s;
}
.btn-icon-edit { background:#e3f2fd; color:var(--info); }
.btn-icon-edit:hover { background:#bbdefb; }
.btn-icon-delete { background:#ffebee; color:var(--error); }
.btn-icon-delete:hover { background:#ffcdd2; }

/* Quick access cards */
.quick-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; }
.quick-card {
  background:var(--card); border-radius:12px; padding:20px; text-align:center;
  cursor:pointer; border:2px solid var(--border); transition:all .2s;
}
.quick-card:hover, .quick-card:active { border-color:var(--primary); transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,.1); }
.quick-card .qc-icon { font-size:28px; margin-bottom:8px; }
.quick-card .qc-label { font-size:13px; font-weight:600; color:var(--text); }

/* Password reset screen */
.reset-box { display:none; }

/* Dev badge */
.badge-dev { background:#ff6f00; color:#fff; }

/* Toggle switch para ativo/inativo */
.toggle-switch input:checked + .toggle-slider { background-color: var(--success, #27ae60); }
.toggle-slider:before {
  position:absolute; content:""; height:20px; width:20px; left:3px; bottom:3px;
  background-color:white; transition:.3s; border-radius:50%;
}
.toggle-switch input:checked + .toggle-slider:before { transform:translateX(22px); }
/* Badge inativo */
.badge-inactive { background:#ffebee; color:#c62828; }
.usuario-inativo { opacity:0.55; }
.usuario-inativo td:first-child strong { text-decoration: line-through; }

/* ===== ADMIN BAR ===== */
.dev-tools-bar {
  position:fixed; bottom:0; left:0; right:0; z-index:9999;
  font-family:system-ui,sans-serif; font-size:13px;
}
.dev-tools-toggle {
  display:flex; align-items:center; gap:8px;
  background:#212121; color:#fff; padding:8px 16px;
  cursor:pointer; user-select:none;
  border-top:2px solid #ff6f00;
}
.dev-tools-toggle:hover { background:#333; }
.dev-tools-icon { font-size:16px; }
.dev-tools-label {
  font-weight:700; font-size:11px; letter-spacing:1px;
  background:#ff6f00; color:#fff; padding:2px 8px; border-radius:4px;
}
.dev-current-role {
  font-size:11px; font-weight:600; padding:2px 10px;
  border-radius:10px; background:#00c853; color:#fff;
  margin-left:auto;
}
.dev-tools-panel {
  background:#1e1e1e; color:#e0e0e0; border-top:1px solid #444;
  padding:0; max-height:220px; overflow-y:auto;
}
.dev-panel-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 16px; background:#2d2d2d; border-bottom:1px solid #444;
  font-size:13px;
}
.dev-panel-close {
  background:none; border:none; color:#aaa; font-size:20px;
  cursor:pointer; padding:0 4px; line-height:1;
}
.dev-panel-close:hover { color:#fff; }
.dev-panel-body {
  padding:12px 16px; display:flex; flex-wrap:wrap; align-items:center; gap:10px;
}
.dev-panel-body label { font-weight:600; font-size:12px; color:#bbb; }
.dev-panel-body select {
  background:#333; color:#fff; border:1px solid #555; border-radius:6px;
  padding:6px 10px; font-size:13px; min-width:200px; cursor:pointer;
}
.dev-panel-body select:focus { border-color:#ff6f00; outline:none; }
.dev-panel-info {
  width:100%; font-size:11px; color:#888; padding:4px 0 0;
  font-style:italic;
}
/* === CONFIGURAÇÕES === */
.config-section { margin-bottom:24px; }
.config-section-title {
  font-size:15px; font-weight:700; color:var(--primary); margin-bottom:12px;
  padding-bottom:8px; border-bottom:2px solid var(--border);
  display:flex; align-items:center; gap:8px;
}
.config-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:600px) { .config-grid { grid-template-columns:1fr; } }
.config-preview {
  background:#f9f9f9; border:2px dashed var(--border); border-radius:12px;
  padding:20px; text-align:center; margin-top:12px;
}
.config-preview-header {
  display:flex; align-items:center; gap:16px; justify-content:center;
  padding:16px; background:#fff; border-radius:8px; border:1px solid var(--border);
}
.config-preview-header img {
  width:60px; height:60px; object-fit:contain; border-radius:8px;
}
.config-preview-text { text-align:left; }
.config-preview-text .cpt-line1 { font-size:11px; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.5px; }
.config-preview-text .cpt-line2 { font-size:14px; font-weight:700; color:var(--primary); }
.config-preview-text .cpt-line3 { font-size:11px; color:var(--text-secondary); }
.config-save-bar {
  position:sticky; bottom:0; background:#fff; border-top:2px solid var(--border);
  padding:12px 20px; display:flex; justify-content:flex-end; gap:12px;
  margin:0 -20px -20px; border-radius:0 0 12px 12px;
}

/* === CSV IMPORT === */
.csv-drop-zone {
  border:3px dashed var(--border); border-radius:12px; padding:32px;
  text-align:center; cursor:pointer; transition:all .2s;
  background:#fafafa;
}
.csv-drop-zone:hover, .csv-drop-zone.dragover {
  border-color:var(--primary); background:#f0f0ff;
}
.csv-drop-zone .drop-icon { font-size:40px; margin-bottom:8px; }
.csv-drop-zone .drop-text { font-size:14px; color:var(--text-secondary); }
.csv-drop-zone .drop-text strong { color:var(--primary); }
.csv-preview-info {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; background:#e8f5e9; border-radius:8px; margin:12px 0;
  font-size:13px; color:var(--success); font-weight:600;
}
.csv-preview-table { max-height:300px; overflow-y:auto; }
.csv-preview-table table { font-size:12px; }
.csv-preview-table thead th { font-size:11px; padding:8px 10px; }
.csv-preview-table tbody td { padding:6px 10px; font-size:12px; }
.csv-error-row { background:#fff3e0 !important; }
.csv-mapping { margin:16px 0; }
.csv-mapping label { font-size:12px; font-weight:600; color:var(--text-secondary); }
.csv-mapping select { font-size:13px; padding:6px 10px; }

/* Push content up so dev bar doesn't overlap */
body.has-devbar #appShell { padding-bottom:44px; }
body.has-devbar .toast-container { bottom:50px; }

/* === DASHBOARD POR PERFIL === */
.dash-section { margin-bottom:24px; }
.dash-section-title {
  font-size:16px; font-weight:700; color:var(--primary); margin-bottom:12px;
  display:flex; align-items:center; gap:8px;
}
.dash-profile-header {
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color:#fff; border-radius:12px; padding:20px 24px; margin-bottom:20px;
  display:flex; align-items:center; gap:16px;
}
.dash-profile-header .dph-avatar {
  width:48px; height:48px; border-radius:50%; background:rgba(255,255,255,.2);
  display:flex; align-items:center; justify-content:center; font-size:24px;
}
.dash-profile-header .dph-info { flex:1; }
.dash-profile-header .dph-name { font-size:18px; font-weight:700; }
.dash-profile-header .dph-role { font-size:13px; opacity:.85; margin-top:2px; }
.dash-profile-header .dph-escola { font-size:12px; opacity:.7; margin-top:2px; }

.school-cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr)); gap:12px; }
.school-summary-card {
  background:var(--card); border-radius:12px; padding:16px 20px;
  border:1px solid var(--border); border-left:4px solid #666;
  box-shadow:0 2px 8px rgba(0,0,0,.04); transition:transform .2s;
}
.school-summary-card:hover, .school-summary-card:active { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,.08); }
.school-summary-card .ssc-header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;
}
.school-summary-card .ssc-name { font-size:15px; font-weight:700; color:var(--text); }
.school-summary-card .ssc-stats { display:flex; gap:16px; }
.school-summary-card .ssc-stat { text-align:center; }
.school-summary-card .ssc-stat-val { font-size:20px; font-weight:700; color:var(--primary); }
.school-summary-card .ssc-stat-label { font-size:11px; color:var(--text-secondary); }
.school-summary-card.clickable { cursor:pointer; }
.school-summary-card.clickable:hover { border-left-width:6px; }
.school-summary-card.expanded { border-left-width:6px; background:var(--bg-secondary); }
.ssc-expand-content { margin-top:12px; border-top:1px solid var(--border); padding-top:12px; }
.ssc-expand-content table { width:100%; border-collapse:collapse; font-size:12px; }
.ssc-expand-content th { padding:6px 8px; text-align:left; font-size:11px; color:var(--text-secondary); border-bottom:2px solid var(--border); }
.ssc-expand-content td { padding:5px 8px; border-bottom:1px solid var(--border); }
.ssc-expand-content tr:hover { background:var(--surface); }
.aluno-link { color:var(--primary); text-decoration:none; cursor:pointer; font-weight:600; }
.aluno-link:hover { text-decoration:underline; color:var(--primary-hover, #0d47a1); }
.turma-row-clickable:hover { background:var(--primary-bg, rgba(21,101,192,0.06)) !important; }
.ssc-mini-stats { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:10px; }
.ssc-mini-stat { background:var(--card); padding:8px 12px; border-radius:8px; border:1px solid var(--border); text-align:center; min-width:80px; }
.ssc-mini-stat-val { font-size:18px; font-weight:700; }
.ssc-mini-stat-label { font-size:10px; color:var(--text-secondary); }
.hist-aval-card { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:14px; margin-bottom:10px; }
.hist-aval-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.hist-aval-title { font-weight:700; font-size:14px; }
.hist-aval-badge { padding:3px 10px; border-radius:12px; font-size:13px; font-weight:700; }
.hist-descritores-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:6px; margin-top:8px; }
.hist-desc-item { display:flex; justify-content:space-between; padding:4px 8px; border-radius:6px; font-size:11px; background:var(--bg-secondary); }
.hist-summary-card { background:linear-gradient(135deg,#e8eaf6,#f3e5f5); border:1px solid #d1c4e9; border-radius:12px; padding:16px; margin-bottom:16px; }

.dash-alert {
  padding:12px 16px; border-radius:10px; font-size:13px; display:flex; align-items:center; gap:10px;
  margin-bottom:12px;
}
.dash-alert-info { background:#e3f2fd; color:var(--info); border:1px solid #bbdefb; }
.dash-alert-warning { background:#fff8e1; color:#e65100; border:1px solid #ffe082; }
.dash-alert-success { background:#e8f5e9; color:var(--success); border:1px solid #c8e6c9; }

/* === PRIMEIRO ACESSO / TROCA DE SENHA === */
.first-access-overlay {
  display:none; position:fixed; top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,.7); z-index:500; align-items:center; justify-content:center;
  padding:20px;
}
.first-access-overlay.active { display:flex; }
.first-access-box {
  background:#fff; border-radius:16px; width:100%; max-width:440px;
  box-shadow:0 20px 60px rgba(0,0,0,.3); overflow:hidden;
}
.first-access-header {
  background:linear-gradient(135deg, var(--accent) 0%, #e65100 100%);
  color:#fff; padding:24px; text-align:center;
}
.first-access-header .fa-icon { font-size:40px; margin-bottom:8px; }
.first-access-header h3 { font-size:20px; font-weight:700; margin-bottom:4px; }
.first-access-header p { font-size:13px; opacity:.9; }
.first-access-body { padding:24px; }
.password-strength {
  margin-top:8px; height:6px; border-radius:3px; background:var(--border);
  overflow:hidden;
}
.password-strength-bar {
  height:100%; border-radius:3px; transition:width .3s, background .3s;
  width:0;
}
.password-strength-text { font-size:11px; margin-top:4px; color:var(--text-secondary); }
.password-rules { margin-top:12px; font-size:12px; color:var(--text-secondary); }
.password-rules div { padding:2px 0; display:flex; align-items:center; gap:6px; }
.password-rules .rule-ok { color:var(--success); }
.password-rules .rule-fail { color:var(--text-secondary); }
.first-access-footer { padding:16px 24px; border-top:1px solid var(--border); }

/* === SIMULADOR === */
.sim-diff-option:has(input:checked) { border-color:var(--accent) !important; background:var(--bg-secondary); box-shadow:0 0 0 3px rgba(255,111,0,.15); }
.sim-escola-card { display:flex; align-items:center; gap:8px; padding:10px 14px; border:1px solid var(--border); border-radius:8px; cursor:pointer; transition:all .2s; font-size:13px; }
.sim-escola-card:hover, .sim-escola-card:active { background:var(--bg-secondary); }
.sim-escola-card.selected { border-color:var(--accent); background:rgba(255,111,0,.06); }
.sim-turma-chip { display:flex; align-items:center; gap:6px; padding:6px 12px; border:1px solid var(--border); border-radius:20px; cursor:pointer; font-size:12px; transition:all .2s; }
.sim-turma-chip:hover, .sim-turma-chip:active { background:var(--bg-secondary); }
.sim-turma-chip.selected { border-color:var(--success); background:rgba(46,125,50,.08); color:var(--success); }
.sim-senha-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.6); z-index:600; display:flex; align-items:center; justify-content:center; padding:20px; }
.sim-senha-box { background:#fff; border-radius:16px; width:100%; max-width:400px; box-shadow:0 20px 60px rgba(0,0,0,.3); overflow:hidden; }
.correcao-locked-overlay { position:absolute; top:0; left:0; right:0; bottom:0; background:rgba(255,255,255,.85); display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:10; border-radius:8px; }

/* === SPRINT 2: MATRIZES & ITENS === */
.alt-letter {
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%; background:var(--primary);
  color:#fff; font-size:11px; font-weight:700; margin-right:6px;
}
.item-alternativas { margin:12px 0 8px; }
.item-preview {
  background:#f8f9fa; border:2px solid var(--border); border-radius:10px;
  margin-top:12px; overflow:hidden;
}
.item-preview-header {
  background:var(--primary); color:#fff; padding:10px 16px;
  font-size:13px; font-weight:600;
}
.item-preview-body { padding:16px; font-size:14px; line-height:1.6; }
.item-preview-body .prev-enunciado { margin-bottom:12px; font-weight:500; }
.item-preview-body .prev-alt {
  padding:6px 12px; margin:4px 0; border-radius:8px; font-size:13px;
  display:flex; align-items:center; gap:8px;
}
.item-preview-body .prev-alt.correct { background:#e8f5e9; border:1px solid #a5d6a7; }
.item-preview-body .prev-alt:not(.correct) { background:#fafafa; border:1px solid var(--border); }
.table-footer {
  padding:12px 14px; font-size:13px; color:var(--text-secondary);
  border-top:1px solid var(--border); display:flex; align-items:center;
  justify-content:space-between;
}
.badge-lp { background:#e3f2fd; color:#1565c0; }
.badge-mat { background:#fce4ec; color:#c62828; }
.badge-facil { background:#e8f5e9; color:#2e7d32; }
.badge-medio { background:#fff8e1; color:#f57f17; }
.badge-dificil { background:#ffebee; color:#c62828; }

/* === SPRINT 3: AVALIAÇÕES & CORREÇÃO === */
.badge-rascunho { background:#f5f5f5; color:#757575; }
.badge-publicada { background:#e8f5e9; color:#2e7d32; }
.badge-encerrada { background:#e3f2fd; color:#1565c0; }
.aval-item-row {
  display:flex; align-items:flex-start; gap:10px; padding:8px 10px;
  border-bottom:1px solid var(--border); cursor:pointer; transition:background .15s;
}
.aval-item-row:hover { background:#f5f5f5; }
.aval-item-row:last-child { border-bottom:none; }
.aval-item-check { margin-top:2px; width:18px; height:18px; accent-color:var(--primary); }
.aval-item-info { flex:1; font-size:13px; line-height:1.5; }
.aval-item-info .aval-item-desc { font-weight:500; }
.aval-item-info .aval-item-meta { font-size:11px; color:var(--text-secondary); margin-top:2px; }
.aval-selected-chip {
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px;
  background:#e8eaf6; border-radius:12px; font-size:12px; margin:3px;
  border:1px solid #c5cae9;
}
.aval-selected-chip .chip-remove {
  cursor:pointer; font-size:14px; color:#757575; font-weight:700;
  line-height:1;
}
.aval-selected-chip .chip-remove:hover { color:var(--error); }
.avalModoBtn.active { background:var(--primary);color:white;border-color:var(--primary); }
.avalModoBtn:not(.active) { background:white; }

/* Intervenções Pedagógicas */
.int-diagnostico { background:var(--card);border-radius:12px;padding:20px;margin-bottom:16px;box-shadow:0 2px 8px rgba(0,0,0,.06); }
.int-diagnostico-title { font-size:18px;font-weight:700;margin-bottom:16px;color:var(--text); }
.int-resumo-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:16px; }
.int-resumo-card { background:#f8f9fa;border-radius:10px;padding:16px;text-align:center;border-left:4px solid #ccc; }
.int-resumo-card .int-rc-num { font-size:32px;font-weight:800;line-height:1; }
.int-resumo-card .int-rc-label { font-size:12px;color:var(--text-secondary);margin-top:4px; }
.int-resumo-card .int-rc-sub { font-size:11px;color:var(--text-secondary);margin-top:2px; }
.int-grupo { background:var(--card);border-radius:12px;padding:20px;margin-bottom:16px;box-shadow:0 2px 8px rgba(0,0,0,.06); }
.int-grupo-header { display:flex;align-items:center;gap:12px;margin-bottom:16px; }
.int-grupo-icon { font-size:28px; }
.int-grupo-info h3 { font-size:16px;font-weight:700;margin-bottom:2px; }
.int-grupo-info p { font-size:12px;color:var(--text-secondary); }
.int-alunos-list { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px; }
.int-aluno-chip { background:#f0f0f0;border:1px solid #ddd;padding:4px 10px;border-radius:16px;font-size:12px;font-weight:500; }
.int-aluno-chip .prof-val { font-weight:700;margin-left:4px; }
.int-desc-fracos { margin-bottom:14px; }
.int-desc-fracos h4 { font-size:13px;font-weight:700;margin-bottom:8px;color:var(--text-secondary); }
.int-desc-bar { display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:12px; }
.int-desc-bar .desc-code { font-weight:700;min-width:50px; }
.int-desc-bar .desc-bar-wrap { flex:1;height:18px;background:#f0f0f0;border-radius:9px;overflow:hidden; }
.int-desc-bar .desc-bar-fill { height:100%;border-radius:9px;display:flex;align-items:center;justify-content:flex-end;padding-right:6px;font-size:10px;font-weight:700;color:white;min-width:20px; }
.int-atividades { background:#f8f9fa;border-radius:10px;padding:14px;margin-bottom:14px; }
.int-atividades h4 { font-size:13px;font-weight:700;margin-bottom:8px; }
.int-atividade-item { display:flex;align-items:flex-start;gap:8px;margin-bottom:8px;font-size:12px;line-height:1.5; }
.int-atividade-item .atv-icon { font-size:16px;flex-shrink:0;margin-top:1px; }
.ia-intervencao-resultado h2 { page-break-before:auto; }
.ia-intervencao-resultado h3 { color:var(--primary); }
.ia-intervencao-resultado ul { list-style:disc; }
.ia-intervencao-resultado li { margin:4px 0; }
.ia-intervencao-resultado p { margin:6px 0; }
.int-plano-header { display:flex;align-items:center;justify-content:space-between;margin-bottom:16px; }
.int-prioridade { display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:12px;font-size:11px;font-weight:700;text-transform:uppercase; }
.int-prioridade.critica { background:#ffebee;color:#c62828; }
.int-prioridade.alta { background:#fff3e0;color:#e65100; }
.int-prioridade.media { background:#e3f2fd;color:#1565c0; }
.int-prioridade.baixa { background:#e8f5e9;color:#2e7d32; }
@media print {
  .int-diagnostico, .int-grupo { break-inside:avoid;box-shadow:none;border:1px solid #ddd; }
}

/* Correção — Lista de Alunos com Gabarito Accordion */
.correcao-aluno-list { display:flex; flex-direction:column; gap:6px; }
.correcao-aluno-item {
  border:1px solid var(--border); border-radius:10px; overflow:hidden;
  background:var(--card); transition:box-shadow .2s;
}
.correcao-aluno-item.open { box-shadow:0 2px 12px rgba(0,0,0,.08); border-color:var(--primary); }
.correcao-aluno-header {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
  cursor:pointer; user-select:none; -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.correcao-aluno-header:hover { background:#f5f5f5; }
.correcao-aluno-num {
  width:28px; height:28px; border-radius:50%; background:var(--primary);
  color:#fff; font-size:12px; font-weight:700; display:flex;
  align-items:center; justify-content:center; flex-shrink:0;
}
.correcao-aluno-nome { flex:1; font-weight:600; font-size:14px; color:var(--text); }
.correcao-aluno-badge {
  font-size:12px; font-weight:700; padding:4px 10px; border-radius:20px;
  white-space:nowrap;
}
.correcao-aluno-badge.good { background:#e8f5e9; color:var(--success); }
.correcao-aluno-badge.mid { background:#fff3e0; color:#e65100; }
.correcao-aluno-badge.low { background:#ffebee; color:var(--error); }
.correcao-aluno-badge.empty { background:#f5f5f5; color:var(--text-secondary); }
.correcao-aluno-badge.ausente { background:#fff3e0; color:#e65100; font-size:11px; letter-spacing:0.5px; }
.correcao-aluno-item.aluno-ausente { opacity:0.7; }
.correcao-aluno-item.aluno-ausente .correcao-aluno-header { background:#fff8e1; }

/* ===== SUPORTE TÉCNICO ===== */
.suporte-tabs { display:flex; gap:4px; margin-bottom:16px; overflow-x:auto; padding-bottom:4px; }
.suporte-tab { padding:10px 16px; border:1px solid var(--border); border-radius:10px; background:var(--bg); color:var(--text-secondary); font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; transition:all 0.2s; }
.suporte-tab:hover { background:var(--bg-secondary); }
.suporte-tab.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.suporte-content { display:none; }
.suporte-content.active { display:block; }
.suporte-label { display:block; font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:4px; }

/* FAQ Accordion */
.faq-item { border:1px solid var(--border); border-radius:10px; margin-bottom:8px; overflow:hidden; background:var(--bg); }
.faq-question { display:flex; align-items:center; gap:10px; padding:14px 16px; cursor:pointer; font-size:14px; font-weight:600; color:var(--text); transition:background 0.2s; }
.faq-question:hover { background:var(--bg-secondary); }
.faq-question .faq-arrow { transition:transform 0.2s; font-size:12px; color:var(--text-secondary); }
.faq-question.open .faq-arrow { transform:rotate(90deg); }
.faq-answer { padding:0 16px 14px; font-size:13px; color:var(--text-secondary); line-height:1.6; display:none; border-top:1px solid var(--border); }
.faq-answer.open { display:block; padding-top:12px; }
.faq-category { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--primary); margin:20px 0 8px; padding-left:4px; }
.faq-category:first-child { margin-top:0; }

/* Tutorial Cards */
.tutorial-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:12px; }
.tutorial-card { border:1px solid var(--border); border-radius:12px; padding:20px; background:var(--bg); transition:transform 0.2s, box-shadow 0.2s; }
.tutorial-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,0.08); }
.tutorial-icon { font-size:32px; margin-bottom:10px; }
.tutorial-title { font-size:15px; font-weight:700; color:var(--text); margin-bottom:6px; }
.tutorial-desc { font-size:13px; color:var(--text-secondary); line-height:1.5; margin-bottom:12px; }
.tutorial-steps { font-size:12px; color:var(--text-secondary); }
.tutorial-steps ol { margin:0; padding-left:20px; }
.tutorial-steps li { margin-bottom:4px; line-height:1.5; }

/* Contato Cards */
.contato-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.contato-card { border:1px solid var(--border); border-radius:12px; padding:20px; background:var(--bg); text-align:center; }
.contato-avatar { width:56px; height:56px; border-radius:50%; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:700; margin:0 auto 10px; }
.contato-nome { font-size:15px; font-weight:700; color:var(--text); margin-bottom:2px; }
.contato-funcao { font-size:12px; color:var(--text-secondary); margin-bottom:12px; }
.contato-info { display:flex; flex-direction:column; gap:6px; }
.contato-link { display:flex; align-items:center; justify-content:center; gap:6px; font-size:13px; color:var(--primary); text-decoration:none; padding:6px 12px; border:1px solid var(--primary); border-radius:8px; transition:all 0.2s; }
.contato-link:hover { background:var(--primary); color:#fff; }

/* Form Card */
.suporte-form-card { border:1px solid var(--border); border-radius:12px; padding:20px; background:var(--bg); }

/* Mensagens Histórico */
.suporte-msg-item { border:1px solid var(--border); border-radius:10px; padding:14px 16px; margin-bottom:8px; background:var(--bg); }
.suporte-msg-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; flex-wrap:wrap; gap:6px; }
.suporte-msg-tipo { font-size:11px; font-weight:700; padding:3px 8px; border-radius:6px; text-transform:uppercase; letter-spacing:0.5px; }
.suporte-msg-tipo.duvida { background:#e3f2fd; color:#1565c0; }
.suporte-msg-tipo.bug { background:#fce4ec; color:#c62828; }
.suporte-msg-tipo.sugestao { background:#e8f5e9; color:#2e7d32; }
.suporte-msg-tipo.outro { background:#f3e5f5; color:#7b1fa2; }
.suporte-msg-data { font-size:11px; color:var(--text-secondary); }
.suporte-msg-assunto { font-size:14px; font-weight:600; color:var(--text); margin-bottom:4px; }
.suporte-msg-body { font-size:13px; color:var(--text-secondary); line-height:1.5; }
.suporte-msg-status { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; padding:2px 8px; border-radius:6px; }
.suporte-msg-status.pendente { background:#fff3e0; color:#e65100; }
.suporte-msg-status.respondido { background:#e8f5e9; color:#2e7d32; }

.correcao-aluno-arrow {
  font-size:18px; color:var(--text-secondary); transition:transform .2s;
}
.correcao-aluno-item.open .correcao-aluno-arrow { transform:rotate(180deg); }

/* Gabarito panel (accordion body) */
.correcao-gabarito {
  display:none; padding:0 16px 16px;
}
.correcao-aluno-item.open .correcao-gabarito { display:block; }
.correcao-gab-title {
  font-size:13px; font-weight:600; color:var(--primary); margin-bottom:10px;
  padding-bottom:8px; border-bottom:1px solid var(--border);
}
.btn-ler-foto {
  display:inline-flex; align-items:center; gap:5px; padding:6px 14px;
  background:linear-gradient(135deg, #1565c0, #0d47a1); color:#fff;
  border:none; border-radius:20px; font-size:12px; font-weight:600;
  cursor:pointer; transition:all .2s; white-space:nowrap; font-family:inherit;
  box-shadow:0 2px 6px rgba(21,101,192,.3);
}
.btn-ler-foto:hover { transform:translateY(-1px); box-shadow:0 3px 10px rgba(21,101,192,.4); }
.btn-ler-foto:active { transform:translateY(0); }
.btn-ler-foto svg { flex-shrink:0; }
.foto-gab-overlay {
  position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.6);
  z-index:9999; display:flex; align-items:center; justify-content:center;
  animation:fadeIn .2s;
}
.foto-gab-card {
  background:#fff; border-radius:16px; padding:28px; max-width:420px; width:90%;
  box-shadow:0 20px 60px rgba(0,0,0,.3); text-align:center;
}
.foto-gab-card h3 { margin:0 0 8px; font-size:18px; color:#1a237e; }
.foto-gab-card p { margin:0 0 16px; font-size:13px; color:#666; line-height:1.5; }
.foto-gab-spinner {
  width:48px; height:48px; border:4px solid #e0e0e0; border-top:4px solid #1565c0;
  border-radius:50%; animation:spin 0.8s linear infinite; margin:16px auto;
}
.foto-gab-resultado {
  background:#f0f7ff; border:1px solid #bbdefb; border-radius:12px;
  padding:16px; margin-top:12px; text-align:left;
}
.foto-gab-resultado .questao-duvida {
  background:#fff3e0; border:1px solid #ffcc80; border-radius:6px;
  padding:4px 8px; margin:2px 0; font-size:12px; color:#e65100;
}
.foto-gab-actions {
  display:flex; gap:10px; justify-content:center; margin-top:16px; flex-wrap:wrap;
}
.foto-gab-actions button {
  padding:10px 24px; border-radius:8px; font-size:14px; font-weight:600;
  cursor:pointer; border:none; font-family:inherit; transition:all .15s;
}
.foto-gab-actions .btn-confirmar {
  background:#2e7d32; color:#fff;
}
.foto-gab-actions .btn-confirmar:hover { background:#1b5e20; }
.foto-gab-actions .btn-cancelar {
  background:#f5f5f5; color:#666; border:1px solid #ddd;
}
.foto-gab-actions .btn-cancelar:hover { background:#eee; }
.correcao-gab-table {
  width:100%; border-collapse:separate; border-spacing:0;
  border:1px solid var(--border); border-radius:8px; overflow:hidden;
}
.correcao-gab-table thead th {
  background:var(--primary); color:#fff; font-size:12px; font-weight:600;
  padding:10px 8px; text-align:center;
}
.correcao-gab-table thead th:first-child { text-align:left; padding-left:14px; width:80px; }
.correcao-gab-table tbody td {
  padding:6px 8px; text-align:center; border-bottom:1px solid #f0f0f0;
}
.correcao-gab-table tbody tr:last-child td { border-bottom:none; }
.correcao-gab-table tbody tr:nth-child(even) { background:#fafafa; }
.correcao-gab-table tbody td:first-child {
  text-align:left; padding-left:14px; font-weight:600; font-size:13px; color:var(--text-secondary);
}
.correcao-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:50%; border:2px solid var(--border);
  background:#fff; font-size:14px; font-weight:700; cursor:pointer;
  transition:all .15s; user-select:none; -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.correcao-btn:hover { border-color:var(--primary); background:#e8eaf6; }
.correcao-btn.selected { background:var(--primary); color:#fff; border-color:var(--primary); }
.correcao-btn.correct { background:var(--success); color:#fff; border-color:var(--success); }
.correcao-btn.wrong { background:var(--error); color:#fff; border-color:var(--error); }
.correcao-gab-gabarito {
  font-size:10px; color:var(--success); font-weight:600; display:block; margin-top:2px;
}
.correcao-summary {
  display:flex; gap:16px; padding:16px; background:#f8f9fa;
  border-radius:10px; margin-top:16px; flex-wrap:wrap;
}
.correcao-summary-item {
  text-align:center; flex:1; min-width:80px;
}
.correcao-summary-item .cs-value { font-size:24px; font-weight:700; color:var(--primary); }
.correcao-summary-item .cs-label { font-size:11px; color:var(--text-secondary); margin-top:2px; }
.correcao-actions {
  display:flex; gap:8px; justify-content:flex-end; margin-top:16px;
}
@media(max-width:768px) {
  .correcao-btn { width:44px; height:44px; font-size:15px; border-width:2.5px; }
  .correcao-aluno-header { padding:12px 14px; }
  .correcao-gabarito { padding:0 12px 12px; }
}
@media(max-width:480px) {
  .correcao-btn { width:40px; height:40px; font-size:14px; }
  .correcao-aluno-nome { font-size:13px; }
}

/* Sprint 4: Resultados + Dashboard Analítico */
.resultado-card {
  background:white; border-radius:12px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,0.08); margin-bottom:16px;
}
.resultado-card-title {
  font-size:16px; font-weight:700; color:var(--primary); margin-bottom:12px; display:flex; align-items:center; gap:8px;
}
.resultado-aluno-detail {
  background:#f8f9fa; border-radius:8px; padding:12px; margin-top:8px;
}
.resultado-questao-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(50px, 1fr)); gap:6px; margin-top:8px;
}
.resultado-questao-cell {
  width:42px; height:42px; display:flex; align-items:center; justify-content:center; border-radius:8px;
  font-size:12px; font-weight:700; cursor:pointer; transition:transform 0.1s;
}
.resultado-questao-cell.acerto { background:#e8f5e9; color:#2e7d32; }
.resultado-questao-cell.erro { background:#ffebee; color:#c62828; }
.resultado-questao-cell.vazio { background:#f5f5f5; color:#bdbdbd; }
.resultado-media-bar {
  height:24px; border-radius:12px; background:#e0e0e0; overflow:hidden; position:relative;
}
.resultado-media-fill {
  height:100%; border-radius:12px; transition:width 0.5s ease; display:flex; align-items:center; min-width:fit-content;
}
.resultado-media-label {
  position:absolute; right:8px; top:50%; transform:translateY(-50%); font-size:11px; font-weight:700; color:white;
}
.resultado-media-pct {
  padding:0 10px; font-size:12px; font-weight:700; color:white; white-space:nowrap; margin-left:auto;
}
.chart-container {
  background:white; border-radius:12px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,0.08); margin-bottom:16px;
}
.chart-title {
  font-size:15px; font-weight:700; color:var(--primary); margin-bottom:16px; display:flex; align-items:center; gap:8px;
}
.chart-canvas-wrap { position:relative; width:100%; }
.chart-canvas-wrap canvas { width:100% !important; }
.dash-analitico-grid {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:16px;
}
.result-stat-card {
  background:white; border-radius:12px; padding:16px; box-shadow:0 1px 3px rgba(0,0,0,0.08);
  text-align:center; border-left:4px solid var(--primary);
}
.result-stat-value { font-size:32px; font-weight:800; color:var(--primary); }
.result-stat-label { font-size:12px; color:var(--text-secondary); margin-top:4px; }
.turma-rank-row {
  display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid #f0f0f0;
}
.turma-rank-row:last-child { border-bottom:none; }
.turma-rank-pos { width:28px; height:28px; border-radius:50%; background:var(--primary); color:white; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }
.turma-rank-name { flex:1; font-size:13px; font-weight:600; }
.turma-rank-bar { flex:2; }
.turma-rank-pct { font-size:13px; font-weight:700; min-width:45px; text-align:right; }
@media(max-width:600px) {
  .dash-analitico-grid { grid-template-columns:1fr; }
  .resultado-questao-cell { width:36px; height:36px; font-size:11px; }
}

/* === SPRINT 5: RELATÓRIOS === */
.relatorio-area {
  background:white; border-radius:12px; padding:32px; box-shadow:0 1px 3px rgba(0,0,0,0.08); margin-top:12px;
}
.relatorio-cabecalho {
  text-align:center; border-bottom:2px solid var(--primary); padding-bottom:16px; margin-bottom:24px;
}
.relatorio-cabecalho img { width:70px; height:70px; object-fit:contain; margin-bottom:8px; }
.relatorio-cabecalho .cab-emoji { font-size:48px; margin-bottom:8px; }
.relatorio-cabecalho h2 { font-size:16px; font-weight:700; color:var(--primary); margin-bottom:2px; }
.relatorio-cabecalho h3 { font-size:14px; font-weight:600; color:var(--text-secondary); margin-bottom:2px; }
.relatorio-cabecalho h4 { font-size:12px; color:var(--text-secondary); }
.relatorio-titulo {
  text-align:center; margin-bottom:24px;
}
.relatorio-titulo h1 { font-size:20px; font-weight:800; color:var(--primary); text-transform:uppercase; margin-bottom:4px; }
.relatorio-titulo p { font-size:13px; color:var(--text-secondary); }
.rel-section { margin-bottom:24px; }
.rel-section-title { font-size:15px; font-weight:700; color:var(--primary); margin-bottom:12px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.rel-stats-grid {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:12px; margin-bottom:20px;
}
.rel-stat-card {
  background:var(--bg); border-radius:10px; padding:14px; text-align:center; border:1px solid var(--border);
}
.rel-stat-value { font-size:28px; font-weight:800; color:var(--primary); }
.rel-stat-label { font-size:11px; color:var(--text-secondary); margin-top:2px; }
.rel-table {
  width:100%; border-collapse:collapse; font-size:13px;
}
.rel-table th {
  background:var(--primary); color:white; padding:10px 8px; text-align:left; font-weight:600; font-size:12px;
}
.rel-table td { padding:8px; border-bottom:1px solid #eee; }
.rel-table tr:nth-child(even) { background:#f9f9f9; }
.rel-table tr:hover { background:#eef; }
.rel-bar-cell { position:relative; min-width:100px; }
.rel-bar { height:20px; border-radius:4px; display:flex; align-items:center; padding-left:6px; font-size:11px; font-weight:700; color:white; min-width:20px; }
.rel-legenda { font-size:11px; color:var(--text-secondary); margin-top:8px; display:flex; gap:16px; flex-wrap:wrap; }
.rel-legenda span::before { content:''; display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:4px; vertical-align:middle; }
.rel-legenda .leg-verde::before { background:var(--success); }
.rel-legenda .leg-amarelo::before { background:var(--accent); }
.rel-legenda .leg-vermelho::before { background:var(--error); }
.rel-boletim-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:20px; }
.rel-boletim-info { font-size:13px; }
.rel-boletim-info strong { color:var(--primary); }
.rel-boletim-info p { margin:4px 0; }
.rel-status-badge {
  display:inline-block; padding:4px 12px; border-radius:20px; font-size:12px; font-weight:700; color:white;
}
.rel-rodape {
  margin-top:32px; padding-top:12px; border-top:1px solid var(--border); text-align:center;
  font-size:11px; color:var(--text-secondary);
}

/* Comparativo/Evolução extra filters */
.rel-extra-filters label:hover { background:var(--primary-light); color:white; }
.rel-extra-filters label input[type="checkbox"] { accent-color:var(--primary); }

/* Print styles */
@media print {
  body { background:white !important; }
  .app-header, .nav-tabs, .no-print, .dev-bar, .toast, .rel-extra-filters { display:none !important; }
  .app-shell { padding-top:0 !important; }
  .main-content { padding:0 !important; }
  .page { display:none !important; }
  .page#page-relatorios, .page#page-intervencoes { display:block !important; }
  .relatorio-area { box-shadow:none !important; border-radius:0 !important; padding:16px !important; }
  .rel-table th { background:var(--primary) !important; color:white !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .rel-bar { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .rel-stat-card { border:1px solid #ccc !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .relatorio-cabecalho { border-bottom:2px solid #000 !important; }
  canvas { max-width:100% !important; height:auto !important; }
  @page { margin:15mm 10mm; }
}

/* ===== GINCANA SYSTEM (Sprint 6) ===== */

/* Gincana CSS Variables */
:root {
  --gin-gold: #FFD700;
  --gin-silver: #C0C0C0;
  --gin-bronze: #CD7F32;
  --gin-etihc: #1565C0;
  --gin-etihc-light: #e3f2fd;
  --gin-etihc-dark: #0d47a1;
  --gin-etiam: #2E7D32;
  --gin-etiam-light: #e8f5e9;
  --gin-etiam-dark: #1b5e20;
  --gin-empjj: #00838F;
  --gin-empjj-light: #e0f7fa;
  --gin-empjj-dark: #006064;
}

/* === THEME SELECTOR (PALETA) === */
.theme-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}
.theme-selector label {
  font-size: 12px;
  opacity: 0.8;
  color: #fff;
}
.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}
.theme-btn:hover, .theme-btn.active {
  border-color: white;
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(255,255,255,0.5);
}
.theme-btn.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.btn-geral { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.btn-etihc { background: var(--etihc); }
.btn-etiam { background: var(--etiam); }
.btn-empjj { background: var(--empjj); }

/* === ENHANCED STAT CARDS === */
.stat-card {
  border-left: 5px solid var(--primary);
  text-align: left;
}
.stat-card.school-etihc { border-left-color: var(--etihc); }
.stat-card.school-etiam { border-left-color: var(--etiam); }
.stat-card.school-empjj { border-left-color: var(--empjj); }
.stat-card .stat-value { color: var(--primary); }

/* === PROGRESS BARS (GINCANA STYLE) === */
.progress-container { margin: 15px 0; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.progress-bar-bg { height: 24px; background: #e8e8e8; border-radius: 12px; overflow: hidden; position: relative; }
.progress-bar-fill {
  height: 100%; border-radius: 12px; transition: width 0.8s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; min-width: 40px;
}

/* === BAR CHART (HORIZONTAL) === */
.bar-chart { display: flex; flex-direction: column; gap: 16px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 80px; font-size: 13px; font-weight: 600; text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 32px; background: #eee; border-radius: 8px; overflow: hidden; position: relative; }
.bar-fill {
  height: 100%; border-radius: 8px; transition: width 1s ease;
  display: flex; align-items: center; padding-left: 10px;
  font-size: 12px; font-weight: 700; color: white;
}
.bar-value { width: 60px; font-size: 15px; font-weight: 800; text-align: left; flex-shrink: 0; }

/* === STATUS INDICATORS === */
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 6px;
}
.status-dot.completed { background: var(--success); }
.status-dot.upcoming { background: var(--accent); }
.status-dot.pending { background: var(--border); }

/* === SCHOOL ROW COLORED BORDERS === */
.school-row-etihc td:first-child { border-left: 4px solid var(--etihc); }
.school-row-etiam td:first-child { border-left: 4px solid var(--etiam); }
.school-row-empjj td:first-child { border-left: 4px solid var(--empjj); }

/* === BADGES (ENHANCED) === */
.badge-gold { background: #FFF8E1; color: #F57F17; }
.badge-silver { background: #ECEFF1; color: #546E7A; }
.badge-bronze { background: #FBE9E7; color: #BF360C; }
.badge-up { background: #E8F5E9; color: #2E7D32; }
.badge-down { background: #FFF3E0; color: #E65100; }
.badge-same { background: #F5F5F5; color: #9E9E9E; }

/* === FIREBASE STATUS DOT === */
.firebase-status-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; background: #4caf50;
  vertical-align: middle; margin-left: 8px;
  box-shadow: 0 0 6px rgba(76,175,80,0.5);
}

/* System Selector Overlay */
.system-selector-overlay {
  position: fixed; top:0; left:0; width:100%; height:100%;
  background: linear-gradient(135deg, #1a237e 0%, #534bae 50%, #ff6f00 100%);
  z-index: 9999; display:flex; align-items:center; justify-content:center;
  padding: 24px;
}
.system-selector-box {
  background: white; border-radius: 20px; padding: 48px 40px;
  max-width: 600px; width:100%; text-align:center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.system-selector-logo { font-size:32px; font-weight:900; color:#1a237e; margin-bottom:4px; }
.system-selector-sub { color:#666; font-size:14px; margin-bottom:32px; }
.system-cards { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:24px; }
.system-card {
  background: #f8f9fa; border:3px solid #e0e0e0; border-radius:16px;
  padding:28px 20px; cursor:pointer; transition:all 0.3s;
}
.system-card:hover { transform:translateY(-4px); box-shadow:0 8px 24px rgba(0,0,0,0.12); }
.system-card.card-avaliacao:hover { border-color:#1a237e; }
.system-card.card-gincana:hover { border-color:#ff6f00; }
.system-card .card-icon { font-size:48px; margin-bottom:12px; }
.system-card .card-name { font-size:18px; font-weight:700; margin-bottom:6px; }
.system-card .card-desc { font-size:12px; color:#888; }
.system-selector-user { font-size:13px; color:#666; margin-bottom:8px; }
.system-selector-user strong { color:#1a237e; }
@media(max-width:500px) { .system-cards { grid-template-columns:1fr; } }

/* Municipality Selector Overlay */
.mun-selector-overlay {
  position: fixed; top:0; left:0; width:100%; height:100%;
  background: linear-gradient(135deg, #1a237e 0%, #534bae 50%, #ff6f00 100%);
  z-index: 9998; display:flex; align-items:center; justify-content:center;
  padding: 24px;
}
.mun-selector-box {
  background: white; border-radius: 20px; padding: 48px 40px;
  max-width: 600px; width:100%; text-align:center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.mun-selector-logo { font-size:32px; font-weight:900; color:#1a237e; margin-bottom:4px; }
.mun-selector-sub { color:#666; font-size:14px; margin-bottom:24px; }
.mun-selector-user { font-size:13px; color:#666; margin-bottom:16px; }
.mun-selector-user strong { color:#1a237e; }
.mun-cards { display:grid; grid-template-columns:1fr; gap:12px; margin-bottom:24px; max-height:400px; overflow-y:auto; padding:4px; }
.mun-card {
  background: #f8f9fa; border:3px solid #e0e0e0; border-radius:14px;
  padding:20px 24px; cursor:pointer; transition:all 0.3s;
  display:flex; align-items:center; gap:16px; text-align:left;
}
.mun-card:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,0.12); border-color:#1a237e; }
.mun-card .mun-icon { font-size:36px; flex-shrink:0; }
.mun-card .mun-info { flex:1; }
.mun-card .mun-name { font-size:16px; font-weight:700; color:#1a237e; margin-bottom:2px; }
.mun-card .mun-detail { font-size:12px; color:#888; }
.mun-card .mun-role { font-size:11px; color:#fff; background:#1a237e; padding:2px 10px; border-radius:10px; display:inline-block; margin-top:4px; }
.mun-loading { text-align:center; padding:40px; color:#666; }
.mun-loading .spinner { display:inline-block; width:40px; height:40px; border:4px solid #e0e0e0; border-top-color:#1a237e; border-radius:50%; animation:spin 0.8s linear infinite; margin-bottom:12px; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Header municipality indicator */
.header-mun-indicator {
  display:flex; align-items:center; gap:6px;
  font-size:11px; color:rgba(255,255,255,0.85);
  cursor:default;
}
.header-mun-name { font-weight:600; }
.header-mun-switch {
  background:rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.3);
  color:#fff; font-size:10px; padding:2px 8px; border-radius:10px;
  cursor:pointer; transition:all 0.2s;
}
.header-mun-switch:hover { background:rgba(255,255,255,0.3); }

@media(max-width:500px) { .mun-cards { max-height:300px; } .mun-card { padding:14px 16px; } }

/* Gincana Nav Tabs */
.gin-nav-tabs {
  display: flex; background: white; border-bottom: 2px solid #e0e0e0;
  padding: 0 20px; overflow-x: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.gin-nav-tab {
  padding: 14px 24px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: #616161; border-bottom: 3px solid transparent; transition: all 0.3s;
  white-space: nowrap; user-select: none;
}
.gin-nav-tab:hover { color: var(--primary); background: rgba(26,35,126,0.04); }
.gin-nav-tab.active { color: var(--primary); border-bottom-color: var(--accent); }
@media(max-width:768px) { .gin-nav-tab { padding: 12px 14px; font-size: 13px; } }

/* Gincana Container Base */
#gincanaContainer { max-width: 1400px; margin: 0 auto; padding: 24px; display:none; }
#gincanaContainer .gin-section { display: none; }
#gincanaContainer .gin-section.active { display: block; animation: fadeIn 0.3s ease; }

/* ===== GINCANA ADMIN SCOPED STYLES ===== */

/* Dashboard Grid */
#gincanaContainer .dashboard-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; margin-bottom:24px; }
#gincanaContainer .stat-card { background:var(--card,#fff); border-radius:16px; padding:24px; box-shadow:0 4px 16px rgba(0,0,0,0.06); position:relative; overflow:hidden; transition:transform 0.3s,box-shadow 0.3s; border:1px solid rgba(0,0,0,0.04); }
#gincanaContainer .stat-card:hover { transform:translateY(-4px); box-shadow:0 8px 32px rgba(0,0,0,0.1); }
#gincanaContainer .stat-card .stat-icon { font-size:40px; margin-bottom:12px; }
#gincanaContainer .stat-card .stat-value { font-size:36px; font-weight:800; margin-bottom:4px; }
#gincanaContainer .stat-card .stat-label { font-size:14px; color:#616161; }
#gincanaContainer .stat-card .stat-detail { font-size:12px; color:#9e9e9e; margin-top:8px; }
#gincanaContainer .stat-card::after { content:''; position:absolute; top:0; right:0; width:80px; height:80px; border-radius:0 0 0 80px; opacity:0.1; }

/* Encounter Selector */
#gincanaContainer .encounter-selector { display:flex; gap:12px; margin-bottom:24px; flex-wrap:wrap; }
#gincanaContainer .enc-btn { padding:14px 28px; border-radius:12px; border:2px solid #e0e0e0; background:white; cursor:pointer; font-size:15px; font-weight:700; transition:all 0.3s; flex:1; min-width:180px; text-align:center; }
#gincanaContainer .enc-btn:hover { border-color:#1a237e; background:rgba(26,35,126,0.04); }
#gincanaContainer .enc-btn.active { background:linear-gradient(135deg,#1a237e,#534bae); color:white; border-color:transparent; box-shadow:0 4px 16px rgba(26,35,126,0.3); }
#gincanaContainer .enc-btn .enc-date { font-size:12px; font-weight:400; opacity:0.7; display:block; margin-top:4px; }

/* Score Table */
#gincanaContainer .score-table { width:100%; border-collapse:separate; border-spacing:0; background:white; border-radius:12px; overflow:hidden; box-shadow:0 2px 12px rgba(0,0,0,0.06); }
#gincanaContainer .score-table th { background:linear-gradient(135deg,#1a237e,#534bae); color:white; padding:14px 12px; font-size:13px; font-weight:700; text-align:center; white-space:nowrap; position:sticky; top:0; z-index:2; }
#gincanaContainer .score-table th:first-child { text-align:left; padding-left:20px; min-width:200px; }
#gincanaContainer .score-table td { padding:8px 12px; text-align:center; border-bottom:1px solid #f0f0f0; font-size:14px; }
#gincanaContainer .score-table td:first-child { text-align:left; padding-left:20px; font-weight:500; }
#gincanaContainer .score-table tr:hover td { background:#f8f9ff; }
#gincanaContainer .score-table input[type="number"] { width:70px; padding:8px; border:2px solid #e0e0e0; border-radius:8px; text-align:center; font-size:14px; font-weight:600; transition:all 0.2s; }
#gincanaContainer .score-table input[type="number"]:focus { border-color:#1a237e; outline:none; box-shadow:0 0 0 3px rgba(26,35,126,0.1); }
#gincanaContainer .score-table .school-total { font-weight:800; font-size:16px; }
#gincanaContainer .score-table .activity-label { font-size:12px; color:#616161; }

/* Ranking & Podium */
#gincanaContainer .ranking-podium { display:flex; justify-content:center; gap:20px; margin:32px 0; align-items:flex-end; }
#gincanaContainer .podium-item { text-align:center; border-radius:16px; padding:24px 20px; min-width:160px; transition:transform 0.3s; }
#gincanaContainer .podium-item:hover { transform:translateY(-4px); }
#gincanaContainer .podium-position { font-size:48px; margin-bottom:8px; }
#gincanaContainer .podium-name { font-size:20px; font-weight:800; margin-bottom:4px; }
#gincanaContainer .podium-score { font-size:28px; font-weight:800; }
#gincanaContainer .podium-detail { font-size:12px; opacity:0.7; margin-top:4px; }

/* Student Table */
#gincanaContainer .student-table { width:100%; border-collapse:separate; border-spacing:0; margin-top:16px; }
#gincanaContainer .student-table th { background:linear-gradient(135deg,#1a237e,#534bae); color:white; padding:12px; font-size:12px; text-align:center; position:sticky; top:0; z-index:2; }
#gincanaContainer .student-table th:first-child { text-align:left; padding-left:16px; }
#gincanaContainer .student-table td { padding:10px 12px; text-align:center; border-bottom:1px solid #f0f0f0; font-size:13px; }
#gincanaContainer .student-table td:first-child { text-align:left; font-weight:500; }
#gincanaContainer .student-table tr:hover td { background:#f8f9ff; }

/* Progress Bar */
#gincanaContainer .progress-bar { height:8px; background:#e0e0e0; border-radius:4px; overflow:hidden; margin-top:8px; }
#gincanaContainer .progress-fill { height:100%; border-radius:4px; transition:width 0.6s ease; }

/* School Filter */
#gincanaContainer .school-filter { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
#gincanaContainer .school-filter-btn { padding:10px 20px; border-radius:10px; border:2px solid #e0e0e0; background:white; cursor:pointer; font-size:13px; font-weight:600; transition:all 0.2s; }
#gincanaContainer .school-filter-btn:hover { border-color:#1a237e; }
#gincanaContainer .school-filter-btn.active { color:white; border-color:transparent; }

/* Bar Chart */
#gincanaContainer .bar-chart { display:flex; align-items:flex-end; gap:8px; height:200px; padding:20px 0; }
#gincanaContainer .bar-item { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; }
#gincanaContainer .bar { border-radius:8px 8px 0 0; min-width:40px; transition:height 0.6s ease; }
#gincanaContainer .bar-label { font-size:11px; color:#616161; margin-top:8px; text-align:center; }
#gincanaContainer .bar-value { font-size:12px; font-weight:700; margin-bottom:4px; }

/* Descriptor Bars */
#gincanaContainer .descriptor-bar { display:flex; align-items:center; gap:12px; padding:10px 16px; background:white; border-radius:10px; margin-bottom:8px; box-shadow:0 2px 8px rgba(0,0,0,0.04); }
#gincanaContainer .descriptor-code { min-width:70px; font-weight:700; font-size:13px; }
#gincanaContainer .descriptor-name { min-width:200px; font-size:12px; color:#616161; }
#gincanaContainer .descriptor-fill-wrap { flex:1; height:24px; background:#f0f0f0; border-radius:12px; overflow:hidden; }
#gincanaContainer .descriptor-fill { height:100%; border-radius:12px; transition:width 0.6s; display:flex; align-items:center; padding-left:8px; }
#gincanaContainer .descriptor-pct { min-width:50px; text-align:right; font-weight:700; font-size:14px; }

/* Answer Grid */
#gincanaContainer .gin-answer-grid { border-collapse:collapse; width:100%; font-size:12px; }
#gincanaContainer .gin-answer-grid th { position:sticky; top:0; background:linear-gradient(135deg,#1a237e,#534bae); color:white; padding:10px 6px; text-align:center; font-size:11px; z-index:2; }
#gincanaContainer .gin-answer-grid th:first-child { text-align:left; padding-left:12px; min-width:140px; }
#gincanaContainer .gin-answer-grid td { padding:4px; text-align:center; border-bottom:1px solid #f0f0f0; }
#gincanaContainer .gin-answer-grid td:first-child { text-align:left; padding-left:12px; font-weight:500; font-size:11px; white-space:nowrap; }
#gincanaContainer .gin-answer-grid select { width:40px; padding:4px 2px; border:1px solid #e0e0e0; border-radius:4px; font-size:12px; text-align:center; cursor:pointer; }
#gincanaContainer .gin-answer-grid select.correct { background:#e8f5e9; border-color:#2e7d32; color:#2e7d32; font-weight:700; }
#gincanaContainer .gin-answer-grid select.wrong { background:#ffebee; border-color:#c62828; color:#c62828; }

/* Intervention Cards */
#gincanaContainer .gin-intervention { padding:14px; border-radius:10px; margin-bottom:8px; border-left:4px solid; }
#gincanaContainer .gin-intervention.critical { border-color:#c62828; background:#fff5f5; }
#gincanaContainer .gin-intervention.warning { border-color:#e65100; background:#fff8f0; }
#gincanaContainer .gin-intervention.ok { border-color:#2e7d32; background:#f5fff5; }
#gincanaContainer .gin-intervention .int-title { font-size:13px; font-weight:700; margin-bottom:4px; }
#gincanaContainer .gin-intervention .int-desc { font-size:12px; color:#616161; line-height:1.4; }

/* Cards & Sections within Gincana */
#gincanaContainer .gin-card { background:white; border-radius:16px; padding:24px; margin-bottom:20px; box-shadow:0 2px 12px rgba(0,0,0,0.06); }
#gincanaContainer .gin-card-title { font-size:18px; font-weight:700; margin-bottom:16px; display:flex; align-items:center; gap:8px; }

/* Cronograma */
#gincanaContainer .cronograma-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; margin-top:16px; }
#gincanaContainer .cronograma-card { border-radius:12px; padding:20px; border-left:4px solid; }
#gincanaContainer .cronograma-card h4 { margin-bottom:8px; font-size:16px; }
#gincanaContainer .cronograma-card p { font-size:13px; color:#616161; margin:4px 0; }

/* Evolucao Grid */
#gincanaContainer .evolucao-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:16px; }
#gincanaContainer .evolucao-card { text-align:center; padding:20px; border-radius:12px; }
#gincanaContainer .evolucao-card .big-number { font-size:36px; font-weight:800; }

/* Ranking Encounters */
#gincanaContainer .ranking-enc-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; margin-top:16px; }
#gincanaContainer .ranking-enc-card { padding:16px; border-radius:12px; text-align:center; }

/* Activity Comparison */
#gincanaContainer .activity-comparison { display:grid; gap:12px; margin-top:16px; }
#gincanaContainer .activity-row { display:flex; align-items:center; gap:12px; padding:12px 16px; background:#f8f8f8; border-radius:10px; }
#gincanaContainer .activity-name { min-width:200px; font-weight:600; font-size:13px; }
#gincanaContainer .activity-bars { flex:1; display:flex; gap:4px; }
#gincanaContainer .activity-bar-seg { height:24px; border-radius:4px; transition:width 0.4s; }

/* Final Result */
#gincanaContainer .final-podium { display:flex; justify-content:center; gap:24px; margin:32px 0; align-items:flex-end; flex-wrap:wrap; }

/* Coordinator Grade Entry (from index.html) */
#gincanaContainer .gin-coord-enc-tabs { display:flex; gap:8px; margin-bottom:20px; overflow-x:auto; padding-bottom:4px; }
#gincanaContainer .gin-coord-enc-tab { padding:10px 18px; border-radius:10px; border:2px solid var(--border,#e0e0e0); background:var(--card,#fff); font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; transition:all .2s; }
#gincanaContainer .gin-coord-enc-tab.active { color:#fff; border-color:transparent; }
#gincanaContainer .gin-coord-student-grid { display:flex; flex-direction:column; gap:8px; }
#gincanaContainer .gin-coord-row { display:grid; grid-template-columns:1fr 72px 72px 56px; gap:8px; align-items:center; padding:10px 12px; border-radius:10px; background:#f5f5f5; transition:background .15s; }
#gincanaContainer .gin-coord-row:hover { background:#e8e8e8; }
#gincanaContainer .gin-coord-row.header { background:transparent; font-size:12px; font-weight:600; color:#616161; text-transform:uppercase; letter-spacing:.5px; padding:4px 12px; }
#gincanaContainer .gin-coord-name { font-size:14px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#gincanaContainer .gin-coord-input { width:100%; padding:8px 4px; border:2px solid #e0e0e0; border-radius:8px; font-size:15px; text-align:center; font-variant-numeric:tabular-nums; background:white; transition:border-color .2s; }
#gincanaContainer .gin-coord-input:focus { outline:none; border-color:var(--accent); }
#gincanaContainer .gin-coord-input.filled { border-color:#2e7d32; background:rgba(46,125,50,0.06); }
#gincanaContainer .gin-coord-total { font-size:15px; font-weight:700; text-align:center; font-variant-numeric:tabular-nums; }
#gincanaContainer .gin-coord-summary { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin:16px 0; }
#gincanaContainer .gin-coord-summary-item { text-align:center; padding:14px 8px; background:#f5f5f5; border-radius:10px; }
#gincanaContainer .gin-coord-summary-label { font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:#616161; margin-bottom:4px; }
#gincanaContainer .gin-coord-summary-value { font-size:24px; font-weight:800; }

/* School Compare Table */
#gincanaContainer .gin-school-compare { width:100%; border-collapse:collapse; font-size:12px; margin-bottom:16px; }
#gincanaContainer .gin-school-compare th { background:linear-gradient(135deg,#1a237e,#534bae); color:#fff; padding:10px 8px; text-align:center; font-size:11px; }
#gincanaContainer .gin-school-compare th:first-child { text-align:left; padding-left:12px; }
#gincanaContainer .gin-school-compare td { padding:8px; text-align:center; border-bottom:1px solid #f0f0f0; }
#gincanaContainer .gin-school-compare td:first-child { text-align:left; padding-left:12px; font-weight:600; font-size:11px; }

/* Badge, Disc Tab, Theme */
#gincanaContainer .gin-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:11px; font-weight:700; }
#gincanaContainer .gin-disc-tab { padding:8px 16px; border-radius:8px; border:2px solid #e0e0e0; background:white; cursor:pointer; font-size:12px; font-weight:600; transition:all .2s; }
#gincanaContainer .gin-disc-tab.active { background:#1a237e; color:white; border-color:#1a237e; }

/* Toast for gincana (uses main system toast) */

/* Legend */
#gincanaContainer .legend-row { display:flex; gap:16px; flex-wrap:wrap; margin:12px 0; }
#gincanaContainer .legend-item { display:flex; align-items:center; gap:6px; font-size:12px; }
#gincanaContainer .legend-color { width:12px; height:12px; border-radius:3px; }

/* ===== GINCANA LIST (Seletor de Gincanas) ===== */
.gin-list-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.gin-list-header h2 { font-size:24px; font-weight:800; color:#1a237e; margin:0; }
.gin-list-header h2 span { font-size:28px; vertical-align:middle; margin-right:6px; }
.gin-btn-nova { padding:12px 24px; background:linear-gradient(135deg,#ff6f00,#ff8f00); color:#fff; border:none; border-radius:12px; font-size:14px; font-weight:700; cursor:pointer; transition:all .2s; box-shadow:0 4px 12px rgba(255,111,0,.25); }
.gin-btn-nova:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(255,111,0,.35); }
.gin-list-empty { text-align:center; padding:60px 20px; color:#888; }
.gin-list-empty .empty-icon { font-size:56px; margin-bottom:12px; }
.gin-list-empty p { font-size:15px; margin:0; }
.gin-list-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:20px; }
.gin-list-card { background:#fff; border-radius:16px; padding:24px; box-shadow:0 4px 16px rgba(0,0,0,.06); border:2px solid transparent; cursor:pointer; transition:all .25s; position:relative; overflow:hidden; }
.gin-list-card:hover { transform:translateY(-4px); box-shadow:0 8px 28px rgba(0,0,0,.1); border-color:#ff6f00; }
.gin-list-card .card-status { position:absolute; top:16px; right:16px; padding:4px 12px; border-radius:20px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.gin-list-card .card-status.ativa { background:#e8f5e9; color:#2e7d32; }
.gin-list-card .card-status.rascunho { background:#fff3e0; color:#e65100; }
.gin-list-card .card-status.encerrada { background:#f5f5f5; color:#757575; }
.gin-list-card .card-nome { font-size:18px; font-weight:700; color:#1a237e; margin-bottom:8px; padding-right:80px; }
.gin-list-card .card-desc { font-size:13px; color:#666; margin-bottom:16px; min-height:20px; }
.gin-list-card .card-meta { display:flex; gap:16px; flex-wrap:wrap; }
.gin-list-card .card-meta-item { font-size:12px; color:#888; display:flex; align-items:center; gap:4px; }
.gin-list-card .card-meta-item strong { color:#333; }
.gin-list-card .card-actions { display:flex; gap:8px; margin-top:16px; padding-top:16px; border-top:1px solid #f0f0f0; }
.gin-list-card .card-actions button { padding:8px 16px; border-radius:8px; border:1px solid #e0e0e0; background:#fff; font-size:12px; font-weight:600; cursor:pointer; transition:all .2s; }
.gin-list-card .card-actions button:hover { background:#f5f5f5; }
.gin-list-card .card-actions .btn-entrar { background:linear-gradient(135deg,#1a237e,#534bae); color:#fff; border:none; flex:1; }
.gin-list-card .card-actions .btn-entrar:hover { box-shadow:0 4px 12px rgba(26,35,126,.3); }
.gin-list-card .card-actions .btn-editar { color:#ff6f00; border-color:#ff6f00; }
.gin-list-card .card-actions .btn-excluir { color:#c62828; border-color:#c62828; }
.gin-list-back-btn { padding:10px 20px; border-radius:10px; border:2px solid #e0e0e0; background:#fff; font-size:13px; font-weight:600; cursor:pointer; transition:all .2s; color:#c62828; }
.gin-list-back-btn:hover { background:#fbe9e7; border-color:#c62828; }

/* ===== GINCANA CONFIG FORM ===== */
.gin-config-container { max-width:800px; margin:0 auto; }
.gin-config-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.gin-config-header h2 { font-size:22px; font-weight:800; color:#1a237e; margin:0; }
.gin-config-card { background:#fff; border-radius:16px; padding:24px; box-shadow:0 4px 16px rgba(0,0,0,.06); margin-bottom:20px; }
.gin-config-card h3 { font-size:16px; font-weight:700; color:#333; margin:0 0 16px; display:flex; align-items:center; gap:8px; }
.gin-config-field { margin-bottom:16px; }
.gin-config-field label { display:block; font-size:13px; font-weight:600; color:#555; margin-bottom:6px; }
.gin-config-field input[type="text"],
.gin-config-field textarea,
.gin-config-field select { width:100%; padding:10px 14px; border:2px solid #e0e0e0; border-radius:10px; font-size:14px; transition:border-color .2s; box-sizing:border-box; }
.gin-config-field input:focus, .gin-config-field textarea:focus, .gin-config-field select:focus { border-color:#1a237e; outline:none; }
.gin-config-field textarea { resize:vertical; min-height:60px; }
.gin-config-schools { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:12px; }
.gin-config-school-card { border:2px solid #e0e0e0; border-radius:12px; padding:16px; transition:all .2s; cursor:pointer; }
.gin-config-school-card.selected { border-color:#2e7d32; background:rgba(46,125,50,.04); }
.gin-config-school-card .school-header { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.gin-config-school-card .school-check { width:20px; height:20px; border-radius:6px; border:2px solid #ccc; display:flex; align-items:center; justify-content:center; font-size:14px; color:#fff; transition:all .2s; flex-shrink:0; }
.gin-config-school-card.selected .school-check { background:#2e7d32; border-color:#2e7d32; }
.gin-config-school-card .school-name { font-weight:700; font-size:14px; }
.gin-config-school-card .school-full { font-size:12px; color:#888; }
.gin-config-school-card .school-color-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }
.gin-config-turmas { margin-top:10px; padding-top:10px; border-top:1px solid #f0f0f0; }
.gin-config-turma-item { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:13px; }
.gin-config-turma-item input[type="checkbox"] { width:16px; height:16px; accent-color:#1a237e; cursor:pointer; }
.gin-config-turma-item label { cursor:pointer; flex:1; }
.gin-config-turma-item .turma-count { font-size:11px; color:#888; }
.gin-config-summary { background:#f8f9ff; border-radius:12px; padding:16px; display:flex; gap:24px; flex-wrap:wrap; }
.gin-config-summary-item { text-align:center; }
.gin-config-summary-item .sum-value { font-size:24px; font-weight:800; color:#1a237e; }
.gin-config-summary-item .sum-label { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:.5px; }
.gin-config-actions { display:flex; gap:12px; justify-content:flex-end; margin-top:24px; }
.gin-config-actions button { padding:12px 28px; border-radius:12px; font-size:14px; font-weight:700; cursor:pointer; transition:all .2s; }
.gin-config-actions .btn-cancelar { background:#fff; border:2px solid #e0e0e0; color:#666; }
.gin-config-actions .btn-cancelar:hover { background:#f5f5f5; }
.gin-config-actions .btn-salvar { background:linear-gradient(135deg,#2e7d32,#43a047); color:#fff; border:none; box-shadow:0 4px 12px rgba(46,125,50,.25); }
.gin-config-actions .btn-salvar:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(46,125,50,.35); }

/* Responsive */
@media(max-width:768px) {
  #gincanaContainer { padding: 12px; }
  #gincanaContainer .dashboard-grid { grid-template-columns: 1fr; }
  #gincanaContainer .ranking-podium { flex-direction:column; align-items:center; }
  #gincanaContainer .encounter-selector { flex-direction:column; }
  #gincanaContainer .descriptor-name { min-width:120px; }
  #gincanaContainer .gin-coord-row { grid-template-columns:1fr 60px 60px 48px; gap:6px; padding:8px 10px; }
  #gincanaContainer .gin-coord-summary { grid-template-columns:1fr 1fr; }
}
@media(max-width:480px) {
  #gincanaContainer .stat-card .stat-value { font-size:28px; }
  #gincanaContainer .score-table { font-size:12px; }
  #gincanaContainer .score-table th, #gincanaContainer .score-table td { padding:6px 8px; }
  #gincanaContainer .podium-item { min-width:120px; padding:16px 12px; }
}


/* Sprint 7: Dashboard Analítico por Perfil + Evolução */
.dash-section-evolucao { margin-top:20px; }
.dash-evolucao-title {
  font-size:16px; font-weight:700; color:var(--primary); margin-bottom:12px;
  display:flex; align-items:center; gap:8px;
}
.evolucao-grid-aval {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:16px; margin-bottom:16px;
}
.evolucao-aval-card {
  background:white; border-radius:12px; padding:16px; box-shadow:0 1px 3px rgba(0,0,0,0.08);
  border-left:4px solid var(--primary); position:relative; overflow:hidden;
}
.evolucao-aval-card .eac-title {
  font-size:13px; font-weight:700; color:var(--primary); margin-bottom:8px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.evolucao-aval-card .eac-componente {
  font-size:11px; color:var(--text-secondary); margin-bottom:8px;
}
.evolucao-aval-card .eac-media {
  font-size:28px; font-weight:800; margin-bottom:4px;
}
.evolucao-aval-card .eac-detail {
  font-size:11px; color:var(--text-secondary);
}
.evolucao-aval-card .eac-delta {
  position:absolute; top:12px; right:12px; font-size:13px; font-weight:700;
  padding:4px 10px; border-radius:16px;
}
.eac-delta.up { background:#e8f5e9; color:#2e7d32; }
.eac-delta.down { background:#ffebee; color:#c62828; }
.eac-delta.same { background:#f5f5f5; color:#9e9e9e; }

.dash-comparison-table {
  width:100%; border-collapse:collapse; font-size:13px;
}
.dash-comparison-table th {
  text-align:left; padding:10px 8px; background:var(--primary); color:white;
  font-size:12px; font-weight:600;
}
.dash-comparison-table th:first-child { border-radius:8px 0 0 0; }
.dash-comparison-table th:last-child { border-radius:0 8px 0 0; }
.dash-comparison-table td {
  padding:10px 8px; border-bottom:1px solid #f0f0f0;
}
.dash-comparison-table tr:hover td { background:#f8f9ff; }
.dash-comparison-table .pct-badge {
  display:inline-block; padding:2px 10px; border-radius:12px; font-weight:700; font-size:12px;
}
.dash-comparison-table .delta-cell {
  font-weight:700; font-size:12px;
}
.delta-up { color:#2e7d32; }
.delta-down { color:#c62828; }
.delta-same { color:#9e9e9e; }

.dash-student-evolution {
  background:white; border-radius:12px; padding:16px; box-shadow:0 1px 3px rgba(0,0,0,0.08); margin-top:16px;
}
.student-evo-row {
  display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #f0f0f0;
}
.student-evo-row:last-child { border-bottom:none; }
.student-evo-name { flex:1; font-size:13px; font-weight:600; min-width:120px; }
.student-evo-bars { flex:3; display:flex; gap:4px; align-items:center; flex-wrap:wrap; }
.student-evo-bar-wrap { flex:1; min-width:60px; }
.student-evo-bar-label { font-size:9px; color:var(--text-secondary); margin-bottom:2px; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.student-evo-bar {
  height:20px; border-radius:10px; background:#e0e0e0; overflow:hidden; position:relative;
}
.student-evo-fill { height:100%; border-radius:10px; transition:width 0.5s ease; }
.student-evo-pct {
  position:absolute; right:4px; top:50%; transform:translateY(-50%);
  font-size:10px; font-weight:700; color:white;
}
.student-evo-delta { min-width:50px; text-align:right; font-size:12px; font-weight:700; }

.dash-empty-analytics {
  text-align:center; padding:32px 20px; color:var(--text-secondary);
  background:white; border-radius:12px; box-shadow:0 1px 3px rgba(0,0,0,0.08);
}
.dash-empty-analytics .empty-icon { font-size:48px; margin-bottom:8px; }
.dash-empty-analytics .empty-title { font-size:16px; font-weight:600; margin-bottom:8px; color:var(--text-primary); }
.dash-empty-analytics .empty-desc { font-size:13px; }

.dash-chart-evolucao {
  background:white; border-radius:12px; padding:16px; box-shadow:0 1px 3px rgba(0,0,0,0.08); margin-bottom:16px;
}
.dash-chart-evolucao .chart-title {
  font-size:15px; font-weight:700; color:var(--primary); margin-bottom:12px;
}

.dash-filter-bar-inline {
  display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:12px;
}
.dash-filter-bar-inline select {
  padding:6px 10px; border:1px solid #e0e0e0; border-radius:8px; font-size:12px;
  background:white; color:var(--text-primary);
}
.dash-filter-bar-inline label {
  font-size:12px; font-weight:600; color:var(--text-secondary);
}

@media(max-width:600px) {
  .evolucao-grid-aval { grid-template-columns:1fr; }
  .student-evo-row { flex-direction:column; align-items:flex-start; }
  .student-evo-bars { width:100%; }
  .student-evo-delta { text-align:left; }
}

/* ===== EDUCAÇÃO INFANTIL — Estilos de Correção por Nível de Escrita ===== */

/* Container da linha de questão de escrita */
.correcao-escrita-row {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.correcao-escrita-row:last-child { border-bottom: none; }

.correcao-escrita-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.correcao-escrita-sublabel {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* Grid de botões de nível (6 botões) */
.correcao-nivel-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Botão de nível de escrita — retangular, colorido por nível */
.correcao-nivel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 40px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: center;
  line-height: 1.2;
}
.correcao-nivel-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* Estados de seleção por nível — cada nível com sua cor */
.correcao-nivel-btn.selected.nivel-1 { background: #c62828; color: #fff; border-color: #c62828; }
.correcao-nivel-btn.selected.nivel-2 { background: #e65100; color: #fff; border-color: #e65100; }
.correcao-nivel-btn.selected.nivel-3 { background: #f57f17; color: #fff; border-color: #f57f17; }
.correcao-nivel-btn.selected.nivel-4 { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.correcao-nivel-btn.selected.nivel-5 { background: #1565c0; color: #fff; border-color: #1565c0; }
.correcao-nivel-btn.selected.nivel-6 { background: #4a148c; color: #fff; border-color: #4a148c; }

/* Hover não-selecionado — borda muda para a cor do nível */
.correcao-nivel-btn.nivel-1:hover:not(.selected) { border-color: #c62828; background: #ffebee; }
.correcao-nivel-btn.nivel-2:hover:not(.selected) { border-color: #e65100; background: #fff3e0; }
.correcao-nivel-btn.nivel-3:hover:not(.selected) { border-color: #f57f17; background: #fffde7; }
.correcao-nivel-btn.nivel-4:hover:not(.selected) { border-color: #2e7d32; background: #e8f5e9; }
.correcao-nivel-btn.nivel-5:hover:not(.selected) { border-color: #1565c0; background: #e3f2fd; }
.correcao-nivel-btn.nivel-6:hover:not(.selected) { border-color: #4a148c; background: #f3e5f5; }

/* Indicador de nível selecionado na escrita */
.correcao-escrita-resultado {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

/* Seção de questões de escrita no modal de avaliação */
.infantil-escrita-section {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-radius: 12px;
  border: 1px solid #a5d6a7;
}
.infantil-escrita-title {
  font-weight: 700;
  font-size: 14px;
  color: #2e7d32;
  margin-bottom: 12px;
}
.infantil-escrita-item {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #c8e6c9;
}
.infantil-toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 8px;
  margin-top: 12px;
  border: 1px solid #a5d6a7;
}
.infantil-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #2e7d32;
}

/* Barra de progresso de nível de escrita (para relatórios) */
.nivel-escrita-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid var(--border);
}
.nivel-escrita-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  min-width: 20px;
  transition: flex .3s;
}

/* Resumo de desempenho infantil */
.infantil-resultado-card {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.infantil-resultado-item {
  text-align: center;
  flex: 1;
  min-width: 100px;
}
.infantil-resultado-valor {
  font-size: 22px;
  font-weight: 700;
}
.infantil-resultado-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Responsivo — Mobile */
@media(max-width:768px) {
  .correcao-nivel-btn {
    min-width: 40px;
    height: 44px;
    font-size: 10px;
    padding: 4px 6px;
  }
  .correcao-nivel-grid { gap: 4px; }
}
@media(max-width:480px) {
  .correcao-nivel-btn {
    min-width: 36px;
    height: 40px;
    font-size: 9px;
    padding: 3px 4px;
  }
  .correcao-escrita-label { font-size: 12px; }
}


/* ===== CHAT DE SUPORTE IA ===== */
.suporte-chat-container { display:flex; flex-direction:column; height:500px; border:1px solid var(--border); border-radius:14px; overflow:hidden; background:var(--bg); }
.suporte-chat-header { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid var(--border); background:var(--bg-secondary); }
.suporte-ia-avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg, #4f46e5, #7c3aed); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex-shrink:0; }
.suporte-ia-avatar-small { width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg, #4f46e5, #7c3aed); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; flex-shrink:0; }
.suporte-chat-btn-small { padding:6px 12px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text-secondary); font-size:12px; cursor:pointer; transition:all 0.2s; }
.suporte-chat-btn-small:hover { background:var(--bg-secondary); color:var(--text); }
.suporte-chat-messages { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:12px; }
.suporte-chat-welcome { text-align:center; padding:32px 16px; }
.suporte-quick-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.suporte-quick-btn { padding:8px 14px; border:1px solid var(--border); border-radius:20px; background:var(--bg); color:var(--text); font-size:12px; cursor:pointer; transition:all 0.2s; display:flex; align-items:center; gap:6px; }
.suporte-quick-btn:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.suporte-msg { display:flex; gap:8px; align-items:flex-end; }
.suporte-msg-user { justify-content:flex-end; }
.suporte-msg-ia { justify-content:flex-start; }
.suporte-msg-bubble { max-width:80%; padding:10px 14px; border-radius:16px; font-size:14px; line-height:1.5; }
.suporte-bubble-user { background:var(--primary); color:#fff; border-bottom-right-radius:4px; }
.suporte-bubble-ia { background:var(--bg-secondary); color:var(--text); border-bottom-left-radius:4px; border:1px solid var(--border); }
.suporte-msg-text { word-wrap:break-word; }
.suporte-msg-time { font-size:10px; margin-top:4px; opacity:0.7; }
.suporte-chat-input-area { padding:12px 16px; border-top:1px solid var(--border); background:var(--bg); box-sizing:border-box; width:100%; }
.suporte-chat-send { width:40px; height:40px; border:none; border-radius:50%; background:var(--primary); color:#fff; font-size:16px; cursor:pointer; transition:all 0.2s; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.suporte-chat-send:hover { opacity:0.9; transform:scale(1.05); }
.suporte-chat-send:disabled { opacity:0.5; cursor:not-allowed; transform:none; }
.suporte-typing-dots { display:flex; gap:4px; align-items:center; }
.suporte-typing-dots span { width:8px; height:8px; border-radius:50%; background:var(--text-secondary); animation:suporteTyping 1.4s infinite ease-in-out; }
.suporte-typing-dots span:nth-child(2) { animation-delay:0.2s; }
.suporte-typing-dots span:nth-child(3) { animation-delay:0.4s; }
@keyframes suporteTyping { 0%,80%,100%{opacity:0.3;transform:scale(0.8)} 40%{opacity:1;transform:scale(1)} }

@media (max-width:600px) {
  .suporte-chat-container { height:420px; }
  .suporte-msg-bubble { max-width:88%; }
  .suporte-quick-actions { justify-content:flex-start; }
}

/* ===== BOTÃO FLUTUANTE DE AJUDA CONTEXTUAL ===== */
.fab-ajuda {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color, #6c5ce7), #a855f7);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(108,92,231,0.35);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fabPulse 2s ease-in-out infinite;
}
.fab-ajuda:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(108,92,231,0.5);
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(108,92,231,0.35); }
  50% { box-shadow: 0 4px 24px rgba(108,92,231,0.55); }
}

.popup-ajuda {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 300px;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 9999;
  overflow: hidden;
  display: none;
}
.popup-ajuda-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary-color, #6c5ce7), #a855f7);
  color: #fff;
  font-size: 0.95rem;
}
.popup-ajuda-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
}
.popup-ajuda-body {
  padding: 12px 16px 16px;
}
.popup-ajuda-dica {
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--text-color, #333);
  border-bottom: 1px solid var(--border-color, #eee);
}
.popup-ajuda-dica:last-of-type {
  border-bottom: none;
}
.popup-ajuda-chat-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: linear-gradient(135deg, var(--primary-color, #6c5ce7), #a855f7);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.popup-ajuda-chat-btn:hover {
  opacity: 0.9;
}

@media (max-width: 600px) {
  .fab-ajuda {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }
  .popup-ajuda {
    bottom: 74px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
