
    body {
      margin: 0;
      font-family: "Segoe UI", sans-serif;
      background: #f5f7fa;
      display: flex;
      height: 100vh;
      flex-direction: column; /* <-- importante para o header funcionar */
    }

    /* ========== CABEÇALHO ========== */
    #headerPainel{
      display:flex;
      align-items:center;
      gap:15px;
      padding:15px 22px;
      background:white;
      border-bottom:1px solid #dcdcdc;
      position: relative;
      z-index:10;
    }

    #headerPainel img{
      height:60px;
      width:60px;
      border-radius:8px;
      object-fit:cover;
      background:#eee;
      display:none; /* aparece só quando carregar logo */
    }

    #tituloBiblioteca{
      font-size:22px;
      font-weight:700;
      color:#0e4d92;
      margin:0;
    }

    #tituloEscola{
      font-size:14px;
      color:#555;
      margin:3px 0 0 0;
    }

    /* ========== SIDEBAR ========== */
    .sidebar {
      width: 240px;
      background: #0e4d92;
      color: white;
      display: flex;
      flex-direction: column;
      padding: 18px;
    }

    .sidebar h2 {
      margin: 0;
      font-size: 19px;
      margin-bottom: 10px;
    }

    .sidebar small {
      opacity: 0.8;
      font-size: 13px;
    }

    .sidebar button {
      background: white;
      border: none;
      padding: 10px;
      margin-top: 10px;
      width: 100%;
      border-radius: 6px;
      cursor: pointer;
      font-size: 15px;
      transition: 0.2s;
    }

    .sidebar button:hover {
      background: #dce6ff;
      transform: translateX(4px);
    }

    #btnVoltarSecretaria {
      display: none;
      margin-top: 20px;
      background: #ff6363;
      color: white;
      font-weight: bold;
    }

    /* ========== ÁREA PRINCIPAL ========== */
   main {
  flex: 1;
  background: #f0f4ff; /* azul suave */
  padding: 25px;
  overflow-y: auto;
}

/* cartão de conteúdo padrão das páginas */
.section{
  background:white;
  padding:22px;
  border-radius:10px;
  box-shadow:0 4px 10px rgba(0,0,0,.05);
  max-width:1100px;
  margin:auto;
}

    .section {
      display: none;
    }

    .section.active {
      display: block;
    }

    .btn-acao {
      padding: 10px;
      border-radius: 6px;
      cursor: pointer;
      border: none;
      margin: 5px;
      background: #0e4d92;
      color: white;
      transition: 0.2s;
    }

    .btn-acao:hover {
      opacity: 0.85;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 15px;
    }

    table th, table td {
      border: 1px solid #ccc;
      padding: 8px;
      font-size: 14px;
    }

    table th {
      background: #e4e4e4;
    }

    #toast {
      position: fixed;
      bottom: 20px;
      right: 20px;
      background: #333;
      padding: 12px 18px;
      border-radius: 6px;
      color: white;
      display: none;
      font-size: 14px;
    }

    .styled-table {
  width: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border-collapse: collapse;
}

.styled-table th {
  background: #0e4d92;
  color: white;
  padding: 10px;
}

