/* Variable CSS para el color corporativo */
:root {
  --primary-color: #223d71;
  --primary-dark: #1a2f57;
  --primary-light: #2d4a85;
  --accent-color: #4a90e2;
  --text-dark: #333;
  --text-light: #666;
  --bg-light: #f8f9fa;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Habilitar View Transitions nativas */
@view-transition {
  navigation: auto;
}

/* Mensajes y Alertas */
.messages-container {
  /* Fijo bajo el header: los avisos se ven aunque la página esté desplazada
     (p. ej. tras el auto-scroll al primer campo con error del formulario) */
  position: fixed;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 40px);
  max-width: 600px;
}

.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.1);
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes slideIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Definición de fuentes Myriad Pro */
@font-face {
  font-family: 'Myriad Pro';
  src: url('/static/fonts/MyriadPro-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Myriad Pro';
  src: url('/static/fonts/MyriadPro-Semibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Myriad Pro';
  src: url('/static/fonts/MyriadPro-Bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}

/* Aplicar Myriad Pro a toda la web */
html, body, * {
  font-family: 'Myriad Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Prevenir scroll en toda la página */
html, body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* Modo scroll para páginas con mucho contenido */
body.scroll-mode {
  height: auto;
  overflow-y: auto;
  background-attachment: fixed;
}

body.scroll-mode .wrapper {
  min-height: 100vh;
}

body.scroll-mode .main-content {
  flex: 1;
}

body.scroll-mode .main-footer {
  margin-top: auto;
}

/* Estilos para el header */
.main-header {
  background: white;
  padding: 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  view-transition-name: main-header;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 40px; /* Reducido de 20px a 12px */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
}

.logo-container {
  grid-column: 1;
  justify-self: start;
}

.logo-link {
  display: block;
  transition: transform 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.05);
}

.logo-img {
  max-height: 65px; /* Altura controlada para que no sea enorme */
  width: auto;
  display: block;
  view-transition-name: main-logo;
}

.title-container {
  grid-column: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-greeting {
  /* Margen extra al gap para separar el saludo del grupo de botones */
  margin-right: 13px;
  font-size: 0.95em;
  color: var(--primary-color);
  font-weight: 600;
}

.logout-button-header {
  display: inline-block;
  background: transparent;
  color: var(--primary-color);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--primary-color);
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: inherit;
}

.logout-button-header:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Acceso al panel de administración, junto al botón de cerrar sesión */
.admin-button-header {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--primary-color);
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: inherit;
}

.admin-button-header:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: #fff;
}

.main-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 2.2em;
  font-weight: bold;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.subtitle {
  color: var(--text-light);
  font-size: 0.9em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}

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

/* Contenido principal */
.main-content {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  view-transition-name: page-content;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 80px 40px;
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.hero-section::before {
  content: '';
  position: fixed; /* Anclada al viewport: visible siempre, independiente del scroll */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/static/images/unizar.png') no-repeat bottom right;
  background-size: 600px;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

@media (max-width: 768px) {
  .hero-section {
    padding: 60px 20px;
  }
  
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }

  .hero-left, .hero-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .login-button-container {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .hero-title {
    font-size: 2.2em !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .hero-subtitle {
    font-size: 1.1em !important;
    text-align: center !important;
  }
  
  .login-button {
    width: 100%;
    max-width: 300px;
    padding: 14px 30px !important;
  }
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-title {
  color: white;
  font-size: 3em;
  font-weight: bold;
  margin: 0 0 15px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.8s ease;
  text-align: left;
  white-space: nowrap;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.3em;
  margin: 0;
  font-weight: 400;
  animation: fadeInUp 0.8s ease 0.2s both;
  text-align: left;
}

.login-button-container {
  animation: fadeInUp 0.8s ease 0.4s both;
}

.login-button {
  display: inline-block;
  background: white;
  color: var(--primary-color);
  padding: 16px 50px;
  border-radius: 50px;
  font-size: 1.1em;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.login-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  background: var(--accent-color);
  color: white;
}

.login-button:active {
  transform: translateY(-1px);
}



/* Estilos para el footer */
.main-footer {
  background-color: white;
  color: var(--primary-color);
  padding: 12px 0;
  text-align: center;
  flex-shrink: 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  position: relative;
  z-index: 10; /* Asegura que esté por encima de ilustraciones de fondo */
  view-transition-name: main-footer;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-text {
  margin: 0 0 3px 0;
  font-size: 0.8em;
  /* Interlineado propio, no el del cuerpo: es lo que fija la altura del pie
     (56px de contenido) y lo que lo deja igual que en el resto de proyectos. */
  line-height: normal;
  color: var(--primary-color);
}

.footer-content p:last-child {
  margin: 0;
  font-size: 0.7em;
}

/* La universidad y el servicio van en la misma línea; el guion es adorno, así
   que se dibuja aquí y no en el texto, con su aire a los dos lados. */
.footer-sep {
  padding: 0 0.5em;
}

.footer-link {
  color: var(--primary-color);
  text-decoration: underline;
}

.footer-link:hover {
  text-decoration: none;
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Custom View Transitions for Content */
::view-transition-old(page-content) {
  animation: 150ms ease-out both fadeOut;
}

::view-transition-new(page-content) {
  animation: 300ms ease-out both fadeInUp;
}

/* Responsive para móviles */
@media (max-width: 992px) {
  .header-content {
    padding: 15px 25px;
    gap: 20px;
  }
  
  .main-title {
    font-size: 1.8em;
  }
  
  .logo-img {
    max-height: 60px;
  }
}

@media (max-width: 768px) {
  .header-content {
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto;
    padding: 12px 15px;
    gap: 10px;
  }

  .logo-container {
    grid-column: 1;
    grid-row: 1;
  }

  .title-container {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
    gap: 8px;
  }

  .main-title {
    font-size: 1.2em;
  }

  .subtitle {
    font-size: 0.65em;
    letter-spacing: 0.5px;
  }

  .logo-img {
    max-height: 40px;
  }

  .logout-button-header,
  .admin-button-header {
    padding: 5px 12px;
    font-size: 0.75em;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 10px 8px;
    gap: 5px;
  }

  .main-title {
    font-size: 1.1em;
  }

  .subtitle {
    display: none; /* Ocultamos subtitulo en pantallas muy pequeñas para que quepa todo */
  }

  .logo-img {
    max-height: 35px;
  }
}

/* Dashboard Page Styles */
.dashboard-page {
  flex: 1;
  padding: 30px 40px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.dashboard-page::before {
  content: '';
  position: fixed; /* Anclada al viewport: visible siempre, independiente del scroll */
  bottom: -40px;
  right: -50px;
  width: 600px;
  height: 600px;
  background: url('/static/images/unizar.png') no-repeat bottom right;
  background-size: contain;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
  transform: rotate(-5deg);
  filter: brightness(0) saturate(100%) invert(18%) sepia(49%) saturate(1458%) hue-rotate(193deg) brightness(91%) contrast(91%);
}

.dashboard-container {
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.solicitudes-section {
  background: white;
  border-radius: 20px;
  padding: 30px 40px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 20px;
}

.section-title {
  color: var(--primary-color);
  font-size: 1.8em;
  font-weight: bold;
  margin: 0 0 20px 0;
  flex-shrink: 0;
}

.solicitudes-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

.solicitud-card {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.solicitud-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.empty-state {
  text-align: center;
  padding: 20px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-message {
  color: var(--text-light);
  font-size: 1.1em;
  margin: 0;
}

.create-section {
  padding: 10px 0 20px 0;
  text-align: center;
  flex-shrink: 0;
}

.create-button-container {
  display: flex;
  justify-content: center;
}

.create-button {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 16px 50px;
  border-radius: 50px;
  font-size: 1.1em;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(34, 61, 113, 0.3);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.create-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(34, 61, 113, 0.4);
  background: var(--primary-dark);
}

.create-button:active {
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .dashboard-page {
    padding: 20px 15px;
  }

  .solicitudes-section {
    padding: 20px 15px;
    border-radius: 15px;
  }

  .section-title {
    font-size: 1.5em;
    text-align: center;
  }

  .solicitud-card {
    padding: 15px;
  }

  .create-button {
    width: 100%;
    max-width: 400px;
    padding: 14px 20px;
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.3em;
  }
}

/* Form Page Styles */
.crear-solicitud-page {
  flex: 1;
  padding: 30px 40px;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.crear-solicitud-page::before {
  content: '';
  position: fixed; /* Anclada al viewport: visible siempre, independiente del scroll */
  bottom: -40px;
  right: -50px;
  width: 600px;
  height: 600px;
  background: url('/static/images/unizar.png') no-repeat bottom right;
  background-size: contain;
  opacity: 0.15;
  z-index: 0; /* Volvemos a 0 para que sea visible sobre el fondo del body */
  pointer-events: none;
  transform: rotate(-5deg);
  filter: brightness(0) saturate(100%) invert(18%) sepia(49%) saturate(1458%) hue-rotate(193deg) brightness(91%) contrast(91%);
}

.main-form-title {
  color: var(--primary-color);
  font-size: 2.2em;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 20px;
  max-width: 900px;
}

.form-description-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  border-left: 6px solid var(--accent-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

.form-description-card p {
  color: var(--text-dark);
  line-height: 1.6;
  margin: 0 0 15px 0;
  font-size: 1.05em;
}

.email-note {
  font-weight: 600;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  margin-bottom: 0 !important;
}

.email-highlight {
  margin-bottom: 0;
}

.email-highlight label {
  font-size: 1.1em;
}

.required {
  color: #d93025;
  margin-left: 4px;
}

.inline-link {
  color: var(--accent-color);
  text-decoration: underline;
}

.form-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  z-index: 1;
  position: relative;
}

.form-header {
  margin-bottom: 25px;
}

.back-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 20px;
  transition: transform 0.2s ease;
}

.back-link:hover {
  transform: translateX(-5px);
}

.main-form {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 25px;
  margin-top: 10px;
}

.input-group {
  grid-column: span 12;
  margin-bottom: 20px;
}

@media (min-width: 992px) {
  .col-span-1 { grid-column: span 1; }
  .col-span-2 { grid-column: span 2; }
  .col-span-3 { grid-column: span 3; }
  .col-span-4 { grid-column: span 4; }
  .col-span-5 { grid-column: span 5; }
  .col-span-6 { grid-column: span 6; }
  .col-span-7 { grid-column: span 7; }
  .col-span-8 { grid-column: span 8; }
  .col-span-9 { grid-column: span 9; }
  .col-span-10 { grid-column: span 10; }
  .col-span-11 { grid-column: span 11; }
  .col-span-12 { grid-column: span 12; }
}

.checkbox-list-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  align-items: center;
  background-color: var(--bg-light);
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  height: 46px;
  box-sizing: border-box;
}

.checkbox-item-horizontal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95em;
  color: var(--text-dark);
  cursor: pointer;
  white-space: nowrap;
}

.checkbox-item-horizontal input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.form-info-box {
  background-color: var(--bg-light);
  border-left: 4px solid var(--primary-color);
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.form-info-box p {
  margin: 0;
  font-size: 0.95em;
  color: var(--text-dark);
  line-height: 1.5;
}

.form-section-title {
  color: var(--primary-color);
  font-size: 1.3em;
  font-weight: 600;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-light);
}

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

.input-group label {
  display: block;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 8px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 1em;
  transition: all 0.3s ease;
  background-color: var(--bg-light);
  box-sizing: border-box;
  height: 46px;
}

.input-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23223d71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 18px;
  padding-right: 45px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--bg-light);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: normal !important;
  cursor: pointer;
  color: var(--text-dark);
}

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

.input-group textarea {
  height: auto;
  min-height: 100px;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(34, 61, 113, 0.1);
}

/* Tooltip Styles */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  margin-left: 6px;
  position: relative;
  vertical-align: -3px;
  color: var(--primary-color);
  height: 0;
}

.info-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.info-icon .tooltip-text {
  visibility: hidden;
  width: 300px;
  background-color: var(--primary-dark);
  color: #fff;
  text-align: left;
  border-radius: 8px;
  padding: 15px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: normal;
  font-style: normal;
  line-height: 1.4;
  font-size: 0.9em;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.info-icon .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--primary-dark) transparent transparent transparent;
}

.info-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Duration Controls Styles */
.duration-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  width: 100%;
}

.duration-controls select {
  flex: 1;
  transition: flex 0.3s ease;
}

.duration-controls select.shrink {
  flex: 0 0 40%;
}

.other-input-inline {
  display: block;
  flex: 1;
  opacity: 0.4;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.05) !important;
  cursor: not-allowed;
  transition: all 0.3s ease;
}

.other-input-inline.active {
  opacity: 1;
  pointer-events: auto;
  background-color: white !important;
  cursor: text;
  box-shadow: 0 0 0 3px rgba(34, 61, 113, 0.1);
  border-color: var(--primary-color);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.form-actions {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.submit-button {
  background: var(--primary-color);
  color: white;
  padding: 16px 60px;
  border-radius: 50px;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34, 61, 113, 0.3);
  transition: all 0.3s ease;
}

.submit-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(34, 61, 113, 0.4);
  background: var(--primary-dark);
}

@media (max-width: 992px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}


/* Styles for Firmar and Ver Solicitud pages with illustration */
.firmar-page,
.ver-solicitud-page,
.ver-comentarios-page,
.gestion-usuarios-page {
  flex: 1;
  padding: 30px 40px;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden; /* Ensure illustration doesn't overflow */
}

.firmar-page::before,
.ver-solicitud-page::before,
.ver-comentarios-page::before,
.gestion-usuarios-page::before {
  content: '';
  position: fixed; /* Anclada al viewport: visible siempre, independiente del scroll */
  bottom: -40px; /* Slight offset like dashboard */
  right: -50px;
  width: 600px;
  height: 600px;
  background: url('/static/images/unizar.png') no-repeat bottom right;
  background-size: contain;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
  transform: rotate(-5deg);
  filter: brightness(0) saturate(100%) invert(18%) sepia(49%) saturate(1458%) hue-rotate(193deg) brightness(91%) contrast(91%);
}

/* Container for firmar page content to stay above illustration */
.firmar-container,
.ver-comentarios-container {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ===== Custom Select (reemplazo visual de <select> nativos) ===== */
.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
  flex: 1;
  transition: flex 0.3s ease, width 0.3s ease;
}

.custom-select.shrink {
  flex: 0 0 40% !important;
}

/* El select nativo queda oculto pero presente para el envío del formulario */
.custom-select > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-size: 1em;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.custom-select-trigger:focus,
.custom-select.open .custom-select-trigger {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(34, 61, 113, 0.1);
}

.custom-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Placeholder ("Selecciona") en color atenuado */
.custom-select:not(.has-value) .custom-select-value {
  color: var(--text-light);
}

.custom-select-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary-color);
  transition: transform 0.25s ease;
}

.custom-select.open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.custom-select.open .custom-select-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select.open-up .custom-select-panel {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(6px);
}

.custom-select.open-up.open .custom-select-panel {
  transform: translateY(0);
}

.custom-select-option {
  padding: 11px 15px;
  font-size: 0.95em;
  color: var(--text-dark);
  line-height: 1.4;
  cursor: pointer;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: background-color 0.15s ease;
}

.custom-select-option.is-active {
  background-color: var(--bg-light);
}

.custom-select-option.is-selected {
  background-color: rgba(34, 61, 113, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.custom-select-option.is-placeholder {
  color: var(--text-light);
}

.custom-select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.custom-select.is-disabled .custom-select-trigger {
  background-color: #f0f0f0;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.custom-select.is-disabled .custom-select-chevron {
  color: #999;
}

/* Estado de error (validación del formulario) */
.input-group.has-error .custom-select-trigger {
  border-color: #d93025 !important;
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.1) !important;
  background-color: #fff8f7 !important;
}

/* ===== Cabecera fija del formulario 2 (Propuesta de enseñanza) ===== */
.propuesta-fixed-header {
  background: #f4f7fc;
  border: 1px solid #d8e0ef;
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 24px;
}

.propuesta-fixed-header .propuesta-fixed-title {
  color: var(--primary-color);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.propuesta-fixed-header .propuesta-fixed-dest {
  color: #333;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.propuesta-fixed-header .propuesta-fixed-note {
  color: #666;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed #d8e0ef;
}

/* ===== DataTables (skin UNIZAR) =====
   Controles del listado (Mostrar N registros, Buscar, paginación, orden)
   alineados con el resto de la aplicación. El select de "Mostrar N registros"
   se reemplaza por el custom select (ver custom-select.js + initComplete). */

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 22px;
  color: var(--text-dark);
  font-size: 0.95em;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 500;
}

/* Custom select compacto dentro de "Mostrar N registros" */
.dataTables_wrapper .dataTables_length .custom-select {
  display: inline-block;
  width: 92px;
  flex: none;
  vertical-align: middle;
}

.dataTables_wrapper .dataTables_length .custom-select-trigger {
  height: 40px;
  padding: 8px 12px;
  font-size: 0.92em;
}

/* Respaldo si el JS aún no ha reemplazado el select nativo */
.dataTables_wrapper .dataTables_length select:not([data-custom-select]) {
  height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.92em;
}

.dataTables_wrapper .dataTables_filter input {
  height: 40px;
  width: 230px;
  padding: 8px 14px;
  margin-left: 0 !important;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.95em;
  transition: all 0.3s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(34, 61, 113, 0.1);
}

/* Indicadores de ordenación: una sola flecha nítida sobre la cabecera azul.
   El prefijo `body` es necesario en todo este bloque: el CSS de DataTables se
   carga después de main.css y sus reglas llevan !important, así que sin subir
   la especificidad ganarían ellos todos los empates. */
body table.dataTable thead > tr > th.sorting:before,
body table.dataTable thead > tr > th.sorting:after,
body table.dataTable thead > tr > th.sorting_asc:before,
body table.dataTable thead > tr > th.sorting_asc:after,
body table.dataTable thead > tr > th.sorting_desc:before,
body table.dataTable thead > tr > th.sorting_desc:after {
  color: #fff;
  font-size: 0.62em;
  line-height: 1;
  right: 10px;
  opacity: 0.35;
}

body table.dataTable thead > tr > th.sorting:before,
body table.dataTable thead > tr > th.sorting_asc:before,
body table.dataTable thead > tr > th.sorting_desc:before {
  content: "▲";
  bottom: calc(50% + 1px);
}

body table.dataTable thead > tr > th.sorting:after,
body table.dataTable thead > tr > th.sorting_asc:after,
body table.dataTable thead > tr > th.sorting_desc:after {
  content: "▼";
  top: calc(50% + 1px);
}

body table.dataTable thead > tr > th.sorting_asc:before,
body table.dataTable thead > tr > th.sorting_desc:after {
  opacity: 1;
}

/* Estado vacío */
.dataTables_wrapper td.dataTables_empty {
  padding: 45px 15px !important;
  color: var(--text-light);
  background: #fafbfc;
}

/* Pie: info y paginación */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin-top: 25px !important;
  padding-top: 10px;
}

.dataTables_wrapper .dataTables_info {
  color: var(--text-light);
  font-size: 0.9em;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid transparent !important;
  border-radius: 50px !important;
  padding: 7px 16px;
  margin-left: 6px;
  background: transparent !important;
  color: var(--primary-color) !important;
  font-weight: 600;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
  background: rgba(34, 61, 113, 0.08) !important;
  color: var(--primary-color) !important;
  box-shadow: none;
}

/* Página activa: círculo corporativo con el número en blanco */
body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary-color) !important;
  color: #fff !important;
  min-width: 38px;
  padding: 7px 12px;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  color: var(--text-light) !important;
  background: transparent !important;
  cursor: default;
  box-shadow: none;
}
