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;
}

/* Unifica los controles claros del mapa con el azul institucional de btn-app. */
.map-controls button.dropdown-toggle,
.map-controls button.dropdown-toggle i {
  color: #1b3c53 !important;
}

.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: #1b3c53;
  padding: 0;
}

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

.map-controls-vertical .map-ctrl-btn:hover i {
  color: #1b3c53;
}

/* 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;
}

.map-style-dropdown {
  min-width: 540px;
}

.map-style-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.map-style-column {
  min-width: 0;
  padding-bottom: 4px;
}

.map-style-event-time {
  text-align: right;
  white-space: nowrap;
}

.map-style-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(108, 117, 125, 0.18);
}

.map-style-section .dropdown-header {
  margin-bottom: 4px;
}

.map-style-column-dark {
  border-left: 1px solid rgba(108, 117, 125, 0.35);
}

.map-style-option {
  justify-content: flex-start;
}

.map-style-option .form-check-input {
  flex-shrink: 0;
}

.map-style-option-label {
  flex: 1 1 auto;
  min-width: 0;
}

.map-style-pin-toggle {
  display: none;
  flex-shrink: 0;
  background-color: #1b3c53;
  border-color: #1b3c53;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-style-pin-toggle:hover,
.map-style-pin-toggle:focus {
  background-color: #3482AA;
  border-color: #3482AA;
  color: #fff;
  opacity: 0.8;
  transform: scale(1.02);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.map-style-option.is-active .map-style-pin-toggle {
  display: inline-flex;
  align-items: center;
}

.map-style-pin-toggle.is-pinned {
  border-color: #0d6efd;
  background-color: #0d6efd;
  color: #fff;
}

.map-style-column[data-theme-column="light"].is-inactive,
.map-style-column[data-theme-column="dark"].is-inactive {
  opacity: 0.62;
}

@media (max-width: 767.98px) {
  .map-style-dropdown {
    min-width: 320px;
  }

  .map-style-grid {
    grid-template-columns: 1fr;
  }

  .map-style-column-dark {
    border-left: 0;
    border-top: 1px solid rgba(108, 117, 125, 0.35);
    padding-top: 8px;
  }

  .map-style-event-time {
    white-space: normal;
    text-align: left;
  }
}

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


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

.panorama-dropdown-menu {
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overflow-x: visible;
  overscroll-behavior: contain;
}

.panorama-dropdown-menu.show {
  overflow-y: auto !important;
  overflow-x: visible !important;
}

.panorama-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-right: 0.75rem;
}

.panorama-selection-header .dropdown-header {
  flex: 1 1 auto;
}

.panorama-kml-download,
.open-upload-kml-modal,
.map-style-pin-toggle {
  flex: 0 0 auto;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.25;
}

.panorama-child-option > .dropdown-item,
.panorama-child-option > .dropdown-toggle,
.panorama-child-option > label.dropdown-item {
  padding-left: 2.75rem !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;
}

.submenu-panel.panorama-detached {
  position: fixed;
  top: 0;
  left: 0;
  margin-top: 0;
  margin-left: 0;
  display: block;
  z-index: 3200;
}


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

#panorama-countries-submenu .submenu-item {
  padding-top: 3px;
  padding-bottom: 3px;
}

/* 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;
}

.shoa-inundation-floating-panel {
  position: fixed;
  right: 16px;
  bottom: 46px;
  z-index: 99;
  width: 250px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
}

.shoa-inundation-floating-panel[hidden] {
  display: none !important;
}

.shoa-inundation-floating-panel.is-dragging {
  cursor: grabbing;
}

.shoa-inundation-floating-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: grab;
  touch-action: none;
}

.shoa-inundation-drag-icon {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
}

.shoa-inundation-filter-instruction {
  margin: 8px 0 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
}

.shoa-inundation-floating-ranges {
  display: grid;
  grid-template-columns: 1fr;
}

.shoa-inundation-range-option {
  display: grid;
  grid-template-columns: 16px 18px 1fr;
  align-items: center;
  gap: 7px;
  padding: 3px 1px;
  color: #ffffff;
  font-size: 0.75rem;
  cursor: pointer;
}

.shoa-inundation-range-option .form-check-input {
  margin: 0;
  border-color: rgba(255, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.12);
}

.shoa-inundation-range-option .form-check-input:checked {
  border-color: #3482aa;
  background-color: #3482aa;
}

.shoa-inundation-color {
  width: 18px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
}

.shoa-inundation-filter-note {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.65rem;
  line-height: 1.25;
}







.pointer {
    cursor: pointer;
}

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

.profile-avatar-hierarchy {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.profile-avatar-hierarchy-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  z-index: 2;
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  background: #3482aa;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(6, 29, 54, 0.35);
  font-size: 7px;
  pointer-events: none;
}

.profile-avatar-hierarchy-badge i {
  color: #ffffff !important;
  font-size: inherit;
  line-height: 1;
}

.profile-avatar-shell {
  --profile-photo-scale: 1;
  --profile-photo-position-x: 50%;
  --profile-photo-position-y: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(145deg, rgba(239, 247, 251, 0.95), rgba(202, 223, 238, 0.95));
  box-shadow: 0 10px 28px rgba(6, 29, 54, 0.14);
}

.profile-avatar-shell-sm {
  width: 30px;
  height: 30px;
}

.profile-avatar-shell-lg {
  width: 112px;
  height: 112px;
}

.profile-avatar-shell-xl {
  width: 136px;
  height: 136px;
}

.profile-avatar-shell-xxl {
  width: min(320px, 70vw);
  height: min(320px, 70vw);
}

.profile-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--profile-photo-position-x) var(--profile-photo-position-y);
  transform: scale(var(--profile-photo-scale));
  transform-origin: var(--profile-photo-position-x) var(--profile-photo-position-y);
}

.profile-page {
  position: relative;
  min-height: 100vh;
  overflow: visible;
  background:
    radial-gradient(circle at top left, rgba(109, 179, 181, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(52, 130, 170, 0.14), transparent 24%),
    linear-gradient(180deg, #f5f9fc 0%, #edf4f8 100%);
}

.profile-page__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 45%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.2) 10px, transparent 10px, transparent 22px);
  pointer-events: none;
}

.profile-page__hero,
.profile-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(180, 205, 224, 0.8);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(6, 29, 54, 0.08);
  backdrop-filter: blur(10px);
}

.profile-page__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
}

.profile-page__identity {
  display: flex;
  align-items: center;
  gap: 22px;
}

.profile-page__avatar-stack {
  position: relative;
  flex: 0 0 auto;
}

.profile-avatar-edit-btn {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d304e, #3482aa);
  color: #fff;
  box-shadow: 0 12px 24px rgba(13, 48, 78, 0.28);
}

.profile-avatar-edit-btn:hover {
  background: linear-gradient(135deg, #102c43, #2f7598);
}

.profile-page__heading h1 {
  margin: 0;
  color: #0d304e;
  font-size: clamp(1.7rem, 2.5vw, 2.5rem);
  font-weight: 800;
}

.profile-page__heading p,
.profile-panel__header p {
  color: #5f7385;
}

.profile-page__eyebrow,
.profile-section-label {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #3482aa;
}

.profile-page__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(6, 29, 54, 0.05);
  color: #183b59;
  font-size: 0.84rem;
  font-weight: 600;
}

.profile-chip--soft {
  background: rgba(52, 130, 170, 0.08);
}

.profile-page__actions {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
}

.profile-panel {
  padding: 18px;
}

.profile-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat-card {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13, 48, 78, 0.06), rgba(52, 130, 170, 0.06));
  border: 1px solid rgba(170, 197, 215, 0.9);
}

.profile-stat-card__label {
  display: block;
  margin-bottom: 8px;
  color: #5f7385;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-stat-card strong {
  display: block;
  color: #0d304e;
  font-size: 1.35rem;
  line-height: 1.1;
}

.profile-stat-card small {
  color: #6c8194;
  font-size: 0.8rem;
}

.profile-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.profile-info-list--wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-info-column {
  display: grid;
  gap: 10px;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(202, 218, 229, 0.7);
}

.profile-info-row span {
  color: #6c8194;
  font-size: 0.84rem;
}

.profile-info-row strong {
  color: #143651;
  font-size: 0.92rem;
  text-align: right;
}

.profile-adjustments {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.profile-adjustments__preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  border-radius: 22px;
  background:
    radial-gradient(circle at center, rgba(109, 179, 181, 0.14), rgba(255, 255, 255, 0.85) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(238, 245, 249, 0.95));
  border: 1px dashed rgba(52, 130, 170, 0.35);
}

.profile-list {
  display: grid;
  gap: 8px;
}

.profile-list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(202, 218, 229, 0.95);
  border-radius: 14px;
  background: rgba(248, 251, 253, 0.9);
}

.profile-list-item__meta {
  margin-top: 2px;
  color: #6c8194;
  font-size: 0.84rem;
}

.profile-list-item__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.profile-zone-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(6, 29, 54, 0.15);
}

.profile-code-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.profile-code-list--compact {
  max-height: 280px;
}

.profile-code-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(202, 218, 229, 0.95);
  background: rgba(248, 251, 253, 0.9);
}

.profile-code-item code {
  color: #143651;
  word-break: break-word;
}

.profile-code-item--stacked {
  display: grid;
  align-items: start;
}

.profile-photo-modal-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-photo-modal-preview {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.profile-photo-modal-mini {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.profile-photo-modal-controls {
  display: grid;
  gap: 18px;
}

.profile-photo-upload-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(52, 130, 170, 0.45);
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.95), rgba(238, 245, 249, 0.95));
}

.profile-accordion {
  display: grid;
  gap: 10px;
}

.profile-accordion-item {
  border: 1px solid rgba(202, 218, 229, 0.95) !important;
  border-radius: 14px !important;
  overflow: hidden;
  background: rgba(248, 251, 253, 0.9);
}

.profile-accordion-btn {
  background: rgba(248, 251, 253, 0.9);
  color: #143651;
  font-weight: 700;
}

.profile-accordion-badge {
  background-color: #3482aa;
  color: #fff;
  font-weight: 700;
}

.profile-accordion-btn:not(.collapsed) {
  background: rgba(52, 130, 170, 0.08);
  color: #0d304e;
  box-shadow: none;
}

.profile-accordion-btn:focus {
  box-shadow: none;
}

.profile-accordion .accordion-body {
  padding: 12px 14px 14px;
}

.password-toggle-wrapper {
  position: relative;
}

.password-toggle-input {
  padding-right: 2.5rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #6c757d;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}

.password-toggle-btn.is-active {
  color: #3482AA;
}

.profile-password-form {
  display: grid;
  gap: 14px;
}

.profile-password-error {
  min-height: 18px;
  margin-top: 6px;
  color: #dc3545;
  font-size: 0.82rem;
}

.profile-password-rules {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #445b6e;
  background: rgba(52, 130, 170, 0.08);
  border: 1px solid rgba(170, 197, 215, 0.9);
  font-size: 0.88rem;
}

@media (max-width: 991.98px) {
  .profile-page__hero,
  .profile-page__identity {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-page__actions {
    width: 100%;
    align-items: flex-start;
    text-align: left;
  }

  .profile-adjustments,
  .profile-stats-grid,
  .profile-info-list,
  .profile-photo-modal-layout {
    grid-template-columns: 1fr;
  }

  .profile-info-list--wide {
    grid-template-columns: 1fr;
  }

  .profile-info-column {
    gap: 0;
  }

  .profile-adjustments__preview {
    min-height: 150px;
  }

  .profile-list-item {
    flex-direction: column;
  }

  .profile-list-item__aside {
    align-items: flex-start;
  }
}

.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);
}

.briefing-actions-panel {
  padding: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6f9 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.notifications-briefing-toggle.is-active {
  background: #0b2740;
  color: #fff;
  border-color: #0b2740;
}

.notifications-briefing-toggle i {
  color: inherit;
}

.modern-header .notifications-briefing-toggle i {
  color: inherit !important;
}

.briefing-actions-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #0b2740;
}

.briefing-actions-subtitle {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #5f6b76;
  line-height: 1.45;
}

.briefing-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.briefing-section-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d9e1e8;
  border-radius: 10px;
  background: #ffffff;
  font-size: 0.84rem;
  color: #243746;
}

.notifications-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.notification-entry {
  position: relative;
}

.notification-item {
  position: relative;
  border: 1px solid #dde4eb;
  border-radius: 12px;
  padding: 12px 46px 30px 14px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  opacity: 1 !important;
}

.notification-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8a2d2d;
  border: 1px solid transparent;
  border-radius: 8px;
  z-index: 2;
}

.notification-delete-btn:hover,
.notification-delete-btn:focus {
  color: #b42318;
  background: #fff0ef;
  border-color: #f4c7c3;
}

.notification-item:hover {
  border-color: #9db5c7;
  box-shadow: 0 8px 18px rgba(8, 33, 58, 0.08);
  transform: translateY(-1px);
  opacity: 1 !important;
  background: #fff;
}

.notification-item:focus,
.notification-item:active,
.notification-item.show {
  opacity: 1 !important;
  background: #fff !important;
}

.notification-item.is-pending {
  border-color: #f0c14b;
  background: #fffdf7;
}

.notification-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0b2740;
}

.notification-file-icon {
  color: #0b2740;
  font-size: 0.9rem;
}

.notification-message {
  font-size: 0.84rem;
  color: #334b5c;
  line-height: 1.45;
}

.notification-meta {
  position: absolute;
  right: 10px;
  bottom: 7px;
  font-size: 0.75rem;
  color: #6b7783;
  margin-top: 0 !important;
}

.notification-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notifications-empty-state {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #6b7783;
}

@media (max-width: 768px) {
  .briefing-sections-grid {
    grid-template-columns: 1fr;
  }
}

.documents-chat-offcanvas {
  background: #fff;
}

.documents-chat-section {
  background: #fff !important;
  backdrop-filter: none !important;
  box-shadow: none;
}

/* Í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; }

.replay-indicator {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  z-index: 5;
  display: none;
  animation: replayIndicatorBlink 1.1s ease-in-out infinite;
}

.replay-indicator.is-visible {
  display: block;
}

@keyframes replayIndicatorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.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;
}

.fleet-theme-blue { --fleet-color: #0d6efd; }
.fleet-theme-teal { --fleet-color: #0f766e; }
.fleet-theme-green { --fleet-color: #198754; }
.fleet-theme-lime { --fleet-color: #84cc16; }
.fleet-theme-amber { --fleet-color: #f59e0b; }
.fleet-theme-orange { --fleet-color: #fd7e14; }
.fleet-theme-red { --fleet-color: #dc3545; }
.fleet-theme-pink { --fleet-color: #d63384; }
.fleet-theme-purple { --fleet-color: #6f42c1; }
.fleet-theme-slate { --fleet-color: #334155; }

.panorama-fleet-option-color {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.5rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--fleet-color);
  box-shadow: 0 0 0 1px rgba(6, 29, 54, 0.25);
}

.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 */
}

