body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
}

h5 {
    color: #1b3c53;
    font-weight: bold;
}

.hidden {
    display: none;
}

#map {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
}

/* === Contenedor de los controles superiores === */
.map-controls {
  position: absolute;
  top: 10px;
  left: 55px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.btn-light:hover {
    background-color: #f2f2f2 !important;
    color: #008bda;
}

.btn-light:hover i {
  color: #008bda !important;
}

/* ===== CONTROLES VERTICALES AISLADOS ===== */
/* ===== CONTROLES VERTICALES DEL MAPA ===== */

.map-controls-vertical {
  position: absolute;
  top: 205px;
  left: 10px;
  z-index: 1000;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* BOTÓN BASE */
.map-controls-vertical .map-ctrl-btn {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  background-color: #ffffff;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
  color: #444952;
  padding: 0;
}

/* Hover */
.map-controls-vertical .map-ctrl-btn:hover {
  background-color: #f2f2f2;
}

.map-controls-vertical .map-ctrl-btn:hover i {
  color: #008bda;
}

/* Toggle activo */
.map-controls-vertical .btn-check:checked + .map-ctrl-toggle {
  background-color: #008bda;
  border-color: #008bda;
  color: #ffffff;
}

.map-controls-vertical .btn-check:checked + .map-ctrl-toggle i {
  color: #ffffff;
}

.btn-form-check-input {
    cursor: pointer;
}

/* Badge alarmas */
.map-controls-vertical .alarms-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.6rem;
  padding: 2px 5px;
}





/* === Popup AIS === */
/*
.maplibregl-popup {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.maplibregl-popup-content {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.maplibregl-popup-tip {
  border-top-color: #ffffff !important;
  border-bottom-color: #ffffff !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
*/
.maplibregl-popup {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.maplibregl-popup-content {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* 🔥 FLECHA BASE */
.maplibregl-popup-tip {
  box-shadow: none !important;
  opacity: 1 !important;
}

/* ⬆️ Popup abajo → flecha arriba */
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: #ffffff !important;
}

/* ⬇️ Popup arriba → flecha abajo */
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: #ffffff !important;
}

/* 👉 Popup a la derecha → flecha izquierda */
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: #ffffff !important;
}

/* 👈 Popup a la izquierda → flecha derecha */
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: #ffffff !important;
}


