/* --- Variáveis --- */
:root {
  --primary-blue: #002f5d;
  --accent-teal: #009ca6;
  --accent-gold: #f4c430;
  --bg-light: #f4f7f9;
  --white: #ffffff;
  --sidebar-bg: #e9ecef;
  --text-dark: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* --- Header --- */
.main-header {
  background-color: var(--white);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.header-logo {
  width: 500px;
  max-width: 90%;
  height: auto;
}

/* --- Layout Principal (Sidebar + Content) --- */
.app-container {
  display: flex;
  flex-grow: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: var(--white);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  width: 300px;
  background-color: var(--primary-blue);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.5rem;
  background-color: rgba(0, 0, 0, 0.1);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-header h3 {
  color: #ffffff !important; /* Corrigido: Texto Branco */
  margin: 0;
  font-size: 1.3rem;
}

.sidebar-header h3 i {
  margin-right: 8px;
  color: var(--accent-gold);
}

.grade-nav {
  padding: 1rem;
  overflow-y: auto;
  flex-grow: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.grade-nav::-webkit-scrollbar {
  width: 6px;
}
.grade-nav::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.group-title {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 1.5rem 0 0.5rem 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-btn {
  display: block;
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 5px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateX(5px);
}

.nav-btn.active {
  background-color: var(--accent-teal);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.1);
  margin-top: auto;
  flex-shrink: 0;
}

.download-pdf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: #ff4b4b;
  color: white;
  text-decoration: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.download-pdf-btn:hover {
  background-color: #ff1f1f;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* --- Área de Conteúdo --- */
.content-area {
  flex-grow: 1;
  padding: 2.5rem 4rem;
  overflow-y: auto;
  background-color: #fafafa;
  height: 100%;
}

.grade-header {
  border-bottom: 3px solid var(--accent-teal);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.grade-title {
  font-size: 2.5rem;
  color: var(--primary-blue);
  margin: 0;
}

.grade-total {
  font-size: 1.1rem;
  color: var(--text-dark);
  background: #e0f7fa;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.grade-total i {
  color: var(--accent-teal);
}

h3 {
  color: var(--primary-blue);
  margin-bottom: 1.5rem;
  margin-top: 2.5rem;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.books-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 3rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}

.books-table th {
  background-color: var(--primary-blue);
  color: white;
  padding: 1.2rem;
  text-align: left;
  font-size: 1.05rem;
}

.books-table td {
  padding: 1.2rem;
  border-bottom: 1px solid #eee;
  color: #444;
}

.books-table tr:hover {
  background-color: #f8f9fa;
}
.books-table tr:last-child td {
  border-bottom: none;
}
.price-col {
  font-weight: 700;
  color: var(--primary-blue);
  width: 180px;
  text-align: right;
}

.stationery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3rem;
}

.check-item {
  background: white;
  padding: 1.2rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.check-item:hover {
  border-color: var(--accent-teal);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.check-item input {
  margin-right: 15px;
  transform: scale(1.5);
  accent-color: var(--accent-teal);
  flex-shrink: 0;
}

.check-item.checked {
  background-color: #f1f8e9;
  border-color: #a5d6a7;
  color: #888;
}

.check-item.checked span {
  text-decoration: line-through;
}

.hygiene-section {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px dashed #ccc;
  padding-bottom: 4rem;
}
.hygiene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}
.hygiene-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--accent-gold);
}
.hygiene-card h4 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
}
.hygiene-card ul {
  margin-left: 1.5rem;
  line-height: 1.8;
  color: #555;
}

.footer-note {
  display: none;
}

.whatsapp-btn {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 30px;
  right: 30px;
  background-color: #25d366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  z-index: 100;
  transition: transform 0.3s;
}
.whatsapp-btn:hover {
  transform: scale(1.1);
}

@media (max-width: 900px) {
  body {
    height: auto;
    overflow: auto;
  }
  .app-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .grade-nav {
    display: flex;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
    white-space: nowrap;
  }
  .nav-group {
    min-width: 200px;
    display: inline-block;
    vertical-align: top;
  }
  .nav-btn {
    display: inline-block;
    width: auto;
    margin-right: 5px;
  }
  .content-area {
    padding: 1.5rem;
    height: auto;
    overflow: visible;
  }
  .header-logo {
    width: 300px;
  }
  .sidebar-footer {
    margin-top: 1rem;
    border-top: none;
  }
  .stationery-list {
    grid-template-columns: 1fr;
  }
  .hygiene-grid {
    grid-template-columns: 1fr;
  }
  .grade-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
