:root {
  --primary: #F16464;
  --primary-dark: #d94d4d;
  --primary-soft: #ffe3e3;
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --border-soft: #e4e4e9;
  --radius-lg: 18px;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.06);
}

/* Reset simples */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #ffe9e9 0, #f5f5f7 40%, #f5f5f7 100%);
  color: var(--text-main);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

a {
  color: var(--bg-card);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-wrapper {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px 32px;
}

/* HEADER */

.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  padding: 18px 24px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-soft);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.logo-placeholder {
  width: 140px;
  height: 64px;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.logo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.school-name {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.school-meta,
.list-title {
  margin: 0;
  font-size: 0.85rem;
}

.list-title {
  margin-top: 4px;
  font-weight: 500;
}

.serie-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 10px;
  border-radius: 12px;
}

.serie-selector label {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
}

.serie-selector select {
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

/* Botão principal */

.btn-primary {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  background-color: #ffffff;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease, box-shadow 0.1s ease,
    background-color 0.1s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  background-color: #fefefe;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* MAIN */

.main-content {
  margin-top: 24px;
}

.section {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.section-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.section-title::before {
  content: "";
  width: 7px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--primary-soft));
}

.section-subtitle {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* INFO GRID */

.info-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr;
  gap: 14px;
}

.info-card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 14px 14px 12px;
  border: 1px solid var(--border-soft);
}

.info-card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.info-card p {
  margin: 4px 0;
  font-size: 0.85rem;
  color: var(--text-main);
}

.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.info-list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.85rem;
}

.info-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-dark);
  font-size: 0.85rem;
}

/* UNIFORMES */

.uniforms-card {
  background: linear-gradient(135deg, var(--primary-soft), #ffffff);
}

/* TABELA DE MATERIAIS */

.table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background-color: #ffffff;
}

.materials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.materials-table thead {
  background: var(--primary-soft);
}

.materials-table th,
.materials-table td {
  padding: 8px 10px;
  text-align: left;
}

.materials-table th {
  font-weight: 600;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border-soft);
}

.materials-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.materials-table tbody tr:hover {
  background-color: #fff7f7;
}

.note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

.lit-list {
  display: grid;
  gap: 14px;
}

.lit-trimestre h3 {
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.lit-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.lit-card img {
  width: 72px;
  height: 92px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}

.lit-body h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--primary-dark);
}

.lit-autor {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lit-sinopse {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.lit-ficha {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lit-link {
  display: inline-block;
  font-weight: 600;
  color: var(--primary-dark);
}

/* FOOTER */

.footer {
  margin-top: 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* RESPONSIVIDADE */

@media (max-width: 720px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    align-self: stretch;
    display: flex;
    justify-content: flex-start;
  }

  .page-wrapper {
    margin-top: 16px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* IMPRESSÃO */

@media print {
  body {
    background: #ffffff;
  }

  .page-wrapper {
    max-width: 100%;
    margin: 0;
    padding: 0 14mm 10mm;
  }

  .header {
    border-radius: 0;
    box-shadow: none;
    margin-top: 10mm;
  }

  .section {
    box-shadow: none;
    border-radius: 10px;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .info-card,
  .book-card,
  .table-wrapper {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .no-print {
    display: none !important;
  }
}