/* === Dropdown === */
.dropdown-menu {
  font-size: 14px;
  overflow-y: auto;
  z-index: 3000 !important;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

.dropdown-item {
    cursor: pointer !important;
  background-color: transparent;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:active {
  background-color: rgba(109, 179, 181, 0.1);
  color: black;
}

.submenu-item:hover {
    background-color: rgba(109, 179, 181, 0.1);
    cursor: pointer !important;
}


.dropdown-menu.show {
  overflow: visible !important;
}

/* === Submenú lateral === */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .submenu-panel {
  position: absolute;
  top: 0;
  left: 100%;
  margin-top: -6px;
  margin-left: -1px;

  width: max-content;
  max-width: 400px;

  /* Este height se REEMPLAZA dinámicamente con JS */
  max-height: calc(100vh - 100px);

  overflow-y: auto;
  overflow-x: hidden;
  background: white;
  border-radius: 6px;
  padding: 6px 0;
  white-space: normal;
  word-break: break-word;

  display: none;
}

.dropdown-submenu:hover > .submenu-panel {
  display: block;
}


/* === Items internos === */
.submenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
}

/* Checkbox dentro del submenú */
.submenu-checkbox {
  flex-shrink: 0;
  margin: 0 !important;
}

/* Texto dentro del submenú */
.submenu-text {
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.3;
}







.pointer {
    cursor: pointer;
}

.profile-img {
  height: 35px;
  width: 35px;
  border-radius: 50%;
  border: 2px solid #ffffff; /*#FFC107;*/
  cursor: pointer;
}

.navbar-brand, .navbar-brand:hover {
    font-size: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    align-items: center;
    color: #B3CEE6;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.navbar-nav .nav-link {
    font-family: 'Open Sans', sans-serif; /* Change to Open Sans */
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    color: white;
}

.navbar .nav-link.dropdown-toggle {
    color: white !important;
}

.navbar .nav-link.dropdown-toggle:focus,
.navbar .nav-link.dropdown-toggle:active,
.navbar .nav-link.dropdown-toggle.show,
.navbar .nav-link.dropdown-toggle:hover{
  color: #FFC107 !important;
}

.navbar {
    margin-bottom: 10px;
    position: fixed;
    padding-top: 5px;
    padding-bottom: 5px;
    width: 100%;
    z-index: 3000 !important;
    background-color: #061d36;
    color: white;
}

.icon-navbar {
    color: #FFC107;
    font-size: 20px;
    transition: opacity 0.3s;
}
.icon-navbar:hover {
    opacity: 0.8;
}

.form-check-input:checked {
  background-color: #6db3b5 !important;
  border-color: #6db3b5 !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(109, 179, 181, 0.25);
  border-color: #6db3b5;
}

.search-with-icon {
  max-width: 100%;
  padding-left: 36px !important; /* espacio para el ícono */
  -webkit-appearance: none;
  appearance: none;
}

.search-with-icon::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ====================================== */
/* Offcanvas */
/* ====================================== */
/* === BASE DEL OFFCANVAS (igual que antes) === */
/*
.modern-offcanvas {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  border-left: none;
  pointer-events: auto;
  z-index: 2000 !important;
  top: 51px !important;
  height: calc(100% - 51px) !important;
  position: fixed !important;
  width: 400px;
  max-width: 90%;
  transition: transform 0.4s ease;
  margin: 10px;
  border-radius: 10px;
}*/

.modern-offcanvas {
  background: rgba(255, 255, 255, 0.5);
  will-change: transform, opacity;
  contain: paint;
  /*backdrop-filter: blur(6px);*/
  position: fixed;
  inset: auto 10px 10px auto !important;
  top: 10px !important;
  height: calc(100% - 25px) !important;
  width: 400px !important;
  max-width: calc(100% - 20px);
  border-radius: 10px !important;
  overflow: hidden;
  background-clip: padding-box;
  clip-path: inset(0 round 10px);
  z-index: 2000 !important;
}


/* === HEADER MODERNO === */
.modern-header {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.8rem 1rem;
  color: #fff;
  box-shadow: 0 1px 8px rgba(255, 255, 255, 0.08);
  position: relative;
}

/* Línea luminosa inferior (efecto moderno) */
.modern-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #00d4ff, #4a90e2, #a64af7);
  opacity: 0.6;
}

/* Estilo del título */
.modern-header .offcanvas-title {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  color: #061d36;
}

.offcanvas-footer {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

/* Ícono */
.modern-header i {
  color: #ffd966; /* amarillo suave */
}

/* === ALERTAS (igual que antes) === */
.alert-item {
  display: block;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  text-align: left;
  transition: all 0.25s ease;
  cursor: pointer;
}

.alert-item:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

.alert-title {
  font-weight: 600;
  font-size: 15px;
  color: #222;
}

.alert-sub {
  font-size: 13px;
  color: #555;
  margin-top: 3px;
}

/* === SCROLL PERSONALIZADO === */
#alerts-offcanvas-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.4) transparent;
}
#alerts-offcanvas-body::-webkit-scrollbar {
  width: 6px;
}
#alerts-offcanvas-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.4);
  border-radius: 3px;
}




/*
.offcanvas {
    z-index: 2000 !important;
    top: 51px !important;
    height: calc(100% - 51px) !important;
    background-color: white;
}
.offcanvas-header {
    background-color: #FFC107;
}
*/

/* === Puntos de color para dropdown de zonas marítimas === */
.zone-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
}

#cursor-coords { opacity: 0; transition: opacity 0.2s; }
#map:hover + #cursor-coords { opacity: 1; }

.maplibregl-ctrl-top-right {
  right: auto !important;   /* elimina posición derecha */
  left: 10px !important;    /* coloca los controles a la izquierda */
  top: 0px !important;     /* un pequeño margen desde el borde superior */
}


/* === 🎨 Estilo personalizado para nav-tabs === */
.nav-tabs {
  border-bottom: 2px solid #e0e0e0; /* línea base tenue */
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent; /* línea inferior por defecto */
  border-radius: 0; /* sin esquinas redondeadas */
  color: #7c94a1; /* inactivo */
  background-color: transparent;
  font-weight: 500;
}

/* Hover */
.nav-tabs .nav-link:hover, .navbar-nav .nav-link:hover {
  color: #061d36;
  border-bottom-color: #061d36; /* línea dorada al hover */
  background-color: transparent;
}

