/* style.css */

/* Base Styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* Previene barras de desplazamiento no deseadas en el cuerpo */
  font-family: sans-serif;
}

/* Employees Container */
#empleados-container {
  position: fixed; /* Asegura que se superponga */
  top: 60px;
  left: 0; /* Ocupa todo el ancho cuando está activo */
  right: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  text-align: center;
  display: none; /* Oculto por defecto */
}

/* Top Bar */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Altura fija para la barra superior */
    background-color: #b9c7ec; /* Color de fondo */
    display: flex; /* Usar flexbox para alinear elementos */
    align-items: center; /* Alinear verticalmente al centro */
    justify-content: space-between; /* Espaciar elementos */
    padding: 0 10px; /* Pequeño padding lateral */
    z-index: 10003; /* Mayor que otros elementos para estar siempre encima */
}

/* Nuevo estilo para el botón de hamburguesa dentro de la barra superior */
.top-bar-left-button {
  background-color: #ffffff; /* Fondo blanco */
  border: 2px solid #007bff; /* Borde azul */
  border-radius: 50%; /* Circular */
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Sombra */
  cursor: pointer;
  font-size: 24px; /* Tamaño del icono */
  color: #007bff; /* Color del icono */
  width: 48px; /* Ancho fijo */
  height: 48px; /* Alto fijo */
  display: flex; /* Para centrar el contenido (SVG) */
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0; /* No permitir que se encoja */
  position: relative; /* Asegura que el z-index tenga efecto */
  z-index: 1; /* Asegura que esté por encima de otros elementos en la top-bar si hay conflicto */
}

.top-bar-left-button:hover {
  background-color: #e6f7ff;
  border-color: #0056b3;
  color: #0056b3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#top-bar .logo-container {
  /* Ya no necesita posición absoluta, el flexbox lo maneja */
  position: static;
  margin: 0 auto; /* Centrar el logo en el espacio restante */
  background-color: white;
  border-radius: 50%;
  padding: 3px;
  flex-grow: 0.2; /* Permitir que el logo ocupe el espacio flexible */
  text-align: center; /* Centrar la imagen dentro del contenedor flexible */
  z-index: 0; /* Asegura que el botón de hamburguesa esté por encima si hay conflicto */
}

#top-bar img {
  height: 50px;
  width: auto;
  vertical-align: middle; /* Asegurar que la imagen esté centrada si hay texto */
}


#reset-view-button {
  position: static; /* Ya no es absoluto, flexbox lo posiciona */
  background-color: transparent;
  color: #007bff;
  border: 1px solid #007bff;
  margin-right: 30px;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  display: none; /* Inicialmente oculto */
  transition: all 0.3s ease;
  flex-shrink: 0; /* No permitir que se encoja */
  z-index: 1; /* Asegura que esté por encima si hay conflicto */
}

/* Left Sidebar Banner */
#left-banner {
  position: fixed;
  top: 60px;             /* Debajo de la barra superior */
  left: 0;
  width: 60px;           /* Ancho normal de la barra lateral */
  height: calc(100% - 60px); /* Ocupa la altura restante */
  background-color: #fff;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  z-index: 9999; /* Por encima del mapa pero debajo de otros banners flotantes */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px; /* Ajuste para dejar espacio en la parte superior */
  transition: transform 0.3s ease; /* Transición suave para el efecto de deslizamiento */
}

#left-banner.hidden {
  transform: translateX(-60px); /* Desliza la barra lateral completamente fuera de la vista */
}


/* Sidebar Buttons (estilos generales para todos los botones dentro de #left-banner) */
#left-banner button,
#left-banner .widget-button { /* Incluye todos los botones y el div.widget-button */
  background-color: #ffffff; /* Fondo blanco */
  border: 2px solid #007bff; /* Borde azul para todos */
  border-radius: 50%; /* Circular para todos */
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Sombra para efecto flotante */
  cursor: pointer;
  font-size: 24px; /* Tamaño consistente del icono/emoji */
  color: #007bff; /* Color azul para los iconos/emojis */
  width: 48px; /* Ancho fijo */
  height: 48px; /* Alto fijo */
  display: flex; /* Para centrar el contenido (SVG) */
  justify-content: center;
  align-items: center;
  margin-top: 10px; /* Margen superior para espaciar */
  padding: 0; /* Asegura que no haya padding interno que afecte el tamaño */
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