.styled-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.book-cover-thumb {
  width: 40px;
  height: 55px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.status-tag {
  padding: 4px 8px;
  color: white;
  border-radius: 6px;
  font-size: .8rem;
}

.status-disponivel {
  background: #4CAF50;
}

.status-emprestado {
  background: #FF9800;
}

.status-reservado {
  background: #D32F2F;
}
/* ================= 📚 BIBLIOTECA — Cards Modernos ================= */

.catalogo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.catalogo-card {
  background: white;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.catalogo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

/* Capa do livro */
.catalogo-capa {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.catalogo-titulo {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.catalogo-autor {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.catalogo-status {
  font-size: 12px;
  margin-bottom: 8px;
}

.status-disponivel {
  color: #16a34a;
}

.status-emprestado {
  color: #dc2626;
}

.status-reservado {
  color: #f59e0b;
}

.catalogo-acoes {
  margin-top: auto;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.catalogo-acoes button {
  padding: 5px 8px;
  font-size: 12px;
}

/* Limite da sinopse */
.catalogo-card .sinopse {
  font-size:.82rem;
  color:#444;
  line-height:1.2rem;
  max-height:55px;             /* ↓ Limita o texto */
  overflow:hidden; 
  text-overflow:ellipsis;
  margin-top:6px;
}

/* Botões dentro do card */
.catalogo-card button {
  margin-top:auto;
  padding:7px 10px;
  width:100%;
  border:none;
  border-radius:6px;
  font-size:.85rem;
  cursor:pointer;
  transition:.2s;
}

.btn-editar-catalogo{
  background:#444;
  color:white;
  margin-top:8px;
}
.btn-editar-catalogo:hover{background:#222;}

.sinopse {
  font-size: 0.75rem;
  color: #555;
  text-align: justify;
  margin-top: 6px;
  min-height: 40px;
}

/* Modal */

.modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 400px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.btn-editar {
  width: 100%;
  background: #444;
  color: white;
  padding: 6px;
  border-radius: 6px;
  margin-top: 6px;
  cursor: pointer;
  border: none;
  font-size: 0.8rem;
  transition: 0.2s;
}

.btn-editar:hover {
  background: #222;
}

#sec-emprestimos table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 8px;
  font-size:15px;
}

#sec-emprestimos thead tr{
  background:#4c6ef5;
  color:white;
}

#sec-emprestimos th{
  padding:10px;
  border-radius:6px 6px 0 0;
}

#sec-emprestimos .linha-card{
  background:white;
  box-shadow:0 2px 6px rgba(0,0,0,0.10);
  transition:0.2s;
}

#sec-emprestimos .linha-card:hover{
  transform:scale(1.01);
}

#sec-emprestimos td{
  padding:12px;
}

.tag-status{
  padding:4px 8px;
  border-radius:6px;
  font-weight:bold;
  color:white;
}

.tag-ativo{background:#3498db;}
.tag-devolvido{background:#2ecc71;}
.tag-atraso{background:#e74c3c;}

.btn-devolver-modern{
  background:#ff9800;
  border:0;
  padding:6px 10px;
  border-radius:6px;
  font-weight:bold;
  cursor:pointer;
  color:white;
  transition:.2s;
}

.btn-devolver-modern:hover{
  background:#f57c00;
}

/* ===== Modal Moderno ===== */

.modal-modern{
  position: fixed;
  inset:0;
  background: rgba(0,0,0,.6);
  display:none;               /* 🔥 impede que abra sozinho */
  justify-content:center;
  align-items:center;
  z-index:9999;
}

.modal-modern:not(.hidden){
  display:flex;               /* 🔥 só mostra quando remover hidden */
}

.modal-content-modern{
  background:#fff;
  padding:25px;
  width:380px;
  border-radius:12px;
  box-shadow:0 4px 14px rgba(0,0,0,.25);
  animation:zoomIn .25s ease;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.modal-content-modern h2{
  margin:0 0 10px;
  text-align:center;
  color:#3f51b5;
}

.modal-content-modern select,
.modal-content-modern input{
  padding:10px;
  width:100%;
  border-radius:6px;
  border:1px solid #ccc;
  font-size:15px;
}

.modal-buttons{
  display:flex;
  justify-content:space-between;
  margin-top:10px;
}

.btn-modern{
  padding:8px 14px;
  border:none;
  border-radius:6px;
  font-weight:bold;
  color:#fff;
  cursor:pointer;
  transition:.2s;
}

.btn-modern.confirmar{background:#4caf50;}
.btn-modern.confirmar:hover{background:#449d48;}

.btn-modern.cancelar{background:#e74c3c;}
.btn-modern.cancelar:hover{background:#c0392b;}

@keyframes zoomIn{
  from{transform:scale(.7);opacity:0;}
  to{transform:scale(1);opacity:1;}
}

#sec-alunos table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 6px;
  font-size:15px;
}

#sec-alunos thead tr{
  background:#1976d2;
  color:white;
}

#sec-alunos tbody tr{
  background:white;
  box-shadow:0 2px 6px rgba(0,0,0,0.10);
  transition:.2s;
}

#sec-alunos tbody tr:hover{
  transform:scale(1.01);
}

#sec-alunos td{
  padding:10px;
}

.btn-editar-aluno{
  border:none;
  background:#3498db;
  color:white;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
}
.btn-editar-aluno:hover{background:#2c80ba;}

.btn-excluir-aluno{
  border:none;
  background:#e74c3c;
  color:white;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
}
.btn-excluir-aluno:hover{background:#c0392b;}

#sec-turmas .styled-table th{
  background:#1e88e5;
  color:white;
  font-size:15px;
}

#sec-turmas tr{
  transition:.2s;
}

#sec-turmas tr:hover{
  background:#f1f7ff;
}

.btn-abrir-turma{
  background:#1e88e5;
  color:white;
  border:none;
  padding:6px 12px;
  border-radius:6px;
  cursor:pointer;
}

.btn-abrir-turma:hover{
  background:#1565c0;
}

.btn-edit-turma{
  background:#4caf50;
  color:white;
  border:none;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
  font-weight:bold;
}

.btn-edit-turma:hover{
  background:#3d8c40;
}

.btn-delete-turma{
  background:#e53935;
  color:white;
  border:none;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
  font-weight:bold;
}

.btn-delete-turma:hover{
  background:#c62828;
}

#layout{
    display:flex;
    flex:1;
    height:100%;
}

.sidebar{
    flex-shrink:0;
}

main{
    flex:1;
}

/* =========================
   HEADER DO PAINEL DA ESCOLA
========================= */

#headerPainel {
  background: linear-gradient(90deg, #0b3a6a, #0e4d92);
  color: white;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(11, 58, 106, 0.25);
}

/* Logo da escola */
#logoEscola {
  height: 46px;
  width: auto;
  border-radius: 8px;
  background: white;
  padding: 4px;
}

/* Títulos */
#tituloBiblioteca {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: white;
}

