/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

/* ===== FUENTE DE TÍTULOS: ANTON ===== */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/anton-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/anton-latin-ext-400.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --primary: #1f1db1;
  --primary-dark: #15139a;
  --primary-light: #3b39c4;
  --accent: #d4a843;
  --accent-light: #f0d68a;
  --accent-dark: #b88e2e;
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --text: #2d2d2d;
  --text-light: #4d4d4d;
  --border: #cfcfd3;
  --success: #27ae60;
  --error: #e74c3c;
  --shadow: 0 2px 12px rgba(31, 29, 177, 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-title: 'Anton', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ===== TÍTULOS: ANTON EN MAYÚSCULAS ===== */
h1,
h2,
h3,
h4,
h5,
h6,
.section-title {
  font-family: var(--font-title);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.logo i {
  font-size: 1.6rem;
  color: var(--accent);
}

.logo-img {
  height: 58px;
  width: auto;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-size: 0.95rem;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ===== MAIN ===== */
.main {
  flex: 1;
  padding: 40px 0;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #0d0c4a 0%, var(--primary) 50%, #1a1a6a 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
  margin: -40px 0 40px;
}

.hero-content h1 {
  font-size: clamp(2rem, 5.5vw, 4rem);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.hero-content p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary-dark);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-spotify i {
  color: #1ed760;
  font-size: 1.15rem;
}

.btn-spotify:hover {
  background: rgba(30, 215, 96, 0.18);
  border-color: rgba(30, 215, 96, 0.6);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
}

.btn-sm:hover {
  background: var(--primary-light);
}

.btn-editar {
  background: var(--accent);
  color: var(--primary-dark);
}

.btn-editar:hover {
  background: var(--accent-light);
}

.btn-eliminar {
  background: var(--error);
  color: #fff;
}

.btn-eliminar:hover {
  background: #c0392b;
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--primary);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  background: #eef0ff;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.admin-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-header-actions .btn {
  flex-shrink: 0;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-desc {
  color: var(--text-light);
  margin-bottom: 24px;
}

.section-title i {
  color: var(--accent);
}

/* ===== COMUNICADOS ===== */
.comunicados {
  padding: 40px 0;
}

.comunicados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.comunicado-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.comunicado-card:hover {
  transform: translateY(-2px);
}

.comunicado-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.comunicado-badge.reunion { background: #e8f0fe; color: #1a73e8; }
.comunicado-badge.notas { background: #fce8e6; color: #d93025; }
.comunicado-badge.evento { background: #e6f4ea; color: #137333; }
.comunicado-badge.concierto { background: #fef7e0; color: #e37400; }
.comunicado-badge.general { background: #e8e8f7; color: var(--primary); }

.comunicado-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.comunicado-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.comunicado-card small {
  color: #999;
  font-size: 0.8rem;
}

/* ===== FORMULARIOS ===== */
.form-section {
  max-width: 700px;
  margin: 0 auto;
}

.form-boletin {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group label i {
  color: var(--primary);
  width: 20px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
  font-family: var(--font);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 29, 177, 0.1);
}

.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 29, 177, 0.1);
}

.form-help {
  display: block;
  margin-top: 6px;
  color: var(--text-light);
  font-size: 0.8rem;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}

.checkbox-option:hover {
  border-color: var(--primary-light);
  background: #f4f5ff;
}

.checkbox-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-option:has(input:checked) {
  border-color: var(--primary);
  background: #eef0ff;
  color: var(--primary-dark);
}

.checkbox-option:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f4f5f7;
}

.checkbox-option:has(input:disabled) input {
  cursor: not-allowed;
}

.form-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 18px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.form-hint i {
  color: var(--accent-dark);
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error {
  background: #fdecea;
  color: var(--error);
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #e6f4ea;
  color: var(--success);
  border: 1px solid #c3e6cb;
}

/* ===== BOLETIN RESULTADO ===== */
.boletin-header {
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.boletin-header p {
  font-size: 1rem;
}

.boletin-header p + p {
  margin-top: 4px;
}

.materias-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.materia-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.materia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.materia-header h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.badge-tipo {
  font-size: 0.75rem;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-tipo.teorica {
  background: #e8f0fe;
  color: #1a73e8;
}

.badge-tipo.instrumento {
  background: #fef7e0;
  color: #e37400;
}

.badge-tipo.practica {
  background: #e6f4ea;
  color: #137333;
}

.materia-codigo {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-light);
  background: var(--bg-light, #f1f3f4);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: middle;
}

.profesor {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* ===== TABLES ===== */
.notas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.notas-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
}

.notas-table th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}

.notas-table th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}

.notas-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.notas-table tr:last-child td {
  border-bottom: none;
}

.notas-table tr:hover td {
  background: #eef0ff;
}

.nota-valor {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
}

.input-nota {
  width: 100px;
  padding: 6px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  text-align: center;
}

.input-nota:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== NOTA FINAL ===== */
.nota-final-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: #f8f9ff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.nota-final-row label,
.nota-final-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.nota-final-row label i,
.nota-final-label i {
  color: var(--accent-dark);
}

.nota-escala {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
}

.nota-final-valor {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.boletin-nota-final .nota-final-valor {
  font-size: 2rem;
}

.nota-final-sin {
  color: var(--text-light);
  font-style: italic;
  font-size: 0.9rem;
}

/* ===== SEMESTRES Y PROMEDIO FINAL (BOLETÍN) ===== */
.semestres-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 12px;
}

.semestre-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8f9ff;
}

.semestre-item.consulta {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 29, 177, 0.08);
}

.semestre-item.sin-nota {
  background: #f7f7f9;
}

.semestre-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
}

.semestre-nota {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.semestre-nota small,
.promedio-valor small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
  margin-left: 2px;
}

.semestre-sin {
  font-size: 0.85rem;
  font-style: italic;
  color: #999;
}

.promedio-final-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(212, 168, 67, 0.16), rgba(212, 168, 67, 0.05));
  border: 1px solid rgba(212, 168, 67, 0.55);
}

.promedio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--accent-dark);
}