/* Activo */
.nav-tabs .nav-link.active {
  color: #1b3c53;
  border-bottom-color: #061d36; /* línea azul oscura cuando activo */
  background-color: transparent;
  font-weight: 600;
}

/* Iconos más suaves */
.nav-tabs .nav-link i {
  font-size: 1rem;
  opacity: 0.9;
}


.btn-app {
    background-color: #1b3c53; /*#061d36*/
    color: white;
    border-color: #1b3c53;
    margin-bottom: 0px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-app:hover,
    .custom-btn:focus {
      background-color: #3482AA;
      border-color: #3482AA;
      color: white;
      opacity: 0.8;
      transform: scale(1.02); /* aumenta un 5% el tamaño */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* opcional: agrega profundidad */
}

button.btn-app:disabled,
.btn.btn-app:disabled {
    opacity: 0.5 !important;
    background-color: #23567e !important;
    border-color: #23567e !important;
    color: white !important;
}

.btn-success {
    background-color: #2B841B !important;
    color: white !important;
}

.btn-danger {
    background-color: #B70008 !important;
    color: white !important;
}

.btn-warning {
    background-color: #F8B821 !important;
    color: white !important;
}

.btn-info {
    background-color: #54ACDB !important;
    color: white !important;
}

/* ====================================== */
/* Table behaviour */
/* ====================================== */
.table thead th {
  position: sticky; /* Fix the header row */
  top: 0; /* Keep it stuck to the top */
  background-color: #1b3c53 !important;
  color: white !important;
  z-index: 2 !important;
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
  vertical-align: middle;
}

.table tbody td {
  padding: 6px;
  border: 1px solid #ddd;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    --bs-table-hover-bg: rgba(109, 179, 181, 0.1);
}

.rounded-table th:first-child {
  border-top-left-radius: 10px; /* Top-left corner */
}

.rounded-table th:last-child {
    border-top-right-radius: 10px; /* Top-right corner */
}

.rounded-table tr:last-child td:first-child {
    border-bottom-left-radius: 10px; /* Bottom-left corner */
}

.rounded-table tr:last-child td:last-child {
    border-bottom-right-radius: 10px; /* Bottom-right corner */
}

.resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  background-color: transparent;
}



/* ====================================== */
/* Modal */
/* ====================================== */
.modal {
    z-index: 3000;
}

.modal-header {
    background-color: #1b3c53;
    color: white !important;
}

.modal-title {
    color: white !important;
}

/* ====================================== */
/* Backgrounds */
/* ====================================== */
.app-bg {
  background-image: url("/static/images/fondos_links.jpg");
  background-repeat: no-repeat;
  background-size: cover;       /* o contain, según lo que necesites */
  background-position: center;  /* centrado */
}

.grafimar-bg {
  background-image: url("/static/images/grafimar2026_2.jpg");
  background-repeat: no-repeat;
  background-size: cover;       /* o contain, según lo que necesites */
  background-position: center;  /* centrado */

}

/* ====================================== */
/* API styles */
/* ====================================== */
#api-container {
    --bg: #0f172a;
    --card: #111827;
    --border: #1f2937;
    --text: #e2e8f0;
    --muted: #9ca3af;
  }

  .api-bg {
      background-color: #0f172a !important;
      color: #e2e8f0 !important;
    }

  /* Layout principal */
  #api-container header {
    flex: 0 0 auto;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  #api-container .tag {
    background: var(--border);
    color: #93c5fd;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
  }



  #api-container .grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto 1fr;
    gap: 12px;
    height: 100%;
  }

  #api-container .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
  }

  /* KPIs alineados - 8 columnas */
  #api-container .kpis {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    align-items: center;
  }

  #api-container .kpi {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  #api-container .kpi .big {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    color: white;
  }

  #api-container .muted {
    color: var(--muted);
    font-size: 12px;
  }

  /* Zona inferior */
  #api-container .two-cols {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
  }

  #api-container .two-cols .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #api-container .panel-title {
    margin-bottom: 8px;
  }

  #api-container .chartBox {
    flex: 1 1 auto;
    min-height: 0;
  }

  #api-container #chart_timeline {
    width: 100%;
    height: 100%;
  }

  #api-container #error_log {
    flex: 1 1 auto;
    background: #0b1222;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 12px;
    color: white;
  }






 /* === Contenedor principal del formulario === */
.myform {
  background-color: #f3f3f5;/*background: rgba(6, 29, 54, 0.05);*/
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px 40px;
  width: 400px;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}