.panorama-config-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.panorama-config-content,
.panorama-config-column,
.panorama-time-tab-content,
.panorama-time-tab-content > .tab-pane,
.panorama-time-card,
.panorama-time-card-body {
  min-height: 0;
}

.panorama-config-content {
  flex: 1 1 auto;
}

.panorama-time-panel {
  display: flex;
  flex-direction: column;
}

.panorama-time-tab-content {
  flex: 0 1 auto;
  overflow: hidden;
}

.panorama-time-tab-content > .tab-pane.active {
  display: flex;
  max-height: 100%;
}

.panorama-time-card {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.panorama-time-card-body {
  overflow: auto;
  overscroll-behavior: contain;
}

.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;
}

.icon-box-gray {
  background-color: rgba(108, 117, 125, 0.75);
}

.icon-box-blink,
.panorama-blink-badge {
  animation: panoramaBlink 0.8s ease-in-out infinite;
}

.ships-legends-accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: rgba(6, 29, 54, 0.12);
  --bs-accordion-btn-bg: rgba(255, 255, 255, 0.72);
  --bs-accordion-active-bg: rgba(255, 255, 255, 0.92);
  --bs-accordion-btn-color: #061d36;
  --bs-accordion-active-color: #061d36;
  --bs-accordion-btn-focus-box-shadow: none;
  --bs-accordion-inner-border-radius: 12px;
  --bs-accordion-border-radius: 12px;
}

