/* Projeto Maple — Atividades Extracurriculares
   Paleta de UI (chrome/marca) baseada no site real da unidade — vermelho
   #CC1316, texto cinza-marrom quente, Montserrat — independente da paleta
   categórica das atividades (essa vem de data.js, validada CVD-safe, não mexer).
   Redesign (2026-08-07): linguagem visual "dashboard vermelho/branco" —
   cards flutuantes arredondados, badges circulares, blobs decorativos —
   inspirada nas referências em referencias/ (analytics/CRM red-on-white).
   Tema claro/escuro via prefers-color-scheme + toggle manual (data-theme no <html>). */

:root {
  color-scheme: light;
  --page:        #f7f4f3;
  --surface:     #ffffff;
  --surface-2:   #f6f0ee;
  --border:      rgba(80,68,68,0.10);
  --text:        #362d2c;
  --text-2:      #4f4341;
  --text-muted:  #72645f;
  --accent:      #cc1316;
  --accent-2:    #ff4d4f;
  --accent-deep: #99080b;
  --accent-soft: rgba(204,19,22,0.09);
  --accent-glow: rgba(204,19,22,0.22);
  --on-accent:   #ffffff;
  --shadow-sm:   0 1px 2px rgba(58,48,48,0.05), 0 6px 14px -8px rgba(58,48,48,0.14);
  --shadow:      0 2px 4px rgba(58,48,48,0.05), 0 20px 40px -20px rgba(58,48,48,0.22);
  --shadow-lg:   0 8px 16px -4px rgba(58,48,48,0.10), 0 28px 56px -24px rgba(58,48,48,0.28);
  --radius:      22px;
  --radius-sm:   14px;
  --maxw:        1120px;
  --espera-bg:   #fde6bd;
  --espera-text: #96590a;
  /* status livre (Disponibilidade) — pedido do Beto 2026-08-26: reproduzir a
     MESMA estética do pill vermelho que já existe (referência real: print do
     deploy atual), só recolorido pra verde. "Ocupado" nem precisa de token
     novo — já é literalmente --accent/--accent-soft, a própria cor que
     aparece no print. Opacidade do verde um pouco mais alta que o vermelho
     (0.16 vs o 0.09 do --accent-soft) porque verde sobre o fundo rosado-
     quente da página (--page) lava menos óbvio que vermelho no mesmo tom —
     compensação de percepção, não capricho. */
  --status-livre-text: #1f7a3d;
  --status-livre-bg:   rgba(31,122,61,0.16);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page:        #0a0a0a;
    --surface:     #161616;
    --surface-2:   #202020;
    --border:      rgba(255,255,255,0.09);
    --text:        #f2f2f2;
    --text-2:      #cacaca;
    --text-muted:  #8f8f8f;
    --accent:      #ff4d4f;
    --accent-2:    #ff7a7c;
    --accent-deep: #c21f22;
    --accent-soft: rgba(255,77,79,0.16);
    --accent-glow: rgba(255,77,79,0.30);
    --on-accent:   #141414;
    --shadow-sm:   0 1px 2px rgba(0,0,0,0.3), 0 6px 14px -8px rgba(0,0,0,0.4);
    --shadow:      0 2px 4px rgba(0,0,0,0.3), 0 24px 44px -20px rgba(0,0,0,0.6);
    --shadow-lg:   0 10px 20px -6px rgba(0,0,0,0.4), 0 32px 60px -24px rgba(0,0,0,0.7);
    --espera-bg:   #4a3616;
    --espera-text: #ffcb7a;
    --status-livre-text: #6bd991;
    --status-livre-bg:   rgba(107,217,145,0.18);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:        #0a0a0a;
  --surface:     #161616;
  --surface-2:   #202020;
  --border:      rgba(255,255,255,0.09);
  --text:        #f2f2f2;
  --text-2:      #cacaca;
  --text-muted:  #8f8f8f;
  --accent:      #ff4d4f;
  --accent-2:    #ff7a7c;
  --accent-deep: #c21f22;
  --accent-soft: rgba(255,77,79,0.16);
  --accent-glow: rgba(255,77,79,0.30);
  --on-accent:   #141414;
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.3), 0 6px 14px -8px rgba(0,0,0,0.4);
  --shadow:      0 2px 4px rgba(0,0,0,0.3), 0 24px 44px -20px rgba(0,0,0,0.6);
  --shadow-lg:   0 10px 20px -6px rgba(0,0,0,0.4), 0 32px 60px -24px rgba(0,0,0,0.7);
  --espera-bg:   #4a3616;
  --espera-text: #ffcb7a;
  --status-livre-text: #6bd991;
  --status-livre-bg:   rgba(107,217,145,0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--text);
  font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* BLOBS decorativos fixos — eco das formas vermelhas orgânicas nas referências
   (cantos com curvas vermelhas por trás dos cards brancos). Puramente
   decorativo: fixed, sem interação, atrás de todo o conteúdo. */
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent) 60%, transparent 72%);
  opacity: .16; filter: blur(2px);
}
body::before { width: 620px; height: 620px; top: -260px; right: -220px; }
body::after   { width: 520px; height: 520px; bottom: -240px; left: -200px; opacity: .10; }
#loginScreen, #appScreen { position: relative; z-index: 1; }

