:root {
  --blue: #1D4ED8;
  --blue-light: #3B82F6;
  --yellow: #FACC15;
  --yellow-dark: #CA8A04;
  --red: #DC2626;
  --red-light: #EF4444;
  --green: #22C55E;
  --dark: #111827;
  --bg: #020617;
  --card-border: rgba(59, 130, 246, 0.26);
  --text: #F9FAFB;
  --muted: #A7B0C0;
  --danger: #F87171;
  --success: #34D399;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(29, 78, 216, 0.34), transparent 38%),
    linear-gradient(180deg, #020617 0%, #030712 100%);
  color: var(--text);
}

.app-shell {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px;
}

.screen { display: none; }
.screen.active { display: block; }

.brand-area, .topbar, .brand-small {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-area { margin: 32px 0 44px; }

.logo-img {
  width: 88px;
  height: 88px;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(29, 78, 216, 0.42);
  border: 1px solid rgba(59,130,246,.5);
}

.logo-small-img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(29, 78, 216, 0.32);
}

h1, h2, h3, p { margin: 0; }

.brand-area h1, .hero-card h1 {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -1.4px;
}

span { color: var(--blue-light); }

.brand-area p, .topbar p, .hero-card p, .muted {
  color: var(--muted);
}

.login-card, .hero-card, .metric-card, .student-card, .empty-card, .agenda-card, .modal-content {
  border: 1px solid var(--card-border);
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.94), rgba(3, 7, 18, 0.9));
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.login-card { padding: 26px; }

.badge, .eyebrow {
  display: inline-block;
  color: var(--yellow);
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 800;
  margin-bottom: 18px;
}

.login-card h2 { font-size: 28px; margin-bottom: 8px; }

label {
  display: block;
  margin: 16px 0 8px;
  color: #DDE6F7;
  font-size: 14px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 16px;
  padding: 14px 15px;
  background: rgba(2, 6, 23, 0.78);
  color: var(--text);
  outline: none;
  font-size: 15px;
  font-family: Arial, Helvetica, sans-serif;
}

select option { background: #111827; color: white; }
textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.btn {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 900;
  padding: 14px 16px;
  color: white;
  transition: transform .15s ease, opacity .15s ease;
}

.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .65; cursor: not-allowed; }

.btn.full { width: 100%; margin-top: 24px; }
.btn.small { padding: 11px 16px; }

.btn-blue {
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.30);
}

.btn-yellow {
  color: #111827;
  background: linear-gradient(135deg, #FACC15, #F59E0B);
  box-shadow: 0 14px 30px rgba(250, 204, 21, 0.22);
}

.btn-red {
  background: linear-gradient(135deg, #DC2626, #EF4444);
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.24);
}

.close-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(239, 68, 68, 0.50);
  background: rgba(220, 38, 38, 0.18);
  color: white;
  border-radius: 16px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.message {
  min-height: 22px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

.topbar {
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar h2 { font-size: 22px; }

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin-bottom: 18px;
}

.hero-card h1 { font-size: 28px; margin-bottom: 10px; }

.progress-circle {
  min-width: 96px;
  height: 96px;
  border: 8px solid rgba(29, 78, 216, 0.92);
  border-left-color: rgba(250, 204, 21, 0.85);
  border-bottom-color: rgba(220, 38, 38, 0.85);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
}

.progress-circle strong { font-size: 23px; line-height: 1; }
.progress-circle small { color: var(--muted); margin-top: -18px; }

.grid-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0 18px;
}

.metric-card {
  padding: 18px;
  min-height: 116px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 12px;
  line-height: 1.35;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  font-size: 34px;
  color: white;
}

.metric-card.warning strong, .yellow-card strong { color: var(--yellow); }

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 18px 0 26px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 14px;
}

.section-head h2 {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 21px;
}

.students-list, .agenda-list {
  display: grid;
  gap: 14px;
}

