/* FILE: vision-glass-modulos.css */

.marcador,
.lista-imagenes,
.nodo-imagenes,
.bloque-carpeta,
.zona,
.visor,
.leyenda,
.bitacora,
.tipo-pedido,
#mapa {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  color: var(--texto, #E8EEF9);
  font-family: "Cairo", "Segoe UI", sans-serif;
}

.marcador,
.nodo-imagenes,
.bloque-carpeta,
.zona,
.visor,
.leyenda,
.bitacora {
  border: 1px solid var(--vidrio-borde, rgba(120, 160, 255, .14));
  border-radius: var(--radio, 14px);
  background: var(--vidrio, rgba(255, 255, 255, .045));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--sombra, 0 8px 24px rgba(0, 0, 0, .18));
}

.marcador {
  position: relative;
  padding: 16px;
}

.marcador .pestanas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--borde, rgba(120, 160, 255, .14));
}

.marcador .pestanas button {
  min-width: 0;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--borde, rgba(120, 160, 255, .22));
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--texto, #E8EEF9);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: none;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}

.marcador .pestanas button.activa {
  border-color: var(--acento, #0A84FF);
  background: rgba(10, 132, 255, .2);
  color: var(--texto, #E8EEF9);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--acento, #0A84FF);
}

.marcador canvas {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--borde, rgba(120, 160, 255, .14));
  border-radius: 12px;
  background: var(--nav, #081122);
  cursor: crosshair;
  touch-action: none;
}

.marcador .lectura {
  margin: 12px 0 0;
  color: var(--tenue, #8A9BB8);
  font-size: 13px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.lectura-cursor {
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid var(--borde, rgba(120, 160, 255, .18));
  border-radius: 8px;
  background: rgba(8, 17, 34, .94);
  color: var(--texto, #E8EEF9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.lista-imagenes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 14px;
  margin-top: 20px;
}

.lista-imagenes button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 16px;
  border: 1px solid var(--vidrio-borde, rgba(120, 160, 255, .14));
  border-radius: 14px;
  background: var(--vidrio, rgba(255, 255, 255, .045));
  color: var(--texto, #E8EEF9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
}

.lista-imagenes button small {
  display: block;
  max-width: 100%;
  color: var(--tenue, #8A9BB8);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.lista-imagenes button.activa {
  border-color: var(--acento, #0A84FF);
  background: rgba(10, 132, 255, .14);
  color: var(--texto, #E8EEF9);
  box-shadow: inset 3px 0 0 var(--acento, #0A84FF),
              0 8px 24px rgba(10, 132, 255, .1);
}

.nodo-imagenes {
  overflow-wrap: anywhere;
}

.nodo-imagenes > summary {
  display: list-item;
  padding: 12px 16px;
  border-radius: 13px;
  color: var(--texto, #E8EEF9);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: background .2s;
}

.nodo-imagenes > summary::-webkit-details-marker {
  display: none;
}

.nodo-imagenes > summary::marker {
  content: "";
}

.nodo-imagenes > summary::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-end: 12px;
  border-right: 2px solid var(--acento, #0A84FF);
  border-bottom: 2px solid var(--acento, #0A84FF);
  transform: rotate(-45deg);
  vertical-align: middle;
  transition: transform .2s;
}

.nodo-imagenes[open] > summary {
  border-bottom: 1px solid var(--borde, rgba(120, 160, 255, .14));
  border-radius: 13px 13px 0 0;
  background: rgba(10, 132, 255, .08);
}

.nodo-imagenes[open] > summary::before {
  transform: rotate(45deg);
}

.nodo-imagenes > .lista-imagenes {
  margin: 0;
  padding: 14px;
}

.bloque-carpeta {
  overflow-wrap: anywhere;
}

.bloque-cabecera {
  background: rgba(10, 132, 255, .09);
  color: var(--texto, #E8EEF9);
  border-bottom: 1px solid var(--borde, rgba(120, 160, 255, .14));
  font-weight: 600;
  overflow-wrap: anywhere;
}

.bloque-cabecera td,
.bloque-cabecera th {
  background: rgba(10, 132, 255, .09);
  color: var(--texto, #E8EEF9);
  border-color: var(--borde, rgba(120, 160, 255, .14));
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.sel-bloque,
.sel-cruda {
  accent-color: var(--acento, #0A84FF);
  cursor: pointer;
}

.zona {
  padding: 24px 16px;
  border: 1px dashed rgba(10, 132, 255, .65);
  background: rgba(10, 132, 255, .055);
  text-align: center;
  overflow-wrap: anywhere;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.zona.activa {
  border-color: var(--acento, #0A84FF);
  background: rgba(10, 132, 255, .15);
  box-shadow: inset 0 0 24px rgba(10, 132, 255, .08),
              0 0 20px rgba(10, 132, 255, .13);
}

.visor {
  background: var(--nav, #081122);
}

.visor img,
.visor video,
.visor canvas {
  max-width: 100%;
  height: auto;
}

.leyenda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 18px 0;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
}

.leyenda .tenue {
  min-width: 0;
  color: var(--tenue, #8A9BB8);
  overflow-wrap: anywhere;
}

.bitacora {
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.tipo-pedido {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(10, 132, 255, .35);
  border-radius: 999px;
  background: rgba(10, 132, 255, .12);
  color: #A9D6FF;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.crit {
  --color-criticidad: #8A9BB8;
  --texto-criticidad: #C4CFDF;
  --fondo-criticidad: rgba(138, 155, 184, .12);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--color-criticidad);
  border-inline-start-width: 1px;
  border-radius: 999px;
  background: var(--fondo-criticidad);
  color: var(--texto-criticidad);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .035em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.crit::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-criticidad);
}

.crit.n1 {
  --color-criticidad: var(--critica, #FB7185);
  --texto-criticidad: #FDA4AF;
  --fondo-criticidad: rgba(251, 113, 133, .12);
}

.crit.n2 {
  --color-criticidad: var(--relevante, #FBBF24);
  --texto-criticidad: #FCD34D;
  --fondo-criticidad: rgba(251, 191, 36, .12);
}

.crit.n3,
.crit.baja {
  --color-criticidad: var(--ok, #34D399);
  --texto-criticidad: #6EE7B7;
  --fondo-criticidad: rgba(52, 211, 153, .12);
}

#mapa {
  width: 100%;
  height: 70vh;
  min-height: 380px;
  border: 1px solid var(--borde, rgba(120, 160, 255, .14));
  border-radius: 14px;
  background: var(--superficie, #0D1B2E);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.leaflet-container {
  background: var(--superficie, #0D1B2E);
  color: var(--texto, #E8EEF9);
  font-family: "Cairo", "Segoe UI", sans-serif;
}

.leaflet-bar,
.leaflet-control-layers,
.leaflet-popup-content-wrapper,
.leaflet-tooltip,
.leaflet-control-attribution {
  border: 1px solid var(--vidrio-borde, rgba(120, 160, 255, .2));
  border-radius: 14px;
  background: rgba(10, 20, 40, .94);
  color: var(--texto, #E8EEF9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
}

.leaflet-touch .leaflet-bar,
.leaflet-touch .leaflet-control-layers {
  border-color: var(--borde, rgba(120, 160, 255, .2));
}

.leaflet-bar a {
  border-bottom-color: var(--borde, rgba(120, 160, 255, .14));
  background: transparent;
  color: var(--texto, #E8EEF9);
  transition: background .2s, color .2s;
}

.leaflet-bar a:first-child {
  border-radius: 13px 13px 0 0;
}

.leaflet-bar a:last-child {
  border-radius: 0 0 13px 13px;
}

.leaflet-bar a.leaflet-disabled {
  background: rgba(255, 255, 255, .025);
  color: var(--tenue, #8A9BB8);
}

.leaflet-control-layers {
  max-width: calc(100vw - 48px);
}

.leaflet-control-layers-expanded {
  padding: 10px 14px;
  color: var(--texto, #E8EEF9);
}

.leaflet-control-layers-toggle {
  background-image: none;
  color: var(--texto, #E8EEF9);
}

.leaflet-control-layers-toggle::before {
  content: "▱";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #A9D6FF;
  font-size: 28px;
  line-height: 1;
}

.leaflet-control-layers-selector {
  accent-color: var(--acento, #0A84FF);
}

.leaflet-control-layers-separator {
  border-color: var(--borde, rgba(120, 160, 255, .14));
}

.leaflet-popup-content-wrapper {
  max-width: calc(100vw - 48px);
}

.leaflet-popup-content {
  max-width: calc(100vw - 80px);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.leaflet-popup-tip {
  background: #0D1B2E;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--tenue, #8A9BB8);
}

.leaflet-container a {
  color: #79BCFF;
}

.leaflet-tooltip {
  max-width: calc(100vw - 48px);
  padding: 7px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.leaflet-tooltip-top::before {
  border-top-color: #0D1B2E;
}

.leaflet-tooltip-bottom::before {
  border-bottom-color: #0D1B2E;
}

.leaflet-tooltip-left::before {
  border-left-color: #0D1B2E;
}

.leaflet-tooltip-right::before {
  border-right-color: #0D1B2E;
}

.leaflet-control-attribution {
  max-width: calc(100vw - 40px);
  padding: 3px 7px;
  border-radius: 8px 0 0 0;
  color: #B5C3D8;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.marcador svg [stroke="#2463eb"],
.visor svg [stroke="#2463eb"],
#mapa svg [stroke="#2463eb"] {
  stroke: var(--acento, #0A84FF);
}

.marcador svg [stroke="#168465"],
.visor svg [stroke="#168465"],
#mapa svg [stroke="#168465"] {
  stroke: var(--ok, #34D399);
}

.marcador svg [fill="#168465"],
.visor svg [fill="#168465"],
#mapa svg [fill="#168465"] {
  fill: var(--ok, #34D399);
}

.marcador .pestanas button:focus-visible,
.lista-imagenes button:focus-visible,
.nodo-imagenes > summary:focus-visible,
.sel-bloque:focus-visible,
.sel-cruda:focus-visible,
.zona:focus-visible,
.leaflet-container a:focus-visible,
.leaflet-control-layers-selector:focus-visible {
  outline: 3px solid var(--acento, #0A84FF);
  outline-offset: 3px;
}

.marcador .pestanas button:disabled,
.lista-imagenes button:disabled {
  background: rgba(255, 255, 255, .025);
  border-color: var(--borde, rgba(120, 160, 255, .14));
  color: var(--tenue, #8A9BB8);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (hover: hover) {
  .marcador .pestanas button:not(:disabled):hover,
  .lista-imagenes button:not(:disabled):hover {
    border-color: #1E90FF;
    background: rgba(10, 132, 255, .18);
    color: var(--texto, #E8EEF9);
    box-shadow: 0 8px 22px rgba(10, 132, 255, .16);
    transform: translateY(-2px);
  }

  .nodo-imagenes > summary:hover {
    background: rgba(10, 132, 255, .1);
  }

  .zona:hover {
    border-color: #1E90FF;
    background: rgba(10, 132, 255, .1);
  }

  .leaflet-bar a:not(.leaflet-disabled):hover,
  .leaflet-bar a:not(.leaflet-disabled):focus {
    background: rgba(10, 132, 255, .2);
    color: #FFFFFF;
  }

  .leaflet-container a.leaflet-popup-close-button:hover {
    color: #FFFFFF;
  }
}

@media (max-width: 600px) {
  .marcador {
    padding: 12px;
  }

  .marcador .pestanas button {
    flex: 1 1 120px;
    padding-inline: 12px;
  }

  .lista-imagenes {
    gap: 10px;
  }

  .lista-imagenes button {
    padding: 12px;
  }

  .nodo-imagenes > .lista-imagenes {
    padding: 10px;
  }

  #mapa {
    height: 58vh;
    min-height: 320px;
  }

  .leyenda {
    gap: 10px;
    padding: 12px;
  }

  .leyenda .tenue {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marcador .pestanas button,
  .lista-imagenes button,
  .nodo-imagenes > summary,
  .nodo-imagenes > summary::before,
  .zona,
  .leaflet-bar a {
    transition: none;
    animation: none;
  }

  .marcador .pestanas button:not(:disabled):hover,
  .lista-imagenes button:not(:disabled):hover {
    transform: none;
  }
}

/* Ajuste posterior: botones dentro de tablas (la ultima columna es estrecha y
   el texto de "Ver"/"Borrar" se partia en lineas, haciendo filas de 170 px). */
.tabla-caja td button,
.tabla-caja td .sec,
.tabla-caja td .peligro {
  white-space: nowrap;
  min-height: 34px;
  padding: 6px 14px;
}
.tabla-caja td:last-child { white-space: nowrap; }
.tabla-caja td select { min-height: 36px; padding: 6px 28px 6px 12px; }

/* Ajuste posterior: casillas (checkbox) y lineas de archivo. El estilo global
   hace de cada label una columna y de cada input un bloque al 100 %, y eso
   dejaba "Seleccionar todas" con la casilla flotando sobre su texto. */
input[type="checkbox"], input[type="radio"] {
  display: inline-block;
  width: auto;
  min-height: 0;
  margin: 0 8px 0 0;
  flex: none;
  accent-color: var(--acento, #0A84FF);
}
label:has(> input[type="checkbox"]) {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.linea { flex-wrap: wrap; gap: 6px 16px; }
.linea > span { min-width: 0; }