/* INTRO — splash "estilo Netflix" antes do login/app, toda vez que a página
   carrega (ver app.js). Cobre a tela inteira num z-index acima de tudo
   enquanto o mark 🍁 nasce/pulsa; depois some revelando o que já estava por
   baixo (login ou app, dependendo se a sessão foi restaurada a tempo — ver
   bootstrap() em app.js, que roda em paralelo com a animação). Pulável com
   clique/tecla; sem animação nenhuma se o sistema pedir prefers-reduced-motion. */
#introScreen {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: var(--page);
  cursor: pointer;
  transition: opacity .45s ease, visibility .45s ease;
}
#introScreen.intro-hide { opacity: 0; visibility: hidden; }
.intro-mark {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  animation: introPop 1.1s cubic-bezier(.22,1,.36,1) both;
}
.intro-mark::before {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 480%; height: 480%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  z-index: -1;
}
.intro-mark .intro-logo-svg { width: clamp(140px, 22vw, 260px); height: auto; display: block; }
@keyframes introPop {
  0%   { transform: scale(.4); opacity: 0; }
  55%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-mark { animation: none; }
  #introScreen { transition: none; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 80px; }

/* SHELL — sidebar à esquerda + conteúdo, inspirado nas referências em referencias/ */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; position: relative; z-index: 1; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; box-shadow: var(--shadow-sm);
}
.main-content { flex: 1; min-width: 0; }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 8px; }
.brand .mark {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand .mark .logo-icon-svg { width: 40px; height: 40px; display: block; }
.brand h1 { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 17px; line-height: 1.2; }
.brand .sub { font-size: 11.5px; color: var(--text-muted); }

/* LIVE CLOCK BADGE (skills/21st-components/snippets/live-clock-badge.html)
   — garimpado no getlayers.ai ("Lumora"), 2026-08-22, TESTE ainda não
   confirmado com o Leonardo. Fica no topo do sidebar: hora local ao vivo
   ajuda a equipe a situar o horário atual contra a grade de horários das
   atividades (Segunda 14h, Terça 15h30 etc.) sem trocar de tela/celular. */
.clock-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--text-2);
  border: 1px solid var(--accent-glow); border-radius: 999px;
  padding: 5px 10px 5px 8px; font-size: 11px; margin: 0 6px 10px; white-space: nowrap;
}
.clock-badge__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); animation: clockPulse 2s ease-out infinite;
}
.clock-badge__time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.clock-badge__sep, .clock-badge__date { color: var(--text-muted); }
@keyframes clockPulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 6px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}
@media (prefers-reduced-motion: reduce) { .clock-badge__dot { animation: none; } }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav button {
  display: flex; align-items: center; gap: 10px; text-align: left;
  border: none; background: transparent; color: var(--text-2); font-weight: 600;
  font-size: 14px; padding: 11px 13px; border-radius: 12px; cursor: pointer;
  font-family: 'Montserrat', sans-serif; transition: background .15s, color .15s, box-shadow .15s, transform .1s;
}
.side-nav-ico {
  font-size: 14px; width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2);
}
.side-nav button:hover { background: var(--surface-2); }
.side-nav button.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-deep));
  color: var(--on-accent); box-shadow: 0 10px 20px -8px var(--accent-glow);
}
.side-nav button.active .side-nav-ico { background: rgba(255,255,255,0.22); }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.perfil-atual { font-size: 12px; color: var(--text-muted); padding: 0 6px 2px; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.tabs button {
  border: none; background: transparent; color: var(--text-2); font-weight: 600;
  font-size: 13.5px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-family: 'Montserrat', sans-serif; transition: background .15s, color .15s;
}
.tabs button.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-deep));
  color: var(--on-accent); box-shadow: 0 6px 14px -6px var(--accent-glow);
}

/* toggle de agenda Infantil/Fundamental — navegação primária da view de
   Atividades, por isso maior/mais larga que o .tabs padrão (Lista/Semana) */
.segmento-toggle { width: 100%; margin-bottom: 18px; }
.segmento-toggle button { flex: 1; text-align: center; font-size: 14.5px; padding: 11px 16px; }

.theme-toggle {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: 12px; width: 100%; padding: 10px 12px; cursor: pointer; font-size: 13px;
  font-family: 'Montserrat', sans-serif; font-weight: 600; text-align: left; transition: background .15s;
}
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }

