:root{
  --verde: #2f5233;
  --verde-claro: #eaf5ec;
  --terracota: #c1602e;
  --pergaminho: #f7f1e3;
  --texto: #2b2b26;
  --borda: #d8cfb8;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--pergaminho);
  color: var(--texto);
}
header{
  padding: 2.6rem 1.5rem 1.8rem;
  text-align:center;
  border-bottom: 3px double var(--verde);
  background: linear-gradient(180deg, #fbf7ec, var(--pergaminho));
  position: relative;
}
header h1{
  margin:0;
  font-size: 2rem;
  color: var(--verde);
  letter-spacing: 0.02em;
}
header p{
  margin: 0.6rem 0 0;
  color:#6b6350;
  font-style: italic;
  font-size: 1rem;
}
.nav-links{
  position:absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 0.85rem;
}
.nav-links a{
  color: var(--verde);
  text-decoration:none;
  border-bottom: 1px dotted var(--verde);
}
.nav-links a:hover{ color: var(--terracota); border-color: var(--terracota); }
.breadcrumb{
  max-width: 920px;
  margin: 1.4rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.85rem;
}
.breadcrumb a{ color: var(--verde); text-decoration:none; }
.breadcrumb a:hover{ color: var(--terracota); }
main{
  max-width: 920px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 4rem;
}
.filtro{
  display:flex;
  justify-content: center;
  margin-bottom: 2.2rem;
}
.filtro input{
  width: 100%;
  max-width: 420px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--borda);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.grupo{ margin-bottom: 2.6rem; }
.grupo h2{
  color: var(--terracota);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--borda);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}
