/* PedConecta - ajustes de tela do app instalável (PWA). Adicionado em nov/2026.
 * Os avisos (instalar, notificações) e a barra do celular são desenhados pelo app.js, isolados do CSS das páginas. */

/* App aberto pela tela de início: respeita o entalhe/ilha do celular */
@media (display-mode: standalone) {
  html:not([data-perfil="admin"]):not([data-perfil="coordenador"]):not([data-perfil="professor"]):not([data-perfil="atendente"]) body {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

/* Administração, coordenação, professores e atendentes no celular:
   o menu lateral vira uma gaveta que abre pelo botão da barra superior */
@media (max-width: 820px) {
  html[data-perfil="admin"] body,
  html[data-perfil="coordenador"] body,
  html[data-perfil="professor"] body,
  html[data-perfil="atendente"] body {
    padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }

  html[data-perfil="admin"] .sidebar,
  html[data-perfil="coordenador"] .sidebar,
  html[data-perfil="professor"] .sidebar,
  html[data-perfil="atendente"] .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    width: min(290px, 84vw) !important;
    max-width: none !important;
    z-index: 1004 !important;
    overflow-y: auto !important;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  }
  html.ped-menu-aberto .sidebar { transform: none !important; }

  /* O conteúdo ocupa a tela toda (antes ficava espremido ao lado do menu) */
  html[data-perfil="admin"] body > .container,
  html[data-perfil="coordenador"] body > .container,
  html[data-perfil="professor"] body > .container,
  html[data-perfil="atendente"] body > .container,
  html[data-perfil="admin"] body > main,
  html[data-perfil="coordenador"] body > main,
  html[data-perfil="professor"] body > main,
  html[data-perfil="atendente"] body > main,
  html[data-perfil="admin"] body > .main-content,
  html[data-perfil="coordenador"] body > .main-content,
  html[data-perfil="professor"] body > .main-content,
  html[data-perfil="atendente"] body > .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box;
  }

  /* Tabelas largas rolam de lado em vez de estourar a tela */
  html[data-perfil="admin"] table,
  html[data-perfil="coordenador"] table,
  html[data-perfil="professor"] table,
  html[data-perfil="atendente"] table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Atendimento: contador de conversas esperando resposta (menu da equipe) e aviso no chat das famílias */
.sidebar a .ped-badge {
  display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px;
  background: #ffb21e; color: #14233a; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center;
  vertical-align: middle; box-sizing: border-box;
}
.ped-chat-aviso {
  margin: 8px 0 10px; padding: 8px 12px; border-radius: 10px; background: #e8f1fc; color: #14233a;
  font-size: 13px; line-height: 1.4;
}
.ped-chat-aviso i { margin-right: 6px; color: #0d4a94; }

/* ---------------------------------------------------------------- fotos das agendas (abrem na galeria, galeria.js) */
.ped-fotos { display: grid; gap: 6px; margin: 12px 0 4px; }
.ped-fotos-grade { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.ped-fotos-1 { grid-template-columns: 1fr; }
.ped-fotos-2, .ped-fotos-4 { grid-template-columns: 1fr 1fr; }
.ped-fotos-3 { grid-template-columns: 2fr 1fr; }
.ped-foto {
  position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 12px;
  background: #e3ebf3; cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.ped-fotos-1 .ped-foto { aspect-ratio: 16 / 10; max-height: 360px; width: 100%; }
.ped-fotos-2 .ped-foto, .ped-fotos-4 .ped-foto { aspect-ratio: 4 / 3; }
.ped-fotos-3 .ped-foto { aspect-ratio: 4 / 3; }
.ped-fotos-3 .ped-foto:first-child { grid-row: span 2; aspect-ratio: auto; }
.ped-foto[hidden] { display: none !important; }
.ped-foto img {
  display: block; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
  margin: 0 !important; border-radius: 0 !important; object-fit: cover; transition: transform .25s ease;
}
.ped-foto:hover img { transform: scale(1.04); }
.ped-foto:focus-visible { outline: 3px solid #ffb21e; outline-offset: 2px; }
.ped-foto-mais {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(13, 59, 102, .55); color: #fff; font-size: 26px; font-weight: 800; letter-spacing: .5px;
}
.ped-arquivos { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.ped-arquivo {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f4f8fc;
  border: 1px solid #dde6f0; font-size: 14px; color: #14233a;
}
.ped-arquivo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ped-arquivo i { color: #0d4a94; font-size: 18px; }
.ped-arquivo a { color: #0d4a94; font-weight: 700; text-decoration: none; }
.ped-capa-foto { display: block; cursor: zoom-in; }
.ped-anexos-agenda { display: block !important; }
.ped-anexos-agenda > h4 { margin: 0 0 4px; font-size: 16px; color: #14233a; }
.ped-anexos-agenda .ped-anexos-dica { margin: 0; font-size: 13px; color: #4a5b70; }

/* ---------------------------------------------------------------- mural (famílias e alunos) */
.ped-mural-secao { margin: 26px 0 10px; max-width: 780px; }
.ped-mural-cabeca { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ped-mural-cabeca h2 { margin: 0; font-size: 22px; color: #14233a; }
.ped-mural-cabeca h2 i { color: #0d4a94; margin-right: 4px; }
.ped-mural-contador {
  padding: 3px 10px; border-radius: 999px; background: #ffb21e; color: #14233a; font-size: 13px; font-weight: 800;
}
.ped-mural-vertudo { margin-left: auto; color: #0d4a94; font-weight: 700; text-decoration: none; font-size: 15px; }
.ped-mural-filtros, .ped-mural-filhos {
  display: flex; gap: 8px; margin: 0 0 12px; padding: 2px 0 4px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ped-mural-filtros::-webkit-scrollbar, .ped-mural-filhos::-webkit-scrollbar { display: none; }
.ped-mural-filtro, .ped-mural-filho {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px;
  background: #fff; color: #14233a; border: 1.5px solid #c9d6e3; font-size: 15px; font-weight: 700;
  text-decoration: none; white-space: nowrap; transition: background .15s ease, border-color .15s ease;
}
.ped-mural-filtro:hover, .ped-mural-filho:hover { border-color: #1565c0; }
.ped-mural-filtro.on, .ped-mural-filho.on { background: #0d4a94; border-color: #0d4a94; color: #fff; }
.ped-mural-filho { padding: 7px 13px; font-size: 14px; background: #f4f8fc; }
.ped-mural-explica { margin: -4px 0 14px; font-size: 14px; color: #4a5b70; }
.ped-mural-lista { display: flex; flex-direction: column; gap: 14px; }
.ped-mural-item {
  background: #fff; border-radius: 16px; padding: 16px 18px 12px; text-align: left;
  box-shadow: 0 0 0 1px #dde6f0, 0 6px 18px rgba(13, 59, 102, .06); border-left: 5px solid #1565c0;
}
.ped-mural-item.ped-mural-individual { border-left-color: #ffb21e; }
.ped-mural-item.ped-mural-escola { border-left-color: #188038; }
.ped-mural-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.ped-mural-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: #e8f1fc; color: #0d4a94; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; font-size: 12px;
}
.ped-mural-individual .ped-mural-chip { background: #fff3d6; color: #8a5300; }
.ped-mural-escola .ped-mural-chip { background: #e7f5ec; color: #0d652d; }
.ped-mural-rotulo { color: #14233a; font-weight: 700; }
.ped-mural-novo { padding: 3px 9px; border-radius: 999px; background: #ffb21e; color: #14233a; font-weight: 800; font-size: 12px; }
.ped-mural-data { margin-left: auto; color: #4a5b70; white-space: nowrap; }
.ped-mural-titulo { margin: 10px 0 2px !important; font-size: 18px !important; line-height: 1.3; color: #14233a; }
.ped-mural-titulo a { color: inherit; text-decoration: none; }
.ped-mural-titulo a:hover { text-decoration: underline; }
.ped-mural-dia { margin: 4px 0 0; font-size: 14px; color: #0d4a94; font-weight: 700; }
.ped-mural-dia i { margin-right: 4px; }
.ped-mural-texto { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: #3d4b5c; overflow-wrap: anywhere; }
.ped-mural-rodape {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #edf2f7; font-size: 14px; color: #4a5b70;
}
.ped-mural-para i { margin-right: 4px; color: #8a9bb0; }
.ped-mural-abrir { margin-left: auto; color: #0d4a94; font-weight: 800; text-decoration: none; padding: 6px 2px; }
.ped-mural-lido {
  margin-left: auto; border: 1.5px solid #0d4a94; background: #fff; color: #0d4a94; border-radius: 999px;
  padding: 7px 14px; font-weight: 800; font-size: 14px; cursor: pointer; font-family: inherit;
}
.ped-mural-lido:hover { background: #e8f1fc; }
.ped-mural-lido:disabled { opacity: .6; cursor: default; }
.ped-mural-lido-ok { margin-left: auto; color: #0d652d; font-weight: 700; }
.ped-mural-vazio {
  margin: 0; padding: 22px 18px; border-radius: 16px; background: #fff; color: #4a5b70; text-align: center;
  box-shadow: 0 0 0 1px #dde6f0; line-height: 1.5;
}
.ped-mural-mais { text-align: center; padding: 6px 0 4px; }
.ped-mural-mais a, .ped-mural-todas {
  display: inline-block; padding: 11px 20px; border-radius: 12px; background: #0d4a94; color: #fff;
  font-weight: 800; text-decoration: none;
}
.ped-mural-todas { margin-top: 14px; }
@media (max-width: 600px) {
  .ped-mural-filtros, .ped-mural-filhos { gap: 6px; }
  .ped-mural-filtro { padding: 8px 11px; font-size: 14px; gap: 5px; }
  .ped-mural-item { padding: 14px 14px 10px; border-radius: 14px; }
  .ped-mural-titulo { font-size: 17px !important; }
  .ped-mural-data { margin-left: 0; width: 100%; order: 5; }
}
.ped-mural-aviso { margin-bottom: 14px; background: #fff3d6; color: #8a5300; box-shadow: 0 0 0 1px #ffd99a; text-align: left; }