/* === Título === */
.myform h5 {
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.grafimaria-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;              /* ExtraBold */
  letter-spacing: 0.08em;        /* clave para el look */
  text-transform: uppercase;
  color: #B3CEE6;                /* azul claro tipo imagen */
  margin: 0;
  font-size: 3rem;
}

.bottom-warships {
  position: fixed;
  bottom: 30px;              /* pega al borde inferior */
  left: 70%;              /* centra horizontalmente */
  transform: translateX(-50%);  /* corrección de centrado */
  width: 50vw;            /* tamaño relativo a la pantalla (ajusta según gusto) */
  max-width: 700px;       /* límite para pantallas grandes */
  pointer-events: none;   /* evita interferir con clics o elementos */
  z-index: 10;            /* asegúrate de que quede visible sobre el fondo */
}


/* --- Tarjeta contenedora de cada alarma --- */
.alarm-wrapper {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.25s ease;
  transform: translateZ(0); /* Aísla cada tarjeta en su propia capa GPU */
}

/* --- Efecto hover: solo sombra, el zoom se aplica internamente --- */
.alarm-wrapper:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- Botón principal dentro de la tarjeta --- */
.alarm-btn {
  border: none;
  background: #fff;
  transition: background 0.2s ease, transform 0.15s ease;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  transform-origin: center;
}

/* --- Efecto hover del botón principal --- */
.alarm-btn:hover {
  background: #f8f9fa;
  transform: scale(1.02); /* Zoom suave solo dentro del contenido */
}

/* --- Botón verde de acknowledge (acoplado a la derecha) --- */
.acknowledge-btn {
  width: 46px;
  background: #1b3c53;
  color: white;
  border-left: 1px solid #1b3c53;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  transform-origin: center;
}

/* --- Efecto hover del botón verde --- */
.acknowledge-btn:hover {
  opacity: 0.8;
  transform: scale(1.02); /* Zoom sincronizado con el botón principal */
}

/* --- Extra: efecto combinado cuando el usuario pasa el mouse sobre toda la tarjeta --- */
.alarm-wrapper:hover .alarm-btn,
.alarm-wrapper:hover .acknowledge-btn {
  transform: scale(1.02);
}

/* ====================================== */
/* Toast */
/* ====================================== */
#toast, .toast-container, .toast {
  z-index: 99999 !important;
}

.toast-header {
    background-color: #1b3c53;
    color: white;
}

.toast-body {
    background-color: white;
    border-radius: 0 0 0.25rem 0.25rem;
}




.alarm-icons-grid {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  grid-template-rows: repeat(2, 30px);
  gap: 2px;
  position: relative;
}

.icon-box {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;                   /* mantiene los bordes suaves */
  border: 1px solid rgba(255,255,255,0.2); /* borde sutil semi-transparente */
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);  /* sombra leve, da profundidad */
  transition: transform 0.15s ease, box-shadow 0.15s ease; /* suaviza la animación */
}

.icon-box:hover {
  transform: scale(1.05);                 /* leve aumento al pasar el mouse */
  box-shadow: 0 2px 6px rgba(0,0,0,0.18); /* sombra un poco más marcada al hover */
}

.icon-box i {
  font-size: 18px;
  color: white;
}

.hierarchy-icon {
  background-color: #1b3c53;
}

.rule-icon {
  background-color: #ffc107;
}

.rule-icon i {
  color: #1b3c53 !important;
}

.ship-type-icon {
  background-color: #3482AA;
}

.navigational-icon {
  background-color: #6DB3B5;
}

.tooltip {
  z-index: 3000 !important;
  pointer-events: none;
}


#alarms-tab .badge {
  z-index: 10; /* Asegura que quede sobre otros botones */
  pointer-events: none; /* Evita interferir con clicks */
}


.app-badge {
    background-color: #6DB3B5 !important; /* Custom background color */
    color: white !important; /* Custom text color */
}

.badge-app {
    background-color: #061d36 !important; /* Custom background color */
    color: white !important; /* Custom text color */
}

.badge-blue {
    background-color: #1b3c53 !important; /* Custom background color */
    color: white !important; /* Custom text color */
}

.badge-info {
    background-color: #54ACDB !important; /* Custom background color */
    color: white !important; /* Custom text color */
}

.search-with-icon {
  padding-left: 36px !important; /* espacio para el ícono */
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 14px;
  pointer-events: none; /* no bloquea clics en el input */
}