#left-banner button:hover,
#left-banner .widget-button:hover {
    background-color: #e6f7ff; /* Fondo ligeramente azul al pasar el ratón */
    border-color: #0056b3; /* Borde azul más oscuro al pasar el ratón */
    color: #0056b3; /* Icono/emoji azul más oscuro */
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); /* Sombra más pronunciada */
}

/* Map Container */
#map {
  position: absolute;
  top: 60px; /* Debajo de la barra superior */
  left: 60px; /* Crucial: comienza después del left-banner */
  right: 0;
  bottom: 0;
  z-index: 1; /* Asegura que esté detrás de los banners pero sea visible */
  transition: left 0.3s ease; /* Transición suave para cuando el sidebar se oculte */
}

/* Ajuste del mapa cuando la barra lateral está oculta */
body:has(#left-banner.hidden) #map {
  left: 0 !important; /* El mapa ocupa todo el ancho cuando la barra lateral está oculta */
}

/* Base styles for floating banners (notes, fields, layers, forms) */
#fields-banner,
#banner,
#layers-banner,
#activity-form-banner,
#note-form-banner {
    position: fixed; /* Mantiene la posición relativa al viewport */
    top: 60px; /* Debajo de la barra superior, ajustar individualmente si es necesario */
    right: 0; /* Por defecto a la derecha */
    width: 350px; /* Ancho por defecto */
    max-width: 90%; /* Asegura que no se desborde en pantallas pequeñas */
    height: calc(100% - 60px); /* Ajustar basado en si es un banner de altura completa */
    background-color: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 10002; /* Mayor que el mapa, menor que los modales */
    padding: 20px;
    overflow-y: auto;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Transición suave */
    display: none; /* Oculto por defecto */
}

/* Ajustes específicos para activity-form-banner y note-form-banner */
#activity-form-banner,
#note-form-banner {
    top: auto; /* Permite posicionamiento desde abajo */
    bottom: 20px; /* Elevado desde el borde inferior */
    height: auto; /* Altura automática basada en el contenido */
    max-height: 80vh; /* Máximo 80% del alto del viewport */
    left: 80px; /* Posicionamiento inicial junto al sidebar, ahora relativo al sidebar */
    right: auto;
    width: 350px;
    border-radius: 15px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transform: translateX(0); /* Posición inicial */
    transition: transform 0.3s ease, left 0.3s ease, right 0.3s ease;
}

/* Ajuste para report-form-banner */
#report-form-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    max-width: 90%;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10005;
    display: none;
}

#report-form-banner span#close-report-banner {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    color: #555;
}