.ships-legends-accordion-item {
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(6, 29, 54, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.ships-legends-accordion-btn {
  font-weight: 600;
  padding: 0.85rem 1rem;
}

.ships-legends-accordion-btn:not(.collapsed) {
  box-shadow: none;
}

.ships-legends-accordion .accordion-body {
  background: rgba(255, 255, 255, 0.94);
  padding: 0.75rem 0.85rem 0.9rem;
}

.ships-legends-table td,
.ships-legends-table th {
  vertical-align: middle;
}

.ships-legends-table {
  overflow: hidden;
  border: 1px solid rgba(6, 29, 54, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
}

.ships-legends-table > :not(caption) > * > * {
  background: transparent;
}

.ships-legends-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.ships-legends-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.ships-legends-table tbody tr:first-child td:first-child {
  border-top-left-radius: 14px;
}

.ships-legends-table tbody tr:first-child td:last-child {
  border-top-right-radius: 14px;
}

.legend-ring {
  width: 26px;
  height: 26px;
  display: inline-block;
  border-radius: 50%;
  border: 3px solid transparent;
  background-color: transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.legend-ring-filled {
  border-color: rgba(0, 0, 0, 0.12);
}

@keyframes panoramaBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

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

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

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

.rule-email-enabled-icon {
  color: #008bda !important;
}

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

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

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

.alarm-tooltip .tooltip-inner {
  white-space: pre-line;
  text-align: left;
}


#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 */
}

/* Modal compartido para carga de capas KML. */
#modal-actions .kml-icon-option i {
  color: #061d36;
}

#modal-actions .kml-icon-option.btn-app i {
  color: #ffffff;
}

#modal-actions .kml-selected-file-name {
  min-width: 0;
}