#tituloEscola {
  margin: 2px 0 0;
  font-size: 13px;
  opacity: 0.9;
  color: white;
}

/* Usuário logado (lado direito) */
#userInfo {
  margin-left: auto;
  text-align: right;
}

#userNome {
  font-weight: 600;
  font-size: 14px;
  color: white;
}

#userCargo {
  font-size: 12px;
  opacity: 0.85;
  color: white;
}

/* ==================== LAYOUT PADRÃO ==================== */

#layout {
  display: flex;
}

#conteudo {
  flex: 1;
  padding: 24px;
}

/* ==================== SECTION ==================== */

.section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 30px;
}

/* ==================== TABELAS ==================== */

.tabela-padrao {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Cabeçalho */
.tabela-padrao thead {
  background: #0e4d92;
}

.tabela-padrao th {
  color: #fff;
  padding: 12px;
  font-size: 14px;
  text-align: left;
}

/* Corpo */
.tabela-padrao td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

/* Hover */
.tabela-padrao tbody tr:hover {
  background: #f5f8ff;
}

/* Títulos */
.section h2,
.section h3 {
  margin-bottom: 15px;
}

/* =======================
   TABELA MODERNA — LIBRIS
   ======================= */

.tabela-reservas {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  font-size: 15px;
}

/* Cabeçalho */
.tabela-reservas thead {
  background: linear-gradient(135deg, #0e4d92, #0a3f78);
  color: #fff;
}

.tabela-reservas th {
  padding: 14px 16px;
  font-weight: 600;
  text-align: left;
  border: none;
}

/* Corpo */
.tabela-reservas tbody tr {
  transition: background 0.2s ease;
}

.tabela-reservas tbody tr:hover {
  background: #f4f8ff;
}

.tabela-reservas td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f6;
}

/* Remove linha final */
.tabela-reservas tbody tr:last-child td {
  border-bottom: none;
}

/* =======================
   STATUS COMO BADGES
   ======================= */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* Status específicos */
.status-pendente {
  background: #fff4cc;
  color: #9a6b00;
}

.status-pronto {
  background: #e6f7ec;
  color: #1e7d43;
}

.status-retirado {
  background: #e7f0ff;
  color: #0e4d92;
}

.status-cancelado {
  background: #fdeaea;
  color: #b00020;
}

footer {
  margin-top: 35px;
  text-align: center;
  font-size: 13px;
  opacity: .8;
}
footer img { height: 36px; }

.dashboard{
  display:flex;
  gap:20px;
  margin-top:20px;
  flex-wrap:wrap;
}

.cardResumo{
  flex:1;
  min-width:220px;
  background:white;
  padding:20px;
  border-radius:12px;
  box-shadow:0 4px 10px rgba(0,0,0,.08);
  text-align:center;
  transition:.2s;
}

.cardResumo:hover{
  transform:translateY(-3px);
}

.cardResumo .icone{
  font-size:28px;
  margin-bottom:6px;
}

.cardResumo .numero{
  font-size:32px;
  font-weight:bold;
  color:#0e4d92;
}

.cardResumo .label{
  font-size:14px;
  color:#555;
}

.pagination {
  display: flex;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.2s;
}

.pagination button:hover {
  background: #f3f3f3;
}

.pagination button.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.periodo-rapido {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn-periodo {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dbe8ff;
  background: #f0f6ff;
  color: #0e4d92;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-periodo:hover {
  background: #0e4d92;
  color: white;
}

.btn-periodo.ativo {
  background: #0e4d92;
  color: white;
  box-shadow: 0 4px 10px rgba(14,77,146,0.2);
}

.periodo-rapido {
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 10px;
}

/* =========================
   📊 TABELA PADRÃO LIBRIS
========================= */

.tabela-padrao {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 15px;
}

/* 🔵 Cabeçalho padrão */
.tabela-padrao thead tr {
  background: linear-gradient(90deg, #0e4d92, #0b3a6a);
  color: white;
}

.tabela-padrao th {
  padding: 12px;
  font-weight: 600;
  text-align: left;
}

/* 📦 Linhas estilo card */
.tabela-padrao tbody tr {
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
  transition: 0.2s;
}

.tabela-padrao tbody tr:hover {
  transform: scale(1.01);
}

/* 📌 Células */
.tabela-padrao td {
  padding: 12px;
}

/* 🔥 bordas arredondadas topo */
.tabela-padrao thead th:first-child {
  border-top-left-radius: 8px;
}

.tabela-padrao thead th:last-child {
  border-top-right-radius: 8px;
}

.tabela-padrao thead th {
  background: linear-gradient(90deg, #0e4d92, #0b3a6a) !important;
  color: white !important;
}

/*--Catálolo do livro--*/

.catalogo-card {
  cursor: pointer;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
}

.estrelas span {
  font-size: 22px;
  cursor: pointer;
  color: #ccc;
}

.estrelas .ativa {
  color: gold;
}

/* 📚 GRID RESPONSIVO */
#gridCatalogo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 10px;
}

.catalogo-card {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

/* 📱 CAPA */
.catalogo-capa {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

/* 📘 TÍTULO */
.catalogo-titulo {
  font-size: 14px;
  font-weight: bold;
  margin-top: 8px;
}

/* ✍️ AUTOR */
.catalogo-autor {
  font-size: 12px;
  color: #555;
}

/* 🏷 STATUS */
.catalogo-status {
  font-size: 12px;
  margin-top: 4px;
}

/* 🔘 BOTÃO */
.catalogo-acoes button {
  margin-top: 8px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: #27ae60;
  color: white;
  font-size: 13px;
}

@media (max-width: 600px) {

  #gridCatalogo {
    grid-template-columns: 1fr;
  }

  .catalogo-card {
    flex-direction: row;
    gap: 10px;
    align-items: center;
  }

  .catalogo-capa {
    width: 80px;
    height: 110px;
  }

  .catalogo-info {
    flex: 1;
  }

  .catalogo-titulo {
    font-size: 14px;
  }

}

/* 📱 ÁREA DE ABAS */
.abas {
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  background: #fff;
}

/* BOTÕES DAS ABAS */
.abas button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: none;
  border-radius: 20px;
  background: #eee;
  font-size: 13px;
  white-space: nowrap;
}

/* ABA ATIVA */
.abas button.ativa {
  background: #2c3e50;
  color: white;
}

@media (max-width: 600px) {

  .abas {
    padding: 6px;
  }

  .abas button {
    font-size: 12px;
    padding: 6px 10px;
  }

}

.abas {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Layout padrão */
#layout {
  display: flex;
}

/* Sidebar desktop */
.sidebar {
  width: 220px;
  display: flex;
  flex-direction: column;
}

/* Conteúdo */
#conteudo {
  flex: 1;
  padding: 15px;
}

@media (max-width: 768px) {

  .sidebar {
    display: none;
  }

  #layout {
    flex-direction: column;
  }

}

.mobile-nav {
  display: none !important;
}

@media (max-width: 768px) {

  .mobile-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #ddd;
    display: flex !important;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
  }

  .mobile-nav button {
    background: none;
    border: none;
    font-size: 18px;
  }

  #conteudo {
    padding-bottom: 70px; /* espaço pro menu */
  }

}

