/* ============================================
   Área do Professor – Teatro Carlos Gomes
   Layout moderno, responsivo
   ============================================ */

:root {
  --brand: #bb8d00;
  --brand-light: #d4a500;
  --brand-dark: #9a7500;
  --brand-soft: rgba(187, 141, 0, 0.12);
  --accent: #bb8d00;
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header / Topo ---- */
.section-topo {
  background: var(--bg-card);
  border-bottom: 3px solid var(--brand);
  box-shadow: var(--shadow);
  padding: 1rem 0;
}

.section-topo .container.section-topo__row,
.section-topo .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.section-topo .logo-wrap {
  display: flex;
  align-items: center;
}

.section-topo .logo-wrap img {
  height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  object-position: left center;
}

.section-topo .nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.section-topo .btn-topo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(187, 141, 0, 0.3);
}

.section-topo .btn-topo:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(187, 141, 0, 0.4);
}

.section-topo .btn-topo.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
  box-shadow: none;
}

.section-topo .btn-topo.btn-outline:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.section-topo--login .logo-wrap img {
  height: 52px;
  max-width: 220px;
  object-fit: contain;
  object-position: left center;
}

/* ---- Seções de conteúdo ---- */
.section-corpo,
.section-conta {
  padding: 2.5rem 0 3rem;
  font-size: 0.9375rem;
  color: var(--text);
}

.section-conta .page-title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--brand);
  margin-bottom: 0.25rem;
}

.section-conta .page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---- Cards / Blocos ---- */
.section-conta .bloco,
.card-moderno {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.section-conta .bloco:hover,
.card-moderno:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(187, 141, 0, 0.2);
}

.section-conta .bloco .link,
.section-conta .bloco a.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition);
}

.section-conta .bloco .link:hover,
.section-conta .bloco a.link:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.section-conta .bloco .link p,
.section-conta .bloco a.link p {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-conta .bloco .link .fas,
.section-conta .bloco a.link .fas {
  color: var(--brand);
  opacity: 0.7;
  transition: transform var(--transition);
}

.section-conta .bloco .link:hover .fas,
.section-conta .bloco a.link:hover .fas {
  transform: translateX(4px);
}

.section-conta .bloco .link-desc {
  padding: 0 1.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---- Formulários ---- */
.fvss-label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.fvss-input,
.fvss-select,
.section-conta .form-control,
.section-corpo .form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.fvss-input:focus,
.fvss-select:focus,
.section-conta .form-control:focus,
.section-corpo .form-control:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.fvss-form-linha {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.fvss-form-elemento {
  flex: 1 1 0;
  min-width: 0;
}

.login-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

/* ---- Botões ---- */
.btn-moderno,
.section-corpo .btn-outline-light.success,
.section-conta .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(187, 141, 0, 0.3);
}

.btn-moderno:hover,
.section-corpo .btn-outline-light.success:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(187, 141, 0, 0.4);
}

.btn-moderno.loading,
.section-corpo .btn-outline-light.loading {
  opacity: 0.85;
  pointer-events: none;
}

/* ---- Login ---- */
.login-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 0.5rem;
}

.login-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---- Frequências ---- */
.section-frequencias .page-title,
.section-frequencias .page-subtitle {
  text-align: center;
}

.section-frequencias #formFiltro {
  justify-content: center;
}

.section-frequencias #areaFrequencias {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

.frequencia-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 720px;
}

.frequencia-table th,
.frequencia-table td {
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  text-align: center;
  vertical-align: middle;
}

.frequencia-table th {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.frequencia-table .aluno-nome {
  text-align: left;
  min-width: 200px;
  max-width: 220px;
  padding-left: 1rem;
  word-break: break-word;
  line-height: 1.35;
}

.frequencia-table .presenca-cell {
  cursor: pointer;
  width: 48px;
  min-width: 48px;
  min-height: 36px;
  user-select: none;
  transition: background var(--transition), transform 0.1s ease;
  font-weight: 600;
}

.frequencia-table td:nth-child(1) { min-width: 70px; }   /* Horário */
.frequencia-table td:nth-child(2) { min-width: 80px; }   /* Sala */
.frequencia-table td:nth-child(4) { min-width: 90px; }   /* Categoria */
.frequencia-table th:nth-child(1) { min-width: 70px; }
.frequencia-table th:nth-child(2) { min-width: 80px; }
.frequencia-table th:nth-child(4) { min-width: 90px; }

.frequencia-table .presenca-cell:hover {
  background: var(--brand-soft) !important;
  border: 2px solid var(--brand);
}

.frequencia-table .presenca-presente {
  background: #dcfce7;
  color: #166534;
}

.frequencia-table .presenca-falta {
  background: #fee2e2;
  color: #991b1b;
}

.frequencia-table .presenca-vazio {
  background: var(--bg-card);
}

.frequencia-table .totais-row {
  font-weight: 700;
  background: var(--bg-page);
}

.nav-tabs-frequencias {
  border-bottom: 2px solid var(--brand);
  margin-top: 1.5rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-tabs-frequencias .nav-link {
  color: var(--text-muted);
  background: var(--bg-page);
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.85rem 1.35rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: -2px;
}

.nav-tabs-frequencias .nav-link:hover {
  color: var(--brand);
  background: #fff;
  border-color: var(--border);
}

.nav-tabs-frequencias .nav-link.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.tab-content-body {
  padding: 1.75rem;
  min-height: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.section-frequencias .tab-content-body .frequencia-table {
  margin: 1.25rem 0;
}

#areaFrequencias {
  min-height: 120px;
}

/* ---- Alertify ---- */
.alertify .ajs-modal {
  z-index: 999999;
}

.alertify .ajs-body {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
}

/* ---- Utilitários e legado ---- */
.loading-page {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  background-image: url(../images/loading.gif);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 48px;
  z-index: 99999;
}

.section-conta .tRegistros {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.section-conta .tRegistros th,
.section-conta .tRegistros td {
  padding: 0.75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.section-conta .tRegistros th {
  background: var(--bg-page);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ---- Responsivo ---- */
@media (max-width: 768px) {
  .section-topo .logo-wrap img {
    height: 44px;
    max-width: 180px;
  }

  .section-topo .btn-topo {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .section-corpo,
  .section-conta {
    padding: 1.5rem 0 2rem;
  }

  .login-card {
    padding: 1.5rem;
  }

  .fvss-form-linha {
    flex-direction: column;
  }

  .fvss-form-elemento {
    flex: 1 1 100%;
  }
}

@media (max-width: 576px) {
  .section-topo .container.section-topo__row,
  .section-topo .container {
    flex-direction: column;
    align-items: stretch;
  }

  .section-topo .nav-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .frequencia-table {
    font-size: 11px;
  }

  .frequencia-table th,
  .frequencia-table td {
    padding: 0.4rem 0.5rem;
  }
}