#kml-dropzone,
#kml-dropzone-content {
  cursor: pointer;
}

#kml-dropzone {
  border-style: dashed !important;
  min-height: 280px;
}


.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;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar:hover .sidebar-nav {
  overflow-x: visible;  /* ← para dropdowns cuando el sidebar está expandido */
}

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

.sidebar-bottom {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 1);
  background: #1b3c53;
  overflow: hidden;
}

.sidebar-bottom-accordion {
  background: transparent;
}

.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);
  overflow: hidden;
}

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

.sidebar:hover .sidebar-footer-text {
  opacity: 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;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.footer-copyright.footer-copyright-dark {
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}


/* 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;
  padding-right: 16px;
}

.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: 470px;
  min-width: 360px;
  position: relative;
}

#search-ships-suggestions {
  top: 100%;
  left: 0;
  z-index: 1060;
  max-height: 400px;
  margin-top: 2px;
  overflow-y: auto;
}

.map-search .search-input {
  min-width: 0;
  font-size: 0.85rem;
}

.map-search-input-group > .input-group-text {
  padding-right: 0.35rem;
  color: #495057;
}

.search-ships-filter-toggle {
  white-space: nowrap;
  border: 1px solid #ced4da;
}

.search-ships-filter-toggle:hover,
.search-ships-filter-toggle:focus,
.search-ships-filter-toggle[aria-expanded="true"] {
  border-color: #ced4da;
}

.search-ships-filters {
  width: min(680px, calc(100vw - 2rem));
  z-index: 1070;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: #212529;
}

.search-ships-filters.show {
  overflow: hidden !important;
}

.search-ships-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: min(430px, calc(100vh - 190px));
  min-height: 260px;
}

.search-ships-filter-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.3rem;
}

.search-ships-filter-column + .search-ships-filter-column {
  margin-left: 0.35rem;
  padding-left: 0.35rem;
  border-left: 1px solid rgba(108, 117, 125, 0.25);
}

.search-ships-filter-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  color: #6c757d;
}

.search-ships-filter-clear {
  font-size: 0.75rem;
  text-decoration: none;
}

.search-ships-filter-options {
  overflow-y: auto;
  padding: 0.15rem 0;
}

.search-ships-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  padding: 0.4rem 0.7rem;
  border-radius: 0.25rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.search-ships-filter-option:hover {
  background-color: rgba(109, 179, 181, 0.1);
}

.search-ships-filter-option .form-check-input {
  flex: 0 0 auto;
}

.search-ships-filter-flag {
  width: 20px;
  height: 14px;
  flex: 0 0 auto;
  object-fit: cover;
}

.search-ships-filter-type-icon {
  width: 20px;
  flex: 0 0 auto;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 767.98px) {
  .map-search {
    width: min(100%, 430px);
    min-width: 280px;
  }

  .search-ships-filter-grid {
    grid-template-columns: 1fr;
    height: min(560px, calc(100vh - 150px));
    overflow-y: auto;
  }

  .search-ships-filter-column {
    min-height: 260px;
  }

  .search-ships-filter-column + .search-ships-filter-column {
    margin-top: 0.35rem;
    margin-left: 0;
    padding-top: 0.35rem;
    padding-left: 0;
    border-top: 1px solid #dee2e6;
    border-left: 0;
  }

  .search-ships-filter-options {
    min-height: 210px;
  }
}


.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%;
}
.ai-markdown-content a.ship-zoom-btn,
.paginated-ship-list a.ship-zoom-btn {
    color: #0d6efd;           
    text-decoration: underline;
    font-weight: normal;
}

/* Shared audit user stamp used by rules, alarms and documents tables. */
.table-user-stamp {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  min-width: 205px;
}

.table-user-stamp-photo {
  flex: 0 0 auto;
  height: 34px;
  width: 34px;
}

.table-user-stamp-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.15;
}