/* Pagination */
.pagination .page-item.active .page-link {
    background-color: #1b3c53;
    color: #ffffff;
    border-color: #1b3c53;
}

.pagination .page-item .page-link {
    background-color: white;
    color: #1b3c53;
}

.pagination .page-item:not(.active) .page-link:hover {
    background-color: #3482AA;
    color: white;
    cursor: pointer;
}

.action-icons i {
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.action-icons i:hover {
  opacity: 0.7;
}
.action-icons .edit {
  color: #3482AA; /* azul */
}
.action-icons .delete {
  color: #dc3545; /* rojo */
}


.static-marker {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.static-marker-inner {
  width: 32px;
  height: 32px;
  background: #0044cc;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  border: 2px solid white;
}

/* Submenú lateral exclusivo de cambio de jerarquía */
.zones-hierarchy-submenu .zones-hierarchy-submenu-menu {
  position: absolute;
  top: 0;
  left: -220px; /* aparece a la izquierda */
  min-width: 220px;
  display: none;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 5000;
}

.zones-hierarchy-submenu .zones-hierarchy-submenu-menu.show {
  display: block;
}

/* Submenú lateral exclusivo de cambio de jerarquía */
.zones-hierarchy-submenu-right .zones-hierarchy-submenu-menu-right {
  position: absolute;
  top: 0;
  right: -220px; /* aparece a la izquierda */
  min-width: 220px;
  display: none;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 5000;
  background-color: #ffffff;
}

.zones-hierarchy-submenu-right .zones-hierarchy-submenu-menu-right.show {
  display: block;
}


/* Side Navbar */
/* ===== SIDEBAR BASE ===== */
.sidebar {
    display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 45px;
  background: #1b3c53;
  color: #fff;
  transition: width 0.25s ease;
  z-index: 2000;
  overflow-x: hidden;
}

/* EXPANDIDA */
.sidebar:hover {
  width: 300px;
}

/* HEADER */
.sidebar-header {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 4px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 1);
}

.sidebar-header .logo {
  height: 35px;
}

.brand-text {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.sidebar:hover .brand-text {
  opacity: 1;
}

/* NAV */
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;     /* ← ESTO ES CLAVE */
  overflow-x: visible;  /* ← para dropdowns */
}

#sidebarAccordion {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px;
  color: #ffffff !important;
  text-decoration: none;
}

.sidebar .nav-link i {
  font-size: 1.15rem;
  min-width: 22px;
  text-align: center;
  color: inherit;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:hover i {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #B3CEE6 !important;
}

/* TEXTO OCULTO */
.link-text {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  font-family: 'Montserrat', sans-serif;
    font-weight: 600; /* o 700 */
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}

.sidebar:hover .link-text {
  opacity: 1;
}

.link-text:hover {
  color: #B3CEE6;
  cursor: pointer !important;
}

/* FOOTER USUARIO */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 1);
}

.footer-copyright {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.75rem;
  color: #1b3c53;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; /* o 700 */
    letter-spacing: 0.04em;
  white-space: nowrap;
}


/* Quitar look clásico de accordion */
.sidebar .accordion-item {
  border: none;
  background: transparent;
}

.sidebar .accordion-button {
  background: transparent;
  color: #ffffff;
  padding: 10px 14px;
}

.sidebar .accordion-button::after {
  filter: brightness(0) invert(1); /* fuerza blanco */
}

.sidebar .accordion-button:not(.collapsed) {
  background: rgba(255,255,255,0.08);
  box-shadow: none;
}

.sidebar .accordion-body {
  padding-left: 38px;
}

.sidebar-link {
  display: block;
  padding: 6px 0;
  color: #ffffff;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
    font-weight: 600; /* o 700 */
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}

.sidebar-link:hover {
  color: #B3CEE6;
  cursor: pointer !important;
}






/* Contenedor del search */
.map-search {
  width: 380px;
  min-width: 320px;
  display: flex;
  align-items: center;
  position: relative;
}

#search-ships-suggestions {
  top: 100%;           /* ⬅️ justo debajo del input */
  left: 0;
  margin-top: 2px;     /* pequeño aire visual */
}

/* Input */
.map-search .search-input {
  padding-left: 34px; /* espacio para el icono */
  font-size: 0.85rem;
}

/* Icono dentro del input */
.map-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none; /* 👈 MUY importante */
  z-index: 2;
}


.sidebar-accordion-btn.active {
    color: #FFC107;
}



