:root {
  font-family: "Inter", "SF Pro Display", system-ui, sans-serif;
  color: #111;
  background: #f5f7fa;
  font-synthesis: none;
  --brand: #d50425;
  --brand-light: #e43a4a;
  --brand-dark: #b4001c;
  --secondary: #1f2d3d;
  --red: var(--brand);
  --muted: #444;
  --line: #e8e8ee;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
.page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 1050px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
}
.header img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
}
.header h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}
.admin-toggle {
  position: absolute;
  right: 18px;
  top: 16px;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 0;
  font-weight: 700;
  box-shadow: none;
}
.admin-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
}
.content {
  padding: 1.5rem;
}
.intro {
  padding: 1.8rem 1.5rem 0;
  text-align: center;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  color: var(--red);
  margin: 0 0 12px;
}
#welcome {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}
h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}
.notice {
  display: flex;
  gap: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  padding: 23px 25px;
  border-radius: 12px;
}
.notice-symbol {
  border: 1px solid var(--red);
  color: var(--red);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  flex: none;
  font-weight: 700;
}
.notice h2 {
  font-size: 16px;
}
.notice p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin: 7px 0 0;
}
.progress-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}
.progress-panel p {
  font-size: 14px;
  margin: 6px 0 0;
  line-height: 1.6;
}
.progress-summary {
  width: 220px;
  flex: none;
  text-align: right;
}
.progress-summary strong {
  font-size: 26px;
  font-weight: 700;
}
.progress-track {
  margin-top: 10px;
}
progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #e8edf2;
}
progress::-webkit-progress-bar {
  background: #e8edf2;
}
progress::-webkit-progress-value {
  background: var(--red);
}
progress::-moz-progress-bar {
  background: var(--red);
}
.status {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  padding: 32px 0;
}
.status.error,
#adminStatus.error {
  color: var(--brand);
}
.certificate-viewer {
  padding-top: 24px;
  display: grid;
  gap: 30px;
}
.certificate-page {
  margin: 0;
}
.certificate-page figcaption {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.certificate-page canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  box-shadow: 0 4px 24px #2820200d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 24px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
}
.admin-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}
.badge {
  border: 1px solid #f0bdc6;
  color: var(--red);
  font-size: 11px;
  border-radius: 20px;
  padding: 7px 12px;
  white-space: nowrap;
}
.toolbar {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
  margin: 22px 0;
}
.toolbar label,
.student-details label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grow {
  flex: 1;
  min-width: 200px;
}
input,
select,
textarea {
  font: inherit;
  font-size: 14px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d9dfe7;
  background: #fff;
  border-radius: 10px;
  color: #111;
  max-width: 100%;
}
textarea {
  min-height: 85px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid #d5042570;
  outline-offset: 2px;
}
button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 17px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  cursor: pointer;
  min-height: 42px;
  box-shadow: 0 4px 12px rgba(213, 4, 37, 0.2);
  transition: background 0.25s ease;
}
button:hover {
  background: var(--brand-light);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.secondary {
  color: #fff;
  background: var(--secondary);
  border-color: var(--secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.secondary:hover {
  background: #304258;
}
.helper {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 25px 0;
}
.stat {
  border: 1px solid var(--line);
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.stat strong {
  display: block;
  font-size: 30px;
  color: var(--secondary);
  margin-bottom: 8px;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
#adminStatus {
  font-size: 14px;
  line-height: 1.6;
  min-height: 22px;
}
.student-list {
  display: grid;
  gap: 12px;
}
.student-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 20px;
}
.student-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}
.student-top h3 {
  font-size: 16px;
  margin: 0 0 6px;
}
.student-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.student-progress {
  font-size: 22px;
  font-weight: 700;
  color: var(--secondary);
  text-align: right;
  white-space: nowrap;
}
.chip {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 5px 8px;
  background: #f1f4f8;
  color: #526070;
  border-radius: 3px;
  margin: 8px 0;
}
.chip.success {
  background: #e7f0e9;
  color: #275333;
}
.chip.error {
  background: #f8e7e7;
  color: var(--red);
}
.student-card summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--red);
  margin-top: 15px;
  list-style-position: inside;
}
.student-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 15px;
}
.student-details .wide {
  grid-column: 1/-1;
}
.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-preview {
  padding-top: 35px;
}
.filters {
  margin-bottom: 0;
}
@media (min-width: 651px) and (max-width: 850px) {
  .header {
    flex-wrap: wrap;
  }
  .admin-toggle {
    position: static;
  }
}
@media (max-width: 650px) {
  .page {
    padding: 12px;
    align-items: flex-start;
  }
  .header {
    padding: 1.1rem;
    flex-wrap: wrap;
    gap: 0.7rem;
  }
  .header h1 {
    font-size: 1.15rem;
  }
  .header img {
    height: 46px;
  }
  .admin-toggle {
    position: static;
  }
  .content {
    padding: 18px;
  }
  .intro {
    padding-top: 30px;
  }
  #welcome {
    font-size: 1.6rem;
  }
  .notice {
    padding: 18px;
    gap: 12px;
  }
  .progress-panel {
    align-items: start;
  }
  .progress-summary {
    width: 110px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .student-details {
    grid-template-columns: 1fr;
  }
  .student-top {
    gap: 10px;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar label,
  .toolbar button {
    width: 100%;
  }
  .admin-heading {
    flex-wrap: wrap;
  }
  footer {
    line-height: 1.6;
  }
  .student-card {
    padding: 16px;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  body::after {
    display: block;
    content: "Certificado disponível apenas para visualização. A via física será encaminhada à unidade.";
    padding: 40px;
    font: 16px Arial;
  }
}