.promedio-label i {
  color: var(--accent-dark);
}

.promedio-valor {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}

.promedio-nota {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-light);
}

.boletin-nota-info {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  color: var(--text-light);
  font-size: 0.88rem !important;
}

.boletin-nota-info i {
  color: var(--accent-dark);
  margin-right: 4px;
}

.inline-form {
  display: inline;
}

/* ===== HISTORIA ===== */
.historia-section {
  max-width: 800px;
}

.historia-block {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.historia-block h3 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.historia-block p {
  margin-bottom: 12px;
  line-height: 1.8;
}

.lista-paises {
  list-style: none;
  margin: 16px 0;
}

.lista-paises li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
}

.lista-paises li i {
  color: var(--accent);
  width: 24px;
  text-align: center;
}

/* ===== ADMIN ===== */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-header .btn {
  flex-shrink: 0;
}

.admin-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-header-actions .btn {
  flex-shrink: 0;
}

.table-responsive {
  overflow-x: auto;
  margin: 16px 0 32px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.table th {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.table tr:hover td {
  background: #eef0ff;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-top: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  max-width: 520px;
}

.search-box .search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 44px 11px 42px;
  border: 2px solid var(--border);
  border-radius: 30px;
  font-size: 0.95rem;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 29, 177, 0.1);
}