/* Chat IA */

/* AI chat input text */
.ai-chat-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-end;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none; /* Disable manual resizing */
    padding-right: 30px;
    padding-left: 4px;
    padding-top: 4px;
    padding-bottom: 4px;
    height: 32px;
    max-height: 150px; /* Maximum height */
    min-height: 32px; /* Minimum height */
    overflow-y: auto; /* Enable scrolling when max height is reached */
}

.send-icon {
    position: absolute;
    right: 16px;
    bottom: 16px;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.send-icon:hover {
    opacity: 1;
}

.micro-send-icon {
    position: absolute;
    right: 16px;
    bottom: 32px;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.micro-send-icon:hover {
    opacity: 1;
}

.clipboard {
    height: 18px;
    cursor: pointer;
    margin-left: 5px;
    opacity: 0.5;
}

.clipboard:hover {
    opacity: 1;
}

.chat-cloud {
  padding: 10px;
  margin: 5px;
  max-width: 80%;
  display: inline-block;
  word-wrap: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chat-name {
  margin-top: 0px;
  margin-bottom: 5px;
  text-align: left !important;
}

.chat-text {
  margin: 0;
  text-align: left !important;
}

.bot-name {
    font-weight: bold;
}

.bot-cloud {
    background-color: rgba(255, 255, 255, 1); /* #3482AA */
    border-radius: 10px 10px 10px 0;
}

.prompt-cloud {
    background-color: rgba(34, 85, 125, 1); /* #1b3c53 antes: rgba(52, 130, 170, 1) = #061d36 */
    border-radius: 10px 10px 0 10px;
}

.bot-text {
    color: #061d36;
}

.prompt-text {
    color: white;
}

#ai-chat-spinner {
    color: #061d36; /* fallback / texto */
}

#ai-chat-spinner .spinner-grow {
    color: #061d36; /* spinner */
}

#ai-chat-spinner .thinking-text {
    color: #061d36; /* texto */
    font-weight: 500;
}

/* Dropzone */
#dropzone {
    overflow: hidden;
}


/* Microphone */
@keyframes micPulse {
  0%   { color: #000; transform: scale(1); }
  50%  { color: #FB2C36; transform: scale(1.15); }
  100% { color: #000; transform: scale(1); }
}

.mic-recording {
  animation: micPulse 1.2s infinite ease-in-out;
}


/* AI chat filters */
#ai-chat-document-search-results {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

#ai-chat-document-search-results.show {
  display: block;
}

#ai-chat-document-search-results .dropdown-item {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#ai-chat-document-search-results .fw-semibold,
#ai-chat-document-search-results small {
  display: block;
  max-width: 100%;
}

.maplibregl-ctrl-bottom-left {
    display: none !important;
}

.maplibregl-ctrl-bottom-right {
    display: none !important;
}


/* Documents search dropdown options */
/* Evita scroll horizontal en dropdowns */
#search-documents-suggestions,
#search-documents-suggestions ul,
#search-documents-suggestions li,
#search-documents-suggestions .dropdown-item {
  max-width: 100%;
  overflow-x: hidden;
}

/* Fuerza quiebre de texto */
#search-documents-suggestions .dropdown-item {
  white-space: normal;          /* permite salto de línea */
  word-break: break-word;       /* rompe palabras largas */
  overflow-wrap: anywhere;      /* fallback moderno */
}

/* Contenedor de documentos seleccionados */
#documents-selected-filter {
  max-width: 100%;
  overflow-x: hidden;
  white-space: normal;
}

/* Badge del documento */
#documents-selected-filter .documents-doc-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  white-space: normal;        /* permite salto de línea */
  word-break: break-word;     /* rompe palabras largas */
  overflow-wrap: anywhere;    /* fallback moderno */
}

/* Texto dentro del badge */
#documents-selected-filter .documents-doc-chip {
  line-height: 1.3;
}

/* Ícono X siempre visible */
#documents-selected-filter .documents-doc-chip .remove-document-tag {
  flex-shrink: 0;
  cursor: pointer;
}



#modal-alarm-preview .modal-dialog {
  max-width: 90vw;
}

#modal-alarm-preview .modal-content {
  height: 90vh;
  display: flex;
  flex-direction: column;
}

#modal-alarm-preview .modal-body {
  flex: 1;
  display: flex;
}

#alarm-preview-map {
  width: 100%;
  height: 100%;
}