/* botão "Chovendo hoje?" — filtro perto da agenda (Visão Geral, agenda por
   segmento, Lista, Espaços — várias instâncias na tela, todas sincronizadas
   no mesmo estado, ver atualizarBotaoChuva() em app.js), mesma linguagem
   visual dos outros filtros de seção (.search). Estado ativo destacado, mesma
   lógica de badge-espera (cor de alerta, não é erro). */
.filtro-chuva {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-family: 'Montserrat', sans-serif;
  font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s;
}
.filtro-chuva:hover { background: var(--accent-soft); color: var(--accent); }
.filtro-chuva:disabled { opacity: .6; cursor: default; }
.filtro-chuva:disabled:hover { background: var(--surface); color: var(--text-2); }
.filtro-chuva.chuva-ativa {
  background: color-mix(in srgb, #ffb35c 22%, var(--surface));
  color: #c9750f; border-color: color-mix(in srgb, #ffb35c 55%, var(--border));
}
/* local trocado na tela por causa da chuva — ver localParaExibir() em app.js.
   Não é dado gravado, só exibição; a cor de alerta deixa isso óbvio de longe. */
.local-realocado { color: #c9750f; font-weight: 700; }
.local-sem-alt { color: var(--accent); font-weight: 700; }

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: column;
    align-items: stretch; gap: 10px; padding: 12px 14px;
  }
  .brand { padding: 0 2px; }
  .brand .mark .logo-icon-svg { width: 34px; height: 34px; }
  .brand h1 { font-size: 15px; }
  .brand .sub { display: none; }

  /* Nav vira uma faixa rolável na horizontal — em vez de tentar caber 4 abas
     numa linha só (o que cortava Infantil/Alunos/Lista da tela em telas
     estreitas), cada aba fica com largura mínima própria e a faixa rola. */
  .side-nav {
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px;
    padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .side-nav button { flex-shrink: 0; padding: 9px 13px; font-size: 13px; white-space: nowrap; }

  .sidebar-footer {
    margin-top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px;
  }
  .perfil-atual { flex: 1 1 auto; min-width: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .theme-toggle { width: auto; }

  .wrap { padding: 20px 14px 56px; }
  #loginScreen { padding: 0 16px; }
}

/* SECTION HEAD */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 16px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 21px; letter-spacing: -.01em; }
.section-head .meta { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.section-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.search {
  width: 100%; max-width: 280px; padding: 10px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: 'Montserrat', sans-serif; font-size: 13.5px; box-shadow: var(--shadow-sm);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ICON BADGE — circulo vermelho com emoji/ícone, elemento assinatura das
   referências (cards de KPI e listas de usuário com avatar circular). */
.icon-badge {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, var(--accent-2), var(--accent) 65%, var(--accent-deep));
  color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; box-shadow: 0 8px 16px -6px var(--accent-glow);
}
.icon-badge.sm { width: 30px; height: 30px; font-size: 13px; border-radius: 10px; }
.icon-badge.outline {
  background: var(--accent-soft); color: var(--accent); box-shadow: none;
}
.avatar-badge {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px; color: var(--on-accent);
  background: linear-gradient(150deg, var(--av-2, var(--accent-2)), var(--av-1, var(--accent)));
  box-shadow: 0 6px 12px -6px rgba(0,0,0,0.28);
}
/* foto de perfil (só professores, ver aba Professores) — cai por cima do
   fundo gradiente/iniciais quando existe; sem foto, o span com as iniciais
   continua aparecendo normalmente. */
.avatar-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-badge.lg { width: 76px; height: 76px; font-size: 26px; }
/* avatar com foto de verdade, no cabeçalho do drawer ou preview do
   formulário (Aluno/Professor) — clicável, abre o lightbox (mesmo mecanismo
   das fotos de Espaço). Só ganha essa classe quando há foto (ver
   tornarAvatarExpandivel em assets/app.js). */
.avatar-clicavel { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.avatar-clicavel:hover { transform: scale(1.05); box-shadow: var(--shadow); }

/* ESPAÇOS GRID — wireframe do Beto: cartão com o nome do espaço numa faixa
   no topo e a foto do local em baixo, num quadrado bem maior que o avatar
   circular de Alunos/Professores. Sem foto cadastrada, cai no mesmo
   gradiente por iniciais que os avatares usam (avatarCores). */
.grid-espacos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.card-espaco {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card-espaco:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-espaco-titulo {
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13.5px; text-align: center;
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-espaco-foto {
  position: relative;
  aspect-ratio: 1 / 1; width: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: var(--on-accent);
  background: linear-gradient(150deg, var(--av-2, var(--accent-2)), var(--av-1, var(--accent)));
}
.card-espaco-foto img { width: 100%; height: 100%; object-fit: cover; }
/* mais de 1 foto — pill "📷 N" no canto, indica que dá pra expandir/navegar
   entre fotos no drawer do espaço. */
.card-espaco-foto .badge-fotos {
  position: absolute; bottom: 8px; right: 8px; background: rgba(20,10,10,0.6); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(2px);
}
.card-espaco-meta {
  padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center;
  border-top: 1px dashed var(--border);
}

/* FOTOS DO ESPAÇO — thumbnails no formulário (upload múltiplo, cada uma
   removível) e na galeria do drawer (clicável, abre o lightbox). */
.fotos-esp-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.fotos-esp-grid .foto-esp-item {
  position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.fotos-esp-grid .foto-esp-item img { width: 100%; height: 100%; object-fit: cover; }
.fotos-esp-grid .foto-esp-remove {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 999px;
  border: none; background: rgba(20,10,10,0.65); color: #fff; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .12s;
}
.fotos-esp-grid .foto-esp-remove:hover { background: rgba(20,10,10,0.85); }

.drawer-fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 4px 0 16px; }
.drawer-fotos-grid img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.drawer-fotos-grid img:hover { transform: scale(1.04); box-shadow: var(--shadow); }

/* LIGHTBOX — expande uma foto do espaço em tela cheia, com navegação entre
   as fotos do mesmo local quando houver mais de uma (ver drawer-fotos-grid
   acima e o avatar grande do cabeçalho do drawer). */
.lightbox {
  position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center;
  background: rgba(10,4,4,0.88);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 86vh; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.5); }
.lightbox-close, .lightbox-nav {
  position: absolute; border: none; background: rgba(255,255,255,0.14); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .12s;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.26); }
.lightbox-close { top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 999px; font-size: 15px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 999px; font-size: 26px; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-contador {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 12.5px; font-weight: 600; background: rgba(0,0,0,0.4); padding: 4px 13px; border-radius: 999px;
}

/* ATIVIDADE CARDS */
.grid-atividades { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 16px; }
.card-atividade {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.card-atividade::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 4px;
  background: var(--dot, var(--accent));
}
.card-atividade:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
/* aula cancelada hoje (aba Agora) — continua visível, só marcada, não some
   da lista (ver cardAtividadeHtml em app.js: quem checa no meio do
   cancelamento precisa ver "estava prevista, foi cancelada", não vazio). */
.card-atividade.card-cancelada { opacity: .72; }
.card-atividade.card-cancelada::before { background: var(--accent-deep); }
.faixa-cancelada {
  background: color-mix(in srgb, var(--accent-deep) 16%, var(--surface));
  color: var(--accent-deep); font-weight: 700; font-size: 12.5px;
  padding: 6px 10px; border-radius: 8px; margin-bottom: 10px;
}
.card-atividade .cabecalho-card { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; padding-right: 54px; }
.card-atividade .icon-badge { background: color-mix(in srgb, var(--dot, var(--accent)) 82%, black 6%); box-shadow: 0 8px 16px -6px color-mix(in srgb, var(--dot, var(--accent)) 55%, transparent); }
.card-atividade .nome { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 16px; line-height: 1.25; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
/* .linha/.ico eram escopadas só dentro de .card-atividade — 2026-08-27
   (pedido do Leonardo): "dividindo o espaço" também aparece no drawer de
   detalhe da atividade (clicar pra saber mais), que não tem esse wrapper,
   então a regra virou geral pra funcionar nos dois lugares. */
.linha { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); margin-top: 9px; }

/* BADGE TURMA — rótulo pill discreto pra atividades com mais de uma turma
   (ex.: mesma modalidade em dois dias/horários diferentes). */
.badge-turma {
  display: inline-flex; align-items: center; font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 10.5px; letter-spacing: .02em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px;
  margin-left: 7px; vertical-align: middle;
}
.badge-turma.sm { font-size: 8.5px; padding: 1px 6px; margin-left: 5px; }
.badge-segmento { color: var(--text-muted); background: var(--surface-2); }
/* atividade sem vaga — vermelho profundo (--accent-deep, mesmo tom do botão
   "danger") pra ficar claramente mais grave que o âmbar de lista de espera. */
.badge-lotada { color: var(--accent-deep); background: color-mix(in srgb, var(--accent-deep) 18%, var(--surface)); }
.linha .ico {
  width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; flex-shrink: 0;
}
.card-atividade .footer-card { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--border); }

.card-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 2px; z-index: 1; }
.icon-btn { border: none; background: none; cursor: pointer; font-size: 13px; padding: 4px 5px; border-radius: 8px; opacity: .6; }
.icon-btn:hover { opacity: 1; background: var(--surface-2); }

/* AGRUPAMENTO POR DIA — badge pill vermelho sólido (estilo "chip de status"
   das referências), no lugar do pill suave anterior. */
.dia-header {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 12.5px;
  color: var(--on-accent); background: linear-gradient(135deg, var(--accent-2), var(--accent-deep));
  margin: 24px 0 13px; box-shadow: 0 8px 16px -8px var(--accent-glow);
  padding: 8px 18px; border-radius: 999px;
}
.dia-header:first-child { margin-top: 4px; }

/* CALENDÁRIO SEMANAL — visual de agenda de verdade: grade horária, dia atual
   destacado, linha de "agora" cruzando a coluna de hoje (padrão Google
   Calendar/Outlook). */
.cal-wrap { display: grid; margin-top: 10px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.cal-corner { border-bottom: 1px solid var(--border); }
.cal-day-header {
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 12.5px;
  text-align: center; padding: 12px 4px; color: var(--text-2);
  border-bottom: 1px solid var(--border); border-left: 1px solid var(--border);
}
.cal-day-header.cal-hoje { color: var(--on-accent); background: linear-gradient(135deg, var(--accent-2), var(--accent-deep)); }
.cal-day-header .cal-hoje-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  margin-right: 5px; vertical-align: middle;
}
.cal-time-col { position: relative; padding-top: 6px; }
.cal-hour-label {
  font-size: 11px; color: var(--text-muted); text-align: right; padding-right: 10px;
  box-sizing: border-box; transform: translateY(-7px);
}
.cal-day-col {
  position: relative; border-left: 1px solid var(--border); min-width: 132px; padding-top: 6px;
  background-repeat: no-repeat;
}
.cal-day-col.cal-hoje { background-color: var(--accent-soft); }
/* z-index: 1 (abaixo de .cal-event) — pedido do Leonardo (2026-08-28): a
   linha vermelha de "agora" ficava por CIMA dos cards quando cruzava um
   evento, cobrindo o texto. Cards de atividade (fundo sólido) sempre
   ganham da linha agora; ela só aparece de verdade nos espaços vazios da
   grade, igual Google Calendar/Outlook. */
.cal-now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 1; }
.cal-now-line::before {
  content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.cal-event {
  position: absolute; left: 4px; right: 4px; border-left: 3px solid; border-radius: 10px;
  padding: 5px 8px; overflow: hidden; cursor: pointer; font-size: 11px;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s;
  z-index: 2;
}
.cal-event:hover { transform: translateY(-1px) scale(1.015); box-shadow: var(--shadow); z-index: 3; }
.cal-event-nome {
  font-weight: 700; font-family: 'Montserrat', sans-serif; color: var(--text);
  display: flex; align-items: center; gap: 5px; min-width: 0;
}
/* Nome da atividade quebra em várias linhas em vez de truncar numa linha só
   (pedido do Leonardo, 2026-08-21, mesmo tratamento já usado na aba
   Intervalos) — mas com um teto de linhas (-webkit-line-clamp), não
   ilimitado. Achado testando com dado real: quando 2+ atividades coincidem
   no horário, a coluna do dia divide a largura entre elas (ver
   layoutComColunas em app.js) e a caixa do evento continua com altura FIXA
   (proporcional à duração de verdade, não ao conteúdo) — sem limite de
   linhas, texto longo estourava pra baixo do card e o .cal-event
   {overflow:hidden} cortava ele em silêncio, pior que a reticência de antes
   (turma "Nursery, JK, SK, Toddler" perdia o "Toddler" sem nenhum aviso).
   line-clamp resolve isso: quebra normalmente até 2 linhas, e SÓ se ainda
   sobrar texto aí sim mostra "..." visível na última linha — nunca mais
   desaparece sem avisar. Teto de 2 (não mais que isso) de propósito: nome +
   hora + turma + local dividem a MESMA caixa de altura fixa — um teto maior
   aqui sobra menos altura pra local, que também precisa aparecer (ver
   .cal-event-local). horaPx/colMinWidth maiores (ver renderAtividades/
   renderVisaoGeral/renderVisaoGeralEF) fazem esse teto raramente ser
   atingido no caso comum (1 atividade por horário, sem divisão de coluna). */
.cal-event-nome-txt {
  flex: 1 1 auto; min-width: 0; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* badge de turma inline — só existe se alguém passar turmaEmLinhaPropria:false
   explicitamente (nenhuma chamada faz isso hoje); mantido por segurança. */
.cal-event-nome .badge-turma { display: inline-block; flex-shrink: 1; min-width: 0; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* horário — 1 linha só (o formato "HH:MM - HH:MM" cabe fácil na largura
   mínima de qualquer coluna); line-clamp em vez de nowrap só pra ter o mesmo
   fallback de "..." visível se algum dia alguém digitar um horário atípico
   bem mais longo à mão. */
.cal-event-hora {
  color: var(--text-2); font-size: 10.5px; font-weight: 600; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;
}
/* turma — bloco PRÓPRIO embaixo do horário, não a badge inline de sempre
   (turmaEmLinhaPropria é o padrão agora, ver renderAtividadesSemana): quebra
   linha em vez de truncar numa linha só, com o mesmo teto de segurança
   (line-clamp) do nome/horário acima — ver comentário grande em
   .cal-event-nome-txt pro motivo (coluna dividida por sobreposição de
   horário + caixa de altura fixa). */
.cal-event-turma-full {
  margin-top: 3px; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 10px;
  color: var(--accent); background: var(--accent-soft); border-radius: 8px;
  padding: 2px 6px; line-height: 1.3; word-break: break-word;
  /* teto de 4 (não 2, como nome/local) — a aba Intervalos combina até 5 turmas
     no mesmo campo ("Nursery, JK, SK, Fulltime, Estendido Manhã") e já usa
     horaPx/colMinWidth bem maiores (260/210) só pra isso; um teto maior aqui
     não atrapalha o caso comum de atividade (a caixa continua limitada pela
     altura real do evento de qualquer forma), só dá mais linhas de sobra
     quando o card TEM espaço de verdade. */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
/* local (espaço/sala) também não corta mais (pedido do Leonardo, 2026-08-21:
   localização é prioridade igual nome/turma/horário) — mesmo motivo de
   .cal-event-nome-txt acima. */
.cal-event-local {
  color: var(--text-muted); font-size: 10px; font-weight: 600; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.cal-event-local.local-realocado { color: #c9750f; font-weight: 700; }
/* aula cancelada hoje, na coluna de HOJE do calendário — mesmo espírito do
   .card-cancelada (ver cardAtividadeHtml): continua visível, só marcada. */
.cal-event.cal-event-cancelado { opacity: .68; background: color-mix(in srgb, var(--accent-deep) 10%, var(--surface)); }
.cal-event-cancelada-txt {
  color: var(--accent-deep); font-size: 10px; font-weight: 700; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* STATS — cards com badge circular + valor grande, no estilo dos KPIs das
   referências (analytics/power-bi). */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
  transition: transform .15s, box-shadow .15s;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-value { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 25px; letter-spacing: -.02em; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.badge-count {
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 12px;
  background: var(--accent-soft); color: var(--dot, var(--accent)); padding: 4px 11px; border-radius: 999px;
}
/* lista de espera — âmbar fixo (--espera-bg/--espera-text, não usa --dot)
   pra ficar visualmente diferente do badge de "N alunos" mesmo quando as
   duas aparecem juntas no card. */
.badge-espera { background: var(--espera-bg); color: var(--espera-text); }
.tel-link { color: var(--text-2); text-decoration: none; }
.tel-link:hover { color: var(--dot, var(--accent)); text-decoration: underline; }

/* ALUNOS LIST */
.lista-alunos { display: flex; flex-direction: column; gap: 9px; }
.row-aluno {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow .12s, border-color .12s, transform .12s;
}
.row-aluno:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.row-aluno .info-aluno-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-aluno .info-aluno { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-aluno .nome-aluno { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-aluno .turma-aluno { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.dots { display: flex; gap: 5px; align-items: center; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border) inset; flex-shrink: 0; }

/* PAINEL LATERAL (drawer) */
.overlay { position: fixed; inset: 0; background: rgba(30,10,10,0.40); display: none; z-index: 20; backdrop-filter: blur(1px); }
.overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  background: var(--surface); box-shadow: -16px 0 48px rgba(30,10,10,0.22);
  transform: translateX(100%); transition: transform .22s ease; z-index: 21;
  overflow-y: auto; padding: 24px;
}
.drawer.open { transform: translateX(0); }
.drawer .close-btn {
  border: none; background: var(--surface-2); width: 32px; height: 32px; border-radius: 999px;
  cursor: pointer; font-size: 14px; color: var(--text-2); float: right; transition: background .12s, color .12s;
}
.drawer .close-btn:hover { background: var(--accent-soft); color: var(--accent); }
.drawer h3 { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 19px; margin: 4px 0 2px; clear: both; }
.drawer .drawer-sub { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 18px; line-height: 1.5; }
.lista-mini { display: flex; flex-direction: column; gap: 8px; }
.item-mini {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border-radius: 12px; padding: 10px 13px; font-size: 13.5px;
}
.item-mini-link { cursor: pointer; transition: background .12s; }
.item-mini-link:hover { background: var(--accent-soft); }
.chip-atividade {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2);
  border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 8px;
}
.chip-atividade .dot { width: 9px; height: 9px; }
.chip-atividade .chip-info { display: flex; flex-direction: column; gap: 1px; }
.chip-atividade .chip-nome { font-weight: 700; }
.chip-atividade .chip-detalhe { color: var(--text-2); font-size: 13px; font-weight: 600; }

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

/* RELATÓRIOS — barras horizontais simples (sem lib de gráfico): rótulo +
   trilho + valor direto no fim da barra, nunca só cor/hover pra ler o
   número. Trilho em --surface-2 (mesmo "estado vazio" já usado em check-pill)
   e preenchimento arredondado em pill, consistente com o resto do app. */
.relatorio-secao { margin-bottom: 34px; }
.relatorio-titulo { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 16px; margin-bottom: 3px; }
.relatorio-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; max-width: 640px; }
.barra-linha { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.barra-label {
  width: 190px; flex-shrink: 0; font-size: 13px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.barra-trilho { flex: 1; height: 20px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.barra-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.barra-valor { width: 96px; flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
@media (max-width: 760px) {
  .barra-label { width: 110px; font-size: 12px; }
  .barra-valor { width: 72px; font-size: 11.5px; }
}

/* LOGIN */
.login-box {
  max-width: 370px; margin: 90px auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); padding: 32px 28px; box-shadow: var(--shadow-lg); text-align: center;
  position: relative;
}
.login-box .login-mark {
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.login-box .login-mark .logo-icon-svg { width: 64px; height: 64px; display: block; }
.login-box h2 { font-family: 'Montserrat', sans-serif; font-weight: 800; margin-bottom: 4px; }
.login-box p { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }
.login-box input {
  width: 100%; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 14px; margin-bottom: 11px;
  font-family: 'Montserrat', sans-serif;
}
.login-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-box .btn { margin-top: 4px; box-shadow: 0 12px 24px -10px var(--accent-glow); }

/* campo de senha com botão de mostrar/ocultar (2026-08-20) — margem que era
   do input em si passa pro wrapper (senão dobrava, um dentro do outro), e o
   input ganha padding à direita pra não escrever embaixo do ícone. */
.password-field { position: relative; margin-bottom: 11px; }
.password-field input { margin-bottom: 0; padding-right: 44px; }
.toggle-senha {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--text-muted); padding: 8px 10px; border-radius: 999px; transition: background .12s, color .12s;
}
.toggle-senha:hover { color: var(--accent); background: var(--accent-soft); }

.btn {
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13.5px; border: none;
  border-radius: 999px; padding: 11px 20px; cursor: pointer; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-2), var(--accent-deep));
  box-shadow: 0 8px 18px -8px var(--accent-glow);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.secondary:hover { background: var(--surface); }
.btn.danger { background: linear-gradient(135deg, var(--accent-deep), #6f0407); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.error-msg { color: #e0393c; font-size: 12.5px; margin-top: -4px; margin-bottom: 8px; min-height: 16px; font-weight: 600; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--surface-2); }

/* Relatório de disponibilidade (aba Espaços) — mesma tabela .admin-table, só
   com célula própria pra caber os chips de horário livre lado a lado quando
   um espaço tem mais de um intervalo disponível no mesmo dia. Cada chip já
   É a informação (o intervalo) — sem repetir "Disponível" por extenso em
   cada um, que só virava ruído em espaços com muita janela curta (Ginásio). */
#tabelaDisponibilidade td { vertical-align: top; min-width: 130px; }
#tabelaDisponibilidade td:first-child { min-width: 110px; white-space: nowrap; }
.disp-janelas { display: flex; flex-wrap: wrap; gap: 4px; }
/* verde = livre, vermelho = ocupado (pedido do Beto 2026-08-26) — antes o chip
   livre usava --accent-soft/--accent (vermelho de marca), confundia "livre"
   com "ocupado" à primeira vista. Livre ganha cor própria (verde); ocupado
   continua a mesma --accent-soft/--accent que já existia (é literalmente a
   cor do print de referência — nada a trocar aí, só o livre estava errado). */
.disp-chip {
  background: var(--status-livre-bg); color: var(--status-livre-text); font-weight: 700;
  font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
/* chip clicável (só na coluna de HOJE) — "editar" um horário livre pra
   reservar o espaço (pedido do Leonardo 2026-08-16). Borda tracejada avisa
   que é interativo sem precisar de legenda própria. */
.disp-chip-editavel { cursor: pointer; border: 1px dashed var(--status-livre-text); transition: transform .1s, box-shadow .1s; }
.disp-chip-editavel:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
/* chip de reserva ativa — mesma --accent-soft/--accent de sempre (era
   --espera-bg/laranja antes, virava ambíguo com a lista de espera de
   verdade) + cadeado, sinaliza "ocupado" à primeira vista; clique desfaz. */
.disp-chip-reservado { background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.disp-ocupado { color: var(--text-muted); font-size: 13px; }
/* nota "dividindo o espaço" no card da Agora (não é aviso/erro — Ginásio é
   compartilhado por natureza, dia de chuva realoca de propósito pro mesmo
   espaço coberto) — cor neutra, não a de status/ocupado. */
.linha-compartilhado { color: var(--text-muted); font-weight: 600; }

/* Agenda da Sala (3ª sub-aba de Espaços) — espelho do Google Calendar da sala
   de reuniões, pedido do Beto 2026-08-26. Só leitura, iframe público do
   Google (sem credencial) — quem atualiza o calendário, atualiza aqui. */
#agendaSalaWrap iframe {
  width: 100%; height: 640px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.form-grid.one-col { grid-template-columns: 1fr; }
/* 2 colunas apertam demais os campos pra digitar no celular — 1 coluna só. */
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; font-weight: 600; }
.form-grid input, .form-grid select {
  width: 100%; padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13.5px; font-family: 'Montserrat', sans-serif;
}
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.card-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; cursor: pointer; transition: background .12s, border-color .12s;
}
.check-pill.checked { border-color: var(--dot); background: var(--accent-soft); }
/* atividade cheia que esse aluno ainda não tem — não dá pra marcar por aqui
   (ver bloquearCheias em renderChecklistAtividades), só pela tela da
   atividade, que oferece lista de espera. */
.check-pill.travada { opacity: .55; cursor: not-allowed; }

/* CHECKLIST AGRUPADO — cada atividade (nome+segmento) vira um grupo fechado
   por padrão; expande ao clicar no cabeçalho pra escolher o(s) horário(s). */
.check-group {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  margin-bottom: 8px; overflow: hidden;
}
.check-group-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; user-select: none;
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px;
}
.check-group-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-group-count { font-size: 11px; font-weight: 700; color: var(--dot, var(--accent)); }
.check-group-chev { font-size: 10px; color: var(--text-muted); transition: transform .15s; }
.check-group.aberto .check-group-chev { transform: rotate(180deg); }
.check-group-body { display: none; padding: 0 12px 12px; }
.check-group.aberto .check-group-body { display: block; }
.check-group-body .check-list { gap: 6px; }
.action-icons { display: flex; gap: 6px; }
.action-icons button { border: none; background: none; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 8px; }
.action-icons button:hover { background: var(--surface-2); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--page); padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

a.plain { color: inherit; text-decoration: none; }
.pill-link {
  font-size: 12.5px; color: var(--text-muted); text-decoration: none; border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px; transition: color .12s, border-color .12s;
}
.pill-link:hover { color: var(--accent); border-color: var(--accent); }

/* =====================================================================
   MOBILE — bloco movido pro final do arquivo de propósito (2026-08-07).
   Achado testando em viewport real (iframe 390×844): metade destas regras
   nunca funcionou desde o commit original que as criou, porque .stats-row/
   .grid-atividades/.form-grid têm sua regra BASE declarada mais abaixo no
   arquivo — em empate de especificidade (mesma classe simples dos dois
   lados), quem vem depois no arquivo ganha, media query dentro ou fora
   não muda isso. Só .app-shell/.sidebar/.brand/.side-nav/.sidebar-footer/
   .theme-toggle funcionavam (a base delas já estava antes deste bloco).
   Deixar este bloco sempre por último evita esse bug se acontecer de novo.
   ===================================================================== */
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: column;
    align-items: stretch; gap: 10px; padding: 12px 14px;
  }
  .brand { justify-content: flex-start; }
  /* .side-nav/.side-nav button NÃO são redeclarados aqui de propósito —
     achado 2026-08-21 (pedido do Leonardo, "no mobile as coisas cortam um
     pouco de informação ainda"): esta regra costumava ter "flex:1" no botão,
     que brigava com o flex-shrink:0/white-space:nowrap do bloco de cima (ver
     "Nav vira uma faixa rolável...") — como esse bloco daqui vem depois no
     arquivo (e portanto ganha o empate de especificidade, é o motivo de todo
     este bloco existir, ver comentário no topo), o "flex:1" vencia e esticava
     cada aba pra dividir a largura da tela igualmente. Com só 3-4 abas cabia
     razoável, mas o app cresceu pra 10 abas — "Fundamental" já saía cortado
     na borda da tela sem nenhum indício visual de que dava pra arrastar pra
     ver o resto (tecnicamente scrollava, `overflow-x:auto` nunca saiu do
     bloco de cima, mas sem affordance nenhuma parecia quebrado). Não
     redeclarar aqui deixa o comportamento do bloco de cima valer inteiro:
     abas com largura própria (do tamanho do texto) numa faixa que rola. */
  .sidebar-footer { margin-top: 0; display: flex; gap: 8px; }
  #perfilAtual { display: none; } /* nome do usuário logado some no mobile, sem espaço pra ele */
  .theme-toggle { width: auto; flex: 1; text-align: center; padding: 9px 10px; }
  .segmento-toggle button { font-size: 13px; padding: 10px 8px; }
}

@media (max-width: 480px) {
  .wrap { padding: 20px 14px 70px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-tile:last-child { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-atividades { grid-template-columns: 1fr; }
  .intro-mark .intro-logo-svg { width: 120px; }
}