.search-clear {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.search-clear:hover {
  background: #eef0f7;
  color: var(--primary);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-alert {
  margin-bottom: 0;
}

.badge-activo {
  font-size: 0.75rem;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-activo.activo {
  background: #e6f4ea;
  color: var(--success);
}

.badge-activo.inactivo {
  background: #fdecea;
  color: var(--error);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-check {
  margin-top: 8px;
}

.form-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.admin-details {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 24px;
  border: 1px solid var(--border);
  margin-top: 16px;
}

.admin-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  padding: 8px 0;
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 16px 0;
}

.ref-grid h4 {
  color: var(--primary-dark);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.ref-grid ul {
  list-style: none;
}

.ref-grid li {
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.ref-materias {
  grid-column: 1 / -1;
}

.ref-nivel {
  margin-bottom: 16px;
}

.ref-nivel h5 {
  color: var(--primary-dark);
  font-size: 0.9rem;
  margin: 12px 0 4px;
}

.ref-anio {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 8px;
}

/* ===== MODALES ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(21, 19, 154, 0.45);
  backdrop-filter: blur(2px);
}

.modal.open {
  display: flex;
}

.modal-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modal-in 0.2s ease-out;
}

.modal-dialog.modal-sm {
  max-width: 480px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
}

.modal-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
}

.modal-header h3 i {
  color: var(--accent);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-body .form-group:last-child {
  margin-bottom: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #f8f9ff;
}

.modal-question {
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-estudiante-nombre {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #eef0ff;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #f3d98b;
  border-radius: var(--radius-sm);
  background: #fff8e1;
  color: #8a5a00;
  font-size: 0.88rem;
  line-height: 1.5;
}

.modal-warning i {
  margin-top: 3px;
  color: #b7791f;
}

.modal-body .alert {
  margin-top: 14px;
  margin-bottom: 0;
}

body.modal-open {
  overflow: hidden;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 48px 0 0;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px;
  padding-bottom: 32px;
}

.footer-section h3 {
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.footer-section p {
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-section i {
  width: 20px;
  text-align: center;
  color: var(--accent-light);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.2rem;
  transition: all 0.2s;
  text-decoration: none;
}

.social-link:hover {
  background: var(--accent);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.social-link.whatsapp:hover {
  background: #25d366;
  color: #fff;
}

.footer-link {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 0;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ===== NO DATA ===== */
.no-data {
  text-align: center;
  color: var(--text-light);
  padding: 24px;
  font-style: italic;
}

/* ===== BTN BACK ===== */
.btn-back {
  margin-top: 24px;
  text-align: center;
}

.btn-back .btn {
  color: var(--text);
  background: var(--bg-card);
  border: 2px solid var(--border);
}

.btn-back .btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== GALERÍA ===== */
.galeria-section {
  max-width: 1100px;
}

.galeria-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
  justify-content: center;
}

.filtro-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filtro-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filtro-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.galeria-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-card);
  cursor: zoom-in;
  transition: transform 0.3s;
}

.galeria-item:hover {
  transform: translateY(-4px);
}

.galeria-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.galeria-item.oculto {
  display: none;
}

.galeria-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 20px 16px 16px;
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.galeria-item:hover .galeria-overlay {
  transform: translateY(0);
}

.galeria-overlay h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.galeria-overlay p {
  font-size: 0.8rem;
  opacity: 0.9;
}

.galeria-overlay .categoria {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 8px;
  background: var(--accent);
  color: var(--primary-dark);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.abierto {
  opacity: 1;
  visibility: visible;
}

.lightbox-contenido {
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
  position: relative;
}

.lightbox-contenido img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
  margin-top: 16px;
  color: #fff;
}

.lightbox-info h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.lightbox-info p {
  font-size: 0.95rem;
  opacity: 0.8;
}

.lightbox-cerrar,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.lightbox-cerrar {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-cerrar:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent);
  color: var(--primary-dark);
}

@media (max-width: 768px) {
  .galeria-filtros {
    gap: 6px;
  }
  .filtro-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
  .filtro-btn i {
    display: none;
  }
  .galeria-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .galeria-item img {
    height: 150px;
  }
  .lightbox-cerrar,
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-cerrar { top: 10px; right: 10px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-container {
    height: 56px;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .nav-open {
    display: flex;
  }

  .nav a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }

  .hero {
    padding: 48px 0;
    margin: -40px 0 24px;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .form-boletin {
    padding: 20px;
  }

  .comunicados-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .materia-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table th,
  .table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .input-nota {
    width: 80px;
  }

  .ref-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== RESPONSIVE: PANEL / MODALES ===== */
@media (max-width: 768px) {
  .dashboard-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .search-box {
    max-width: none;
  }

  .dashboard-toolbar .btn {
    justify-content: center;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal {
    padding: 12px;
  }

  .modal-dialog {
    max-height: calc(100vh - 24px);
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-body {
    padding: 18px;
  }

  .modal-footer {
    padding: 14px 18px;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .nota-final-row {
    align-items: flex-start;
  }

  .semestres-grid {
    grid-template-columns: 1fr;
  }

  .table-actions {
    flex-wrap: nowrap;
  }
}