.table-user-stamp-date {
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
}

.fleet-alert-button {
  flex: 0 0 30px;
  margin: 0;
  padding: 0;
}

.fleet-action {
  color: #3482aa;
  font-size: 1rem;
  text-decoration: none;
}

.fleet-action:hover {
  color: #061d36;
}

.fleet-view-action {
  color: #1b3c53;
}

.fleet-delete-action,
.fleet-delete-action:hover {
  color: #dc3545;
}

.fleet-add-action,
.fleet-add-action:hover {
  color: #ffc107;
}

#fleet-ship-candidates {
  max-height: 420px;
  overflow-y: auto;
}

.ships-list-fleet-star {
  bottom: -3px;
  color: #ffc107;
  font-size: 16px;
  line-height: 1;
  position: absolute;
  right: -3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.ship-filters-responsive {
  max-height: min(78vh, 720px);
  overflow-y: auto;
  width: min(760px, calc(100vw - 2rem));
}

.ship-filters-clear {
  color: #dc3545;
  cursor: pointer;
  font-size: 20px;
  opacity: 0.9;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
}

.ship-filters-clear:hover {
  color: #b02a37;
  opacity: 1;
}

.ship-filter-groups-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0.25rem;
}

.ship-filter-checkbox-list {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
}

.ship-filter-checkbox-list .form-check {
  margin-bottom: 0.25rem;
}

.ship-filter-checkbox-list .form-check:last-child {
  margin-bottom: 0;
}

.ship-country-filter-label {
  align-items: center;
  display: inline-flex;
  line-height: 1.3;
}

.ship-country-filter-flag {
  height: 12px;
  margin-right: 8px;
  object-fit: cover;
  opacity: 0.9;
  transform: scaleY(0.82);
  transform-origin: center;
  width: 18px;
}

.ship-suggestion-thumbnail {
  width: 60px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.ship-suggestion-flag-thumbnail {
  width: 18px;
  height: 12px;
  margin-right: 6px;
  object-fit: cover;
  transform: scaleY(0.82);
  transform-origin: center;
  vertical-align: middle;
}

.ship-filter-number-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 767.98px) {
  .ship-filter-groups-grid {
    grid-template-columns: 1fr;
  }

  .ship-filter-number-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .ship-filters-responsive {
    width: calc(100vw - 1rem);
  }
}