/* Ajuste de posición de banners cuando left-banner está oculto */
body:has(#left-banner.hidden) #fields-banner,
body:has(#left-banner.hidden) #banner,
body:has(#left-banner.hidden) #layers-banner {
    transform: translateX(0%) !important; /* Si estaban movidos, los pone a la derecha del todo */
    right: 0 !important;
    left: auto !important;
}

/* Ajuste para formularios cuando el sidebar está oculto */
body:has(#left-banner.hidden) #activity-form-banner,
body:has(#left-banner.hidden) #note-form-banner {
    left: 20px !important; /* Más hacia la izquierda cuando el sidebar no está */
    /* Mantener bottom: 20px */
}

/* Ajuste para la tarjeta de información cuando el sidebar está oculto */
body:has(#left-banner.hidden) #fieldInfoCard {
    left: 20px !important;
    /* Mantener bottom: 20px */
}


/* Mobile Navigation */
#mobile-nav {
  display: none; /* Oculto por defecto, solo visible en móvil */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: #fff;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  justify-content: space-around;
  align-items: center;
  z-index: 10005;
}

/* Nuevo estilo para botones de navegación móvil */
.mobile-nav-button {
  background-color: #ffffff;
  border: 2px solid #007bff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  font-size: 24px;
  color: #007bff;
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-nav-button.active {
    color: #007bff; /* Color para el botón activo en móvil */
}

.mobile-nav-button:hover {
  background-color: #e6f7ff;
  border-color: #0056b3;
  color: #0056b3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}


/* Existing styles for notes list and its items */
.notes-list {
  margin-top: 15px;
  max-height: calc(100vh - 200px); /* Ajusta según el encabezado/pie de página */
  overflow-y: auto;
}

.note-item {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.note-content {
  font-size: 0.9em;
  color: #555;
  white-space: pre-wrap; /* Preserva los espacios en blanco y saltos de línea */
}

.add-note-button {
  position: absolute; /* Debe ser absoluto dentro del banner */
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #4CAF50;
  color: white;
  font-size: 30px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
}

.add-note-button:hover {
  background-color: #45a049;
}

/* Field list styles */
#field-list {
  list-style: none;
  color: #007bff;
  padding: 0;
  margin-top: 15px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.field-item {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.field-item:hover {
  background-color: #e9e9e9;
}

/* Search field for fields banner */
#fields-banner #searchField {
  width: 100%;
  color: #007bff;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #007bff;
  border-radius: 5px;
  box-sizing: border-box; /* Asegura que el padding no añada al ancho total */
  font-size: 14px;
}

/* Field Info Card */
#fieldInfoCard {
  position: fixed;
  bottom: 20px;
  left: 80px; /* Ajustado para estar al lado del left-banner */
  width: 280px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 20px;
  z-index: 1001; /* Por encima del mapa, debajo de los modales */
  display: none; /* Oculto por defecto */
  opacity: 0;
  transform: translateX(-100%); /* Comienza fuera de la pantalla a la izquierda */
  transition: transform 0.3s ease-out, opacity 0.3s ease-out, left 0.3s ease; /* Añadida transición para 'left' */
  pointer-events: none; /* Sin interacción cuando está oculto */
}

#fieldInfoCard.visible {
  opacity: 1;
  transform: translateX(0); /* Se desliza */
  pointer-events: auto; /* Permite interacción */
}

#fieldInfoCard .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#fieldInfoCard .card-header span {
  font-weight: bold;
  font-size: 1.2em;
}

#fieldInfoCard .edit-button {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
}

#fieldInfoCard .card-body .field-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

#fieldInfoCard .card-body .field-label {
  font-weight: 600;
  color: #555;
}

/* Modal styles */
.modal {
  display: none; /* Oculto por defecto */
  position: fixed; /* Permanece en su lugar */
  z-index: 2000; /* Se coloca encima */
  left: 0;
  top: 0;
  width: 100%; /* Ancho completo */
  height: 100%; /* Altura completa */
  overflow: auto; /* Habilita el scroll si es necesario */
  background-color: rgba(0,0,0,0.4); /* Negro con opacidad */
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%; /* Puede ser responsivo */
  max-width: 500px; /* Ancho máximo */
  border-radius: 10px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-content label {
  font-weight: bold;
  margin-top: 5px;
}

.modal-content input[type="text"],
.modal-content input[type="date"] {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.modal-content button[type="submit"] {
  background-color: #4CAF50;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 15px;
}

.modal-content button[type="submit"]:hover {
  background-color: #45a049;
}

/* Layer list styles */
#layers-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

#fields-banner h3 {
  border-bottom: 2px solid ##007bff; /* Cambia #COLOR_DESEADO al color que quieras */
  padding-bottom: 5px; /* Espacio entre el texto y la línea */
  margin-bottom: 10px; /* Espacio entre la línea y el siguiente elemento */
}

#layers-list .layer-item {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.layer-item:hover {
  background-color: #e9e9e9;
}

#layers-list .layer-item.active {
    background-color: #e0f7fa; /* Azul claro para la capa activa */
    border-color: #00bcd4; /* Borde cian */
    font-weight: bold;
}