.empty-card, .agenda-card { padding: 18px; }

.empty-card h3, .agenda-card h3 { margin-bottom: 8px; }
.empty-card p, .agenda-card p { color: var(--muted); line-height: 1.45; }

.student-card { padding: 18px; }

.student-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.student-name {
  font-size: 22px;
  font-weight: 900;
}

.student-meta {
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
}

.status-line {
  margin-top: 10px;
  color: var(--yellow);
  font-weight: 800;
}

.status-line.apto { color: var(--green); }
.status-line.reforco { color: var(--red-light); }

.bar {
  height: 12px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  margin-top: 16px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #DC2626, #FACC15, #22C55E);
  border-radius: inherit;
}

.student-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.student-actions .btn {
  padding: 10px 8px;
  border-radius: 14px;
  font-size: 13px;
}

.agenda-card {
  border-left: 5px solid var(--yellow);
}

.agenda-card.realizada { border-left-color: var(--blue-light); }
.agenda-card.falta, .agenda-card.cancelada { border-left-color: var(--red-light); }
.agenda-card.remarcada { border-left-color: var(--yellow); }

.agenda-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.agenda-date {
  font-weight: 900;
  color: white;
}

.agenda-status {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #111827;
  background: var(--yellow);
}

.agenda-status.realizada { background: var(--blue-light); color: white; }
.agenda-status.falta, .agenda-status.cancelada { background: var(--red-light); color: white; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  padding: 18px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
  z-index: 1000;
  overflow-y: auto;
}

.modal.active { display: block; }

.modal-content {
  width: 100%;
  max-width: 780px;
  margin: 24px auto;
  padding: 22px;
}

.modal-head, .modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-head { margin-bottom: 14px; }
.modal-head h2 { font-size: 28px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.field.full { grid-column: 1 / -1; }

.divider {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.divider h3 { color: var(--yellow); margin-bottom: 6px; }
.divider p { color: var(--muted); line-height: 1.45; }

.modal-actions { margin-top: 18px; }
.modal-actions .btn { width: 50%; }

.skills-list {
  display: grid;
  gap: 12px;
}

.skill-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.45);
}

.skill-row span {
  color: white;
  font-weight: 800;
}

.skill-row input {
  text-align: center;
  font-weight: 900;
}

.preview-media {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.10);
  color: var(--yellow);
  font-weight: 900;
  text-align: center;
}

.preview-media strong {
  color: white;
  font-size: 28px;
}

@media (max-width: 560px) {
  .modal { padding: 10px; }
  .modal-content { margin: 10px auto; padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .student-actions { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand-area h1 { font-size: 31px; }
  .grid-cards { grid-template-columns: 1fr; }
  .hero-card { flex-direction: column; align-items: flex-start; }
}

.btn-green {
  background: linear-gradient(135deg, #16A34A, #22C55E);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.22);
}

.modal-actions-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.modal-actions-three .btn {
  width: 100%;
}

#whatsTexto {
  min-height: 300px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .modal-actions-three {
    grid-template-columns: 1fr;
  }
}

.btn-purple {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  box-shadow: 0 14px 30px rgba(168, 85, 247, 0.24);
}

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

.exame-card {
  padding: 18px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.94), rgba(3, 7, 18, 0.9));
  border-radius: 28px;
  border-left: 5px solid #A855F7;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.exame-card.alerta {
  border-left-color: var(--red-light);
}

.exame-card.apto {
  border-left-color: var(--green);
}

.exame-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.exame-card h3 {
  margin-bottom: 8px;
}

.exame-card p {
  color: var(--muted);
  line-height: 1.45;
}

.exame-badge {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #A855F7;
  color: white;
  white-space: nowrap;
}

.exame-badge.alerta {
  background: var(--red-light);
}

.exame-badge.apto {
  background: var(--green);
  color: #052e16;
}

.student-actions {
  grid-template-columns: repeat(2, 1fr);
}