.mobile-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 100;
}

/* Botões */
.mobile-nav button {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: #555;
}

/* Ícone */
.mobile-nav span {
  font-size: 20px;
}

/* Ativo */
.mobile-nav button.active {
  color: #2c3e50;
  font-weight: bold;
}

/* padrão (desktop) */
/* desktop */
.cards-reservas {
  display: none;
}

/* mobile */
@media (max-width: 768px) {

  .tabela-reservas {
    display: none !important;
  }

  .cards-reservas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

}
  .card-reserva {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  .card-reserva h3 {
    margin: 0;
    font-size: 15px;
  }

  .card-reserva .status {
    font-size: 13px;
    margin-top: 6px;
  }

  .card-reserva .data {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
  }

  .card-reserva button {
    margin-top: 8px;
    padding: 8px;
    width: 100%;
    border: none;
    border-radius: 8px;
    background: #0e4d92;
    color: white;
  }

/* desktop */
.cards-historico {
  display: none;
}

/* mobile */
@media (max-width: 768px) {

  .tabela-historico {
    display: none !important;
  }

  .cards-historico {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .card-historico {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  .card-historico h3 {
    margin: 0;
    font-size: 15px;
  }

  .card-historico .info {
    font-size: 13px;
    margin-top: 4px;
    color: #444;
  }

  .card-historico .data {
    font-size: 12px;
    color: #777;
  }

  .card-historico button {
    margin-top: 8px;
    padding: 8px;
    width: 100%;
    border: none;
    border-radius: 8px;
    background: #f39c12;
    color: white;
  }

}

.logout-mobile {
  display: none;
}

@media (max-width: 768px) {

  .logout-mobile {
    display: block;
    margin-top: 8px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: #e74c3c;
    color: white;
  }

}