/* Legend styles */
.legend {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  line-height: 1.5em;
  font-size: 14px;
  z-index: 1000; /* Asegura que la leyenda esté por encima del mapa */
  transition: right 0.3s ease; /* Transición suave para el reposicionamiento */
}

.legend h4 {
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

.legend-scale .legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.legend-scale i {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 1px solid #ccc;
}

/* Styles for nested layers */
.year-group, .month-group {
    margin-bottom: 5px;
    border-radius: 5px;
    overflow: hidden;
}

.year-header, .month-header {
    background-color: #f0f0f0;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.year-header .toggle-arrow, .month-header .toggle-arrow {
    transition: transform 0.2s ease-in-out;
}

.year-group.expanded > .year-header .toggle-arrow,
.month-group.expanded > .month-header .toggle-arrow {
    transform: rotate(90deg);
}

.year-content, .month-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.year-group.expanded > .year-content,
.month-group.expanded > .month-content {
    max-height: 500px; /* Valor suficientemente grande para mostrar todo el contenido */
}

/* Formularios de notas y actividades - estilos generales */
#note-form-banner form,
#activity-form-banner form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#note-form-banner select,
#activity-form-banner select,
#note-form-banner input,
#activity-form-banner input[type="number"],
#activity-form-banner input[type="text"],
#activity-form-banner textarea,
#report-form-banner input[type="date"],
#report-form-banner button {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Incluye padding y borde en el ancho total */
    font-size: 14px;
}

/* Specific styles for activity form date inputs */
#activity-form-banner .activity-date-inputs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

#activity-form-banner .activity-date-inputs input {
    width: 33%;
    padding: 5px;
}

/* Specific styles for activity form category dropdown */
#activity-form-banner .activity-form-group select {
    width: 100%;
    padding: 5px;
    font-size: 16px;
}

/* Styles for extra fields in activity form */
#activity-form-banner .activity-extra-fields {
    margin-top: 10px;
}

#activity-form-banner .activity-extra-fields label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

#activity-form-banner .activity-extra-fields select,
#activity-form-banner .activity-extra-fields input,
#activity-form-banner .activity-extra-fields textarea {
    width: 100%;
    padding: 5px;
    font-size: 14px;
    margin-top: 0; /* Override default margin-top if any */
}

/* Dosis and Siembra/Recoleccion inputs */
#activity-form-banner .dosis-group,
#activity-form-banner .siembra-inputs,
#activity-form-banner .recoleccion-inputs,
#activity-form-banner .riego-inputs {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 5px;
}

#activity-form-banner .dosis-group .dosis-title {
    text-align: center;
    font-weight: 600;
    margin-bottom: 5px;
}

#activity-form-banner .dosis-inputs select,
#activity-form-banner .dosis-inputs input,
#activity-form-banner .siembra-inputs input,
#activity-form-banner .siembra-inputs select,
#activity-form-banner .recoleccion-inputs input,
#activity-form-banner .recoleccion-inputs select {
    width: 50%;
    padding: 5px;
}

#activity-form-banner .siembra-inputs input { width: 60%; }
#activity-form-banner .siembra-inputs select { width: 40%; }
#activity-form-banner .recoleccion-inputs input { width: 60%; }
#activity-form-banner .recoleccion-inputs select { width: 40%; }
#activity-form-banner .riego-inputs input { width: 60%; }
#activity-form-banner .riego-inputs select { width: 40%; }

/* Activity form buttons */
#activity-form-banner button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

#activity-form-banner button:hover {
    background-color: #0056b3;
}

#activity-form-banner #cancel-activity {
    background-color: #dc3545;
}

#activity-form-banner #cancel-activity:hover {
    background-color: #c82333;
}

#activity-form-banner #download-report-btn {
    background-color: #28a745;
}
#activity-form-banner #download-report-btn:hover {
    background-color: #218838;
}

/* Note form specific styles */
#note-form-banner select,
#note-form-banner input,
#note-form-banner textarea {
    width: 100%;
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#note-form-banner .note-extra-fields {
    margin-bottom: 10px;
}

