
:root {
  --primary: #003366;
  --primary-light: #0055a5;
  --secondary: #006f3c;
  --accent: #ffd600;
  --background: #f5f7fa;
  --surface: #ffffff;
  --text: #212121;
  --text-muted: #616161;
  --danger: #d32f2f;
  --success: #388e3c;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2 {
  margin-bottom: 16px;
  color: var(--primary);
}

.centered {
  max-width: 900px;
  margin: 80px auto;
  text-align: center;
  padding: 24px;
}

.form-container {
  max-width: 520px;
  margin: 60px auto;
  padding: 32px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  animation: fadeIn 0.5s ease;
}

/* ===== Botões ===== */

.btn,
.btn-outline,
.btn-small,
.btn-pdf,
.btn-excel {
  display: inline-block;
  visibility: visible;
  opacity: 1;
}

.btn {
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s, transform 0.15s;
}
.btn:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}
.btn:active {
  transform: scale(0.97);
}
.btn-outline {
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
  color: #fff;
}
.btn-small {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 5px;
}
.btn-pdf {
  background: var(--danger);
  color: #fff;
}
.btn-excel {
  background: var(--secondary);
  color: #fff;
}
.btn-pdf:hover { background: #b71c1c; }
.btn-excel:hover { background: #2e7d32; }
.logout-btn {
  background: var(--danger);
  background-color: white;
}

/* ===== Topbar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary);
  color: white;
  padding: 16px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.topbar h1 {
  font-size: 22px;
}

/* Torna botões do topo sempre visíveis */
.topbar .btn,
.topbar .btn-outline,
.topbar .btn-small {
  color: var(--primary) !important;
  background: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: none !important;
}
.topbar .btn-outline:hover {
  background: var(--primary-light) !important;
  color: #fff !important;
}


/* ===== Formulários ===== */
label {
  display: block;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 500;
}
input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 6px;
  transition: border 0.2s, box-shadow 0.2s;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,85,165,0.2);
  outline: none;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}

/* ===== Mensagens ===== */
.msg {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
}
.msg.success {
  background: #e8f5e9;
  color: var(--success);
  border: 1px solid #a5d6a7;
}
.msg.error {
  background: #ffebee;
  color: var(--danger);
  border: 1px solid #ef9a9a;
}

/* ===== Dashboard ===== */
.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 16px;
}

#caixinha {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  border-radius: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  overflow-y: auto;
  padding: 1rem;
}
.modal-content {
  background: var(--surface);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: fadeIn 0.3s ease;
  max-height: 90vh; 
  overflow-y: auto;
}

.dashboard-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.card {
  flex: 1;
  min-width: 180px;
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  font-weight: 500;
  transition: transform 0.2s;
}
.card:hover {
  transform: translateY(-3px);
}

/* ===== Filtros ===== */
.controls {
  margin: 20px 0;
  flex-direction: row;
}
.filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filters label {
  font-weight: 500;
}
#Pesquisar {
  font-size: 15px;
  flex-direction: column;
}

/* ===== Tabelas ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}
.table th {
  background: var(--primary);
  color: white;
  text-align: left;
}
.table tr:nth-child(even) {
  background: transparent !important;
}
.table tr:hover {
  background: #f1f7ff;
}

/* ===== Links de aluno ===== */
.aluno-link {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.aluno-link:hover {
  color: var(--accent);
}

/* ===== Pequenos detalhes ===== */
.small {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 14px;
}

/* ===== Responsividade ===== */
@media(max-width: 600px) {
  .btn-row, .filters, .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ===== Animações ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======= PADRONIZAÇÃO DO TOPO DOS FORMULÁRIOS ======= */
:root{
  /* Use os MESMOS valores que você já usa hoje: */
  --brand: #0b5bd3;          /* primária */
  --brand-600: #0a4fb7;      /* hover */
  --bg: #0f1216;             /* fundo geral (escuro) */
  --surface: #171b21;        /* cartões/barras */
  --text: #e6eef7;           /* texto principal */
  --muted: #9fb0c3;          /* texto secundário */
  --divider: #243040;        /* linhas sutis */
}

.form-top {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  position: sticky; top: 0; z-index: 50; /* fica fixo no topo da página do form */
}

.form-top .brand {
  display: flex; align-items: center; gap: 12px;
}

.form-top .brand img {
  width: 44px; height: 44px; object-fit: contain;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.25));
}

.form-top .titles {
  display: grid; gap: 2px;
}

.form-top .titles h1 {
  margin: 0; font-size: 1.25rem; line-height: 1.2;
  color: var(--text); font-weight: 700;
}

.form-top .titles p {
  margin: 0; font-size: .9rem; color: var(--muted);
}

.form-top .actions {
  justify-self: end;
  display: flex; gap: 10px; flex-wrap: wrap;
}

.form-top .btn {
  appearance: none; border: 1px solid transparent;
  padding: 8px 12px; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 600;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.form-top .btn:hover { background: var(--brand-600); transform: translateY(-1px); }
.form-top .btn.outline {
  background: transparent; color: var(--text); border-color: var(--divider);
}
.form-top .btn.outline:hover { border-color: var(--brand); color: #fff; }

/* Container padrão de formulário (opcional para harmonizar) */
.form-shell {
  max-width: 1100px; margin: 22px auto; padding: 0 18px;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px; padding: 18px; margin-bottom: 16px;
}

/* Títulos dentro dos cartões (garante visibilidade) */
.form-card h2, .form-card h3, .form-card label, .form-card span, .form-card p {
  color: var(--text);
}

/* Responsivo */
@media (max-width: 720px){
  .form-top {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-top .actions { justify-self: start; }
  .form-top .titles h1 { font-size: 1.1rem; }
}