.turma-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.turma-card{
  display:block;
  text-decoration:none;
  background:#fff;
  border: 1px solid var(--borda);
  border-left: 5px solid var(--verde);
  border-radius: 8px;
  padding: 1.2rem 1.3rem;
  color: var(--texto);
  transition: transform .12s ease, box-shadow .12s ease;
}
.turma-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(47,82,51,0.12);
  border-left-color: var(--terracota);
}
.turma-card.vazia{
  opacity: 0.55;
  border-left-color: var(--borda);
  cursor: default;
}
.turma-card.vazia:hover{ transform:none; box-shadow:none; border-left-color: var(--borda); }
.turma-card .nome{
  font-size: 1.25rem;
  font-weight:bold;
  color: var(--verde);
}
.turma-card .contagem{
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color:#8a8267;
}
.material-card{
  background: #fff;
  border: 1px solid var(--borda);
  border-left: 4px solid var(--verde);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.9rem;
}
.material-card .tema{
  font-size: 1.08rem;
  font-weight: bold;
  color: var(--verde);
  margin-bottom: 0.4rem;
}
.material-card .resumo{
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--texto);
  margin-bottom: 0.8rem;
}
.btn{
  display:inline-block;
  text-decoration:none;
  color:#fff;
  background: var(--verde);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.88rem;
  font-family: Georgia, serif;
  border: none;
  cursor: pointer;
}
.btn:hover{ background: var(--terracota); }
.btn.secundario{
  background: transparent;
  color: var(--verde);
  border: 1px solid var(--verde);
}
.btn.secundario:hover{ color: var(--terracota); border-color: var(--terracota); background:transparent; }
.btn.perigo{ background:#a33; }
.btn.perigo:hover{ background:#822; }
.vazio{
  text-align:center;
  color:#8a8267;
  font-style: italic;
  padding: 2rem 0;
}
footer{
  text-align:center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color:#8a8267;
  border-top: 1px solid var(--borda);
}
footer a{ color:#8a8267; }

/* Painel / forms */
.form-box{
  background:#fff;
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 480px;
  margin: 0 auto 2rem;
}
.form-box h2{ margin-top:0; color: var(--verde); font-size: 1.2rem; }
.campo{ margin-bottom: 1rem; }
.campo label{ display:block; font-size: 0.85rem; margin-bottom: 0.3rem; color:#6b6350; }
.campo input, .campo textarea, .campo select{
  width:100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--borda);
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.95rem;
  background:#fffdf8;
}
.campo textarea{ min-height: 70px; resize: vertical; }
.msg{ font-size: 0.88rem; margin-top: 0.6rem; }
.msg.erro{ color: #a33; }
.msg.ok{ color: var(--verde); }
.toggle-auth{
  text-align:center;
  font-size: 0.88rem;
  margin-top: 0.8rem;
}
.toggle-auth a{ color: var(--verde); cursor:pointer; text-decoration:underline; }
.painel-header{
  display:flex;
  justify-content: space-between;
  align-items:center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tabela-admin{
  width:100%;
  border-collapse: collapse;
  background:#fff;
  border: 1px solid var(--borda);
  border-radius: 8px;
  overflow:hidden;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}
.tabela-admin th, .tabela-admin td{
  text-align:left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--borda);
}
.tabela-admin th{
  background: var(--verde-claro);
  color: var(--verde);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tabela-admin tr:last-child td{ border-bottom:none; }
.aviso{
  background: #fff7e6;
  border: 1px solid #e8c98a;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

/* Intro da home */
.intro{
  max-width: 640px;
  margin: 0 auto 2.2rem;
  text-align:center;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #4a4536;
}

/* Pills de turma */
.pills{
  display:flex;
  flex-wrap:wrap;
  gap: 0.55rem;
  justify-content:center;
  margin-bottom: 2.4rem;
}
.pill{
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background:#fff;
  color: var(--verde);
  font-family: inherit;
  font-size: 0.92rem;
  cursor:pointer;
  transition: all .12s ease;
}
.pill:hover{ border-color: var(--verde); }
.pill.ativo{ background: var(--verde); color:#fff; border-color: var(--verde); }
.pill.vazia{ opacity:0.5; }
.pills-grupo-rotulo{
  width:100%;
  text-align:center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a8267;
  margin: 0.4rem 0 -0.1rem;
}
.pills-grupo-rotulo:first-child{ margin-top:0; }

/* Linha do tempo */
.timeline{
  position: relative;
  padding-left: 1.7rem;
  max-width: 720px;
  margin: 0 auto;
}
.timeline::before{
  content:'';
  position:absolute;
  left: 0.42rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--borda);
}
/* Acordeão de período (details/summary nativo) */
.periodo-grupo{
  max-width: 720px;
  margin: 0 auto 0.9rem;
}
.periodo-titulo{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--borda);
  border-left: 5px solid var(--terracota);
  border-radius: 8px;
  padding: 0.95rem 1.2rem;
  color: var(--terracota);
  font-size: 1.05rem;
  font-weight: bold;
  transition: box-shadow .12s ease;
}
.periodo-titulo::-webkit-details-marker{ display:none; }
.periodo-titulo:hover{ box-shadow: 0 2px 10px rgba(193,96,46,0.12); }
.periodo-titulo::after{
  content: '▸';
  font-size: 0.9rem;
  color: var(--terracota);
  transition: transform .15s ease;
  flex-shrink: 0;
}
.periodo-grupo[open] .periodo-titulo::after{ transform: rotate(90deg); }
.periodo-titulo .contagem-periodo{
  font-size: 0.76rem;
  font-weight: normal;
  color: #8a8267;
  margin-right: auto;
  margin-left: 0.7rem;
}
.periodo-grupo .timeline{
  padding-top: 1.1rem;
  padding-bottom: 0.3rem;
}
.timeline-item{
  position: relative;
  background:#fff;
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.9rem;
}
.timeline-item::before{
  content:'';
  position:absolute;
  left: -1.7rem;
  top: 1.15rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius:50%;
  background: var(--borda);
  border: 2px solid var(--pergaminho);
}
.timeline-item.liberado::before{ background: var(--verde); }
.timeline-item.bloqueado::before{ background: var(--terracota); }
.bncc-badges{
  display:flex;
  flex-wrap:wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.bncc-badge{
  display:inline-block;
  font-size: 0.72rem;
  font-family: monospace;
  background: var(--verde-claro);
  color: var(--verde);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.timeline-item .tema{
  line-height: 1.4;
}
.status-em-breve{
  display:inline-block;
  font-size: 0.82rem;
  color: #8a8267;
  font-style: italic;
}
.status-bloqueado{
  display:inline-block;
  font-size: 0.82rem;
  color: var(--terracota);
}
.status-bloqueado a{ color: var(--terracota); font-weight:bold; }