#note-form-banner .note-extra-fields select {
    margin-top: 5px; /* Adjust spacing for stacked selects */
}

#note-form-banner button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

#note-form-banner button:hover {
    background-color: #0056b3;
}

#note-form-banner #cancel-note {
    background-color: #dc3545;
}

#note-form-banner #cancel-note:hover {
    background-color: #c82333;
}

#note-form-banner #note-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
#note-form-banner #note-buttons button {
    flex: 1;
}

/* Estilos para select2 */
.select2-container--default .select2-selection--single {
    border: 1px solid #ccc !important;
    border-radius: 5px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px !important;
    padding-left: 8px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px !important;
}
.select2-container .select2-selection--single {
    box-sizing: border-box; /* Asegura que el padding se incluya en el ancho */
}


/* Media Queries for Responsive Design */
@media (max-width: 1024px) {
  /* Ajustes para tabletas y pantallas más pequeñas si es necesario */
}

@media (max-width: 768px) {
  /* Oculta la barra lateral de escritorio en pantallas más pequeñas */
  #left-banner {
    display: none !important;
  }

  /* El botón de hamburguesa siempre visible en móvil */
  .top-bar-left-button { /* Usar la nueva clase aquí */
    display: flex; /* Asegura que se muestre en móvil */
  }

  /* Muestra la navegación móvil inferior */
  #mobile-nav {
    display: flex;
  }

  /* El mapa ocupa todo el espacio menos la barra superior y la navegación inferior */
  #map {
    top: 60px !important;
    left: 0 !important;
    bottom: 56px !important;
    right: 0 !important;
  }

  /* Ajusta banners y formularios para que ocupen todo el ancho en móvil */
  #fields-banner,
  #banner,
  #layers-banner,
  #activity-form-banner,
  #note-form-banner,
  #fieldInfoCard {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 0 !important; /* Esquinas rectas en móvil */
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1); /* Sombra en la parte superior */
  }

  /* Altura completa para los banners principales en móvil */
  #fields-banner, #banner, #layers-banner {
    top: 60px; /* Debajo de la barra superior */
    height: calc(100% - 60px - 56px); /* Altura total - barra superior - navegación móvil */
    bottom: 56px; /* Encima de la navegación móvil */
  }

  /* Posicionamiento para formularios en la parte inferior en móvil */
  #activity-form-banner,
  #note-form-banner {
    top: auto !important;
    bottom: 56px !important; /* Encima de la navegación móvil */
    max-height: 50vh !important; /* Altura máxima del 50% del viewport */
    border-top-left-radius: 15px !important;
    border-top-right-radius: 15px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  /* La tarjeta de información también se ajusta */
  #fieldInfoCard {
    bottom: 56px !important; /* Encima de la navegación móvil */
    left: 10px !important; /* Más cerca del borde izquierdo */
    right: 10px !important; /* Más cerca del borde derecho */
    width: auto !important; /* Ancho automático */
    border-radius: 15px 15px 0 0 !important; /* Bordes superiores redondeados, inferiores rectos */
  }
}

/* Estilos para el nuevo Modal de Historial de Notas */
#allNotesHistoryModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Fondo semitransparente */
  display: flex; /* Usar flexbox para centrar el contenido */
  justify-content: center;
  align-items: center;
  z-index: 10006; /* Asegura que esté por encima de otros elementos */
}

#allNotesHistoryModal .modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  /* Ya definidos en el HTML, pero asegúrate que sean efectivos */
  max-width: 900px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto; /* Permite desplazamiento si el contenido es largo */
}

#allNotesTable th, #allNotesTable td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

#allNotesTable th {
  background-color: #e0e0e0;
  font-weight: bold;
}

#allNotesTable tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#allNotesTable tbody tr:hover {
  background-color: #f1f1f1;
}

/* Estilos para el botón de cerrar en el modal */
#allNotesHistoryModal .close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

#allNotesHistoryModal .close:hover,
#allNotesHistoryModal .close:focus {
  color: #333;
  text-decoration: none;
}
