body {
  background-color: var(--tb-bg);
}

.w-10 {
  width: 10% !important;
}

.h-10 {
  height: 10% !important;
}

.h-15 {
  height: 15% !important;
}

.h-85 {
  height: 85% !important;
}

.litle-text {
  font-size: 6px;
}

.h-7 {
  height: 7% !important;
}

.h-90 {
  height: 90% !important;
}


img:not([src]),
img[src=""] {
  visibility: hidden; /* Oculta contenido pero mantiene espacio y borde */
}

.fixed-bottom-map-img-floor {
  position: fixed;
  right: 25vw;
  top: 27vh;
  height: 61vh;
  z-index: 1030;
}

.fixed-bottom-map-right {
  position: fixed;
  right: 0px;
  bottom: 100px;
  z-index: 1030;
}

.fixed-bottom-map-left {
  position: fixed;
  left: 0px;
  bottom: 100px;
  z-index: 1030;
}

.fixed-bottom-map-zoom {
  position: fixed;
  left: 40vw;
  bottom: 0vh;
  z-index: 1030;
  height: 10vh;
  width: 10vw;
}
.fixed-bottom-map-foto {
  position: fixed;
  left: 50vw;
  bottom: 0vh;
  z-index: 1030;
  height: 10vh;
  width: 10vw;
}
.fixed-bottom-map-parking {
  position: fixed;
  left: 60vw;
  bottom: 0vh;
  z-index: 1030;
  height: 10vh;
  width: 10vw;
}

.fixed-bottom-map-0 {
  position: fixed;
  left: 0px;
  top: 25vh;
  z-index: 1030;
  height: 25vh;
  width: 34vh;
  background: rgba(4, 4, 4, 0.1);
}
.fixed-bottom-map-1 {
  position: fixed;
  right: 0px;
  top: 25vh;
  z-index: 1030;
  height: 25vh;
  width: 34vh;
  background: rgba(4, 4, 4, 0.1);
}

.fixed-bottom-map-2 {
  position: fixed;
  right: 0px;
  bottom: 0px;
  z-index: 1030;
  height: 25vh;
  width: 34vh;
  background: rgba(4, 4, 4, 0.1);
}
.fixed-bottom-map-3 {
  position: fixed;
  left: 0px;
  bottom: 0px;
  z-index: 1030;
  height: 25vh;
  width: 34vh;
  background: rgba(4, 4, 4, 0.1);
}

.fixed-bottom-map-0 img {
  height: 25vh;
  width: 34vh;
}
.fixed-bottom-map-1 img {
  height: 25vh;
  width: 34vh;
}
.fixed-bottom-map-2 img {
  height: 25vh;
  width: 34vh;
}
.fixed-bottom-map-3 img {
  height: 25vh;
  width: 34vh;
}

.fixed-bottom-map-0 span {
  position: fixed;
  top: 25vh;
  left: 0vh;
  font-size: 2em;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
  color: black;
  background-color: white;
}
.fixed-bottom-map-1 span {
  position: fixed;
  top: 25vh;
  right: 0vh;
  font-size: 2em;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
  color: black;
  background-color: white;
}
.fixed-bottom-map-2 span {
  position: fixed;
  bottom: 0vh;
  right: 0vh;
  font-size: 2em;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
  color: black;
  background-color: white;
}
.fixed-bottom-map-3 span {
  position: fixed;
  left: 0vh; 
  bottom: 0vh;
  font-size: 2em;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
  color: black;
  background-color: white;
}



.fixed-img-live2-left {
  position: fixed;
  left: 0vw;
  top: 25vh;
  z-index: 1030;
  height: 75vh;
  width: 50vw;
}
.fixed-img-live2-right {
  position: fixed;
  right: 0vw;
  top: 25vh;
  z-index: 1030;
  height: 75vh;
  width: 50vw;
}
.fixed-span-live2-0 {
  position: fixed;
  top: 25vh;
  left: 0vh;
  font-size: 4em;
  /* right: 0px; */
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live2-1 {
  position: fixed;
  top: 25vh;
  right: 0vh;
  font-size: 4em;
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live2-2 {
  position: fixed;
  bottom: 0vh;
  right: 0vh;
  font-size: 4em;
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live2-3 {
  position: fixed;
  left: 0vh; 
  bottom: 0vh;
  font-size: 4em;
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}


.fixed-img-live4-0 {
  position: fixed;
  left: 0px;
  top: 25vh;
  z-index: 1030;
  height: 37.5vh;
  width: 25vw;
}
.fixed-img-live4-1 {
  position: fixed;
  right: 0px;
  top: 25vh;
  z-index: 1030;
  height: 37.5vh;
  width: 25vw;
}
.fixed-img-live4-2 {
  position: fixed;
  right: 0px;
  bottom: 0vh;
  z-index: 1030;
  height: 37.5vh;
  width: 25vw;
}
.fixed-img-live4-3 {
  position: fixed;
  left: 0px;
  bottom: 0vh;
  z-index: 1030;
  height: 37.5vh;
  width: 25vw;
}
.fixed-img-live4-last {
  position: fixed;
  left: 25vw;
  bottom: 0vh;
  z-index: 1030;
  width: 50vw;
  height: 75vh;
}

.fixed-span-live4-0 {
  position: fixed;
  top: 25vh;
  left: 0vh;
  font-size: 2em;
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live4-1 {
  position: fixed;
  top: 25vh;
  right: 0vh;
  font-size: 2em;
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live4-2 {
  position: fixed;
  bottom: 0vh;
  right: 0vh;
  font-size: 2em;
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live4-3 {
  position: fixed;
  left: 0vh; 
  bottom: 0vh;
  font-size: 2em;
  color: black;
  background-color: white;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live4-last-0 {
  position: fixed;
  top: 25vh;
  left: 25vw; 
  font-size: 3em;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
  padding: 0px, 1vh;
}
.fixed-span-live4-last-1 {
  position: fixed;
  top: 25vh;
  right: 25vw; 
  font-size: 3em;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live4-last-2 {
  position: fixed;
  bottom: 0vh;
  right: 25vw; 
  font-size: 3em;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}
.fixed-span-live4-last-3 {
  position: fixed;
  bottom: 0vh;
  left: 25vw; 
  font-size: 3em;
  z-index: 1031;
  padding-left: 0.5vw;
  padding-right: 0.5vw;
}


#lastplate {
  scroll-behavior: smooth;
}

.photo-size {
  width: 200px !important;
  z-index: 1000;
}

.json-container {
  width: 99% !important;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 100px !important;
  position: fixed;
  bottom: 30px;
  left: 10px;
}

#floatingWindow {
  position: fixed;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
}

#floatingWindow img {
  max-width: 100%;
  max-height: 100%;
  cursor: pointer;
}

.photo-size:hover,
.photo-size:active {
  width: 450px !important;
  z-index: 1000;
}

.button-size {
  height: 25vh !important;
}

/* Etiqueta de modo (scancar/controlcar): fondo oscilante para llamar la atencion */
@keyframes mode-blink {
  0%,
  100% {
    background-color: #212529;
    color: #ffffff;
  }
  50% {
    background-color: #8b8b8b;
    color: #ffffff;
  }
}

.mode-blink {
  animation: mode-blink 2s ease-in-out infinite;
}

/* === Barra principal (tiles) === */
/* Alto fijo 25vh: live2/live4 y las fotos del mapa se posicionan con top:25vh */
:root,
.topbar,
.ude-app,
.tb-back,
.cfg-panel,
.cap-panel,
.inf-panel,
.cam-panel,
.tst-panel,
.tb-modal,
.tb-mbtn,
.tb-keyboard {
  --tb-bg: #14171c;
  --tb-tile: #232730;
  --tb-tile-2: #2a2f39;
  --tb-border: #2e333d;
  --tb-text: #e8eaed;
  --tb-dim: #8a929d;
  --tb-ok: #2fb170;
  --tb-warn: #e0a526;
  --tb-err: #e0463f;
  --tb-accent: #0dcaf0;
  --tb-accent-deep: #0a5f70;
  --tb-input: #0f1115;
  --tb-input-text: #d7dde5;
  --tb-err-text: #f29a95;
  --tb-panel-2: #1c2027;
  --tb-active-a: #2f3542;
  --tb-active-b: #273040;
  --tb-hl: rgba(255, 255, 255, 0.04);
  --tb-shadow: rgba(0, 0, 0, 0.4);
  --tb-shadow-lg: rgba(0, 0, 0, 0.6);
  --rec-bg: #1a1d24;
  --rec-surface: #232730;
  --rec-surface-2: #2a2f39;
  --rec-border: #2e333d;
  --rec-accent: #0dcaf0;
  --rec-text: #e8eaed;
  --rec-text-dim: #8a929d;
}

/* Modo dia (view.modo en client.yml, html[data-modo]). Sin configurar se usa dia; el
   bloque anterior, oscuro, es el modo noche. */
html[data-modo="dia"],
html[data-modo="dia"] .topbar,
html[data-modo="dia"] .ude-app,
html[data-modo="dia"] .tb-back,
html[data-modo="dia"] .cfg-panel,
html[data-modo="dia"] .cap-panel,
html[data-modo="dia"] .inf-panel,
html[data-modo="dia"] .cam-panel,
html[data-modo="dia"] .tst-panel,
html[data-modo="dia"] .tb-modal,
html[data-modo="dia"] .tb-mbtn,
html[data-modo="dia"] .tb-keyboard {
  --tb-bg: #eef1f5;
  --tb-tile: #ffffff;
  --tb-tile-2: #f7f9fb;
  --tb-border: #d3d9e1;
  --tb-text: #1d2330;
  --tb-dim: #5d6673;
  --tb-ok: #1f9a5c;
  --tb-warn: #c28a0e;
  --tb-err: #d0352e;
  --tb-accent: #0a8fb0;
  --tb-accent-deep: #0a8fb0;
  --tb-input: #f8fafc;
  --tb-input-text: #1d2330;
  --tb-err-text: #b3261e;
  --tb-panel-2: #e4e9ef;
  --tb-active-a: #e3f5fa;
  --tb-active-b: #d2eef6;
  --tb-hl: rgba(255, 255, 255, 0.6);
  --tb-shadow: rgba(20, 30, 50, 0.15);
  --tb-shadow-lg: rgba(20, 30, 50, 0.25);
  --rec-bg: #eef1f5;
  --rec-surface: #ffffff;
  --rec-surface-2: #f7f9fb;
  --rec-border: #d3d9e1;
  --rec-accent: #0a8fb0;
  --rec-text: #1d2330;
  --rec-text-dim: #5d6673;
}

.topbar {
  display: flex;
  gap: 0.5vw;
  height: 25vh;
  padding: 0.6vh 0.5vw;
  background: var(--tb-bg);
  font-family: 'Montserrat', sans-serif;
}

.tb-tile {
  --tb-state: transparent;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6vh;
  padding: 1.2vh 0.4vw 0.8vh;
  overflow: hidden;
  color: var(--tb-text);
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 var(--tb-hl), 0 2px 6px var(--tb-shadow);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tb-tile:focus {
  outline: none;
}

.tb-tile:active {
  transform: scale(0.96);
}

/* Franja de estado (LED) */
.tb-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--tb-state);
  box-shadow: 0 0 12px var(--tb-state);
}

.tb-ok { --tb-state: var(--tb-ok); }
.tb-warn { --tb-state: var(--tb-warn); }
.tb-err { --tb-state: var(--tb-err); border-color: rgba(224, 70, 63, 0.6); animation: tb-pulse 2s ease-in-out infinite; }
.tb-accent { --tb-state: var(--tb-accent); }

.tb-ok .tb-icon { color: var(--tb-ok); }
.tb-warn .tb-icon { color: var(--tb-warn); }
.tb-err .tb-icon { color: var(--tb-err); }
.tb-accent .tb-icon { color: var(--tb-accent); }

@keyframes tb-pulse {
  0%, 100% { box-shadow: inset 0 0 0 rgba(224, 70, 63, 0), 0 2px 6px var(--tb-shadow); }
  50% { box-shadow: inset 0 0 22px rgba(224, 70, 63, 0.35), 0 2px 6px var(--tb-shadow); }
}

.tb-icon {
  font-size: min(7vh, 4vw);
  line-height: 1;
}

/* Tarjeta con varios datos (cliente): icono más pequeño para dejar sitio */
.tb-icon-sm {
  font-size: min(4.5vh, 2.6vw);
}

/* Indicador pequeño en la esquina (lado de la cámara, avance de vista) */
.tb-corner {
  position: absolute;
  top: 1.2vh;
  left: 0.6vw;
  font-size: min(2.4vh, 1.3vw);
  color: var(--tb-dim);
}

.tb-corner-right {
  left: auto;
  right: 0.6vw;
}

.tb-data {
  max-width: 100%;
  font-size: min(2.6vh, 1.4vw);
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--tb-text);
}

.tb-data .tb-label {
  font-weight: 400;
  color: var(--tb-dim);
  margin-right: 0.3em;
}

.tb-counters {
  display: flex;
  justify-content: center;
  width: 100%;
}

.tb-counters > .tb-data {
  flex: 1 1 0;
  text-align: center;
}

.tb-counters > .tb-data + .tb-data {
  border-left: 1px solid var(--tb-border);
}

.tb-counters .tb-big {
  font-size: min(3.6vh, 2vw);
}

/* Píldora de modo (scancar / controlcar) */
.tb-mode {
  width: 100%;
  margin-top: auto;
  padding: 0.5vh 0;
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  background: var(--tb-bg);
  font-size: min(2.4vh, 1.2vw);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-mode.mode-blink {
  border-color: var(--tb-accent);
  animation: tb-mode-blink 2s ease-in-out infinite;
}

@keyframes tb-mode-blink {
  0%, 100% { background-color: var(--tb-bg); color: var(--tb-text); }
  50% { background-color: var(--tb-accent-deep); color: #ffffff; }
}

/* Tarjeta Scanplanner (logo sobre fondo claro) */
.tb-light {
  background: linear-gradient(180deg, #f4f5f7 0%, #dfe2e6 100%);
  color: #212529;
}

.tb-light img {
  max-width: 90%;
  max-height: 60%;
}

/* Botones flotantes del mapa con la misma estética */
.tb-float {
  color: var(--tb-text) !important;
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%) !important;
  border: 1px solid var(--tb-border) !important;
  border-radius: 14px 14px 0 0 !important;
  box-shadow: 0 -2px 8px var(--tb-shadow);
  font-family: 'Montserrat', sans-serif;
  font-size: min(4vh, 2.2vw);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tb-float.tb-float-on {
  color: var(--tb-accent) !important;
  border-color: var(--tb-accent) !important;
}

/* === Pantalla UTEDevas (/cliente) con la estética de la barra === */
.ude-app .bg-dark {
  background-color: var(--tb-bg) !important;
}

.ude-app .border-top,
.ude-app .border-bottom {
  border-color: var(--tb-border) !important;
}

.ude-bar {
  display: flex;
  gap: 0.6vw;
  padding: 1vh 0.6vw;
  background: var(--tb-bg);
  border-bottom: 1px solid var(--tb-border);
}

/* Hueco a la derecha para el botón VOLVER del iframe padre */
.ude-bar-reserve {
  padding-right: calc(16.66% + 1rem);
}

.ude-bar .tb-tile {
  flex-direction: row;
  justify-content: center;
  gap: 0.8vw;
  min-height: 9vh;
  padding: 1.4vh 0.8vw 1vh;
}

.ude-bar .tb-icon {
  font-size: min(4.5vh, 2.6vw);
}

.ude-bar .tb-data {
  font-size: min(3.2vh, 1.7vw);
}

.ude-bar .tb-big {
  font-size: min(4.4vh, 2.4vw);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ude-bar .tb-label {
  font-size: min(2.2vh, 1.1vw);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tb-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pestaña / modo seleccionado */
.tb-tile.tb-active {
  background: linear-gradient(180deg, var(--tb-active-a) 0%, var(--tb-active-b) 100%);
  border-color: var(--tb-accent);
  box-shadow: inset 0 0 0 1px var(--tb-accent), 0 0 14px rgba(13, 202, 240, 0.25);
}

.tb-tile.tb-active .tb-label {
  color: var(--tb-text);
}

.tb-tile.tb-active:not(.tb-ok):not(.tb-warn):not(.tb-err) .tb-icon {
  color: var(--tb-accent);
}

/* En una pestaña los errores no laten: el contador ya lo indica */
.ude-bar .tb-err {
  animation: none;
}

.ude-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 0.4vh;
}

/* Color fijo del icono (la franja solo se enciende si el contador > 0) */
.tb-c-ok { color: var(--tb-ok); }
.tb-c-warn { color: var(--tb-warn); }
.tb-c-err { color: var(--tb-err); }
.tb-c-dim { color: var(--tb-dim); }

.tb-tile:disabled {
  cursor: default;
  opacity: 1;
}

.tb-tile.tb-fit {
  flex: 0 0 auto;
}

/* === Pantalla de configuración === */
.cfg-panel {
  height: 75vh;
  overflow-y: auto;
  padding: 1.6vh 1.2vw 6vh;
  background: var(--tb-bg);
  font-family: 'Montserrat', sans-serif;
  color: var(--tb-text);
}

.cfg-section + .cfg-section {
  margin-top: 2vh;
}

.cfg-title {
  margin: 0 0 1vh 0.2vw;
  font-size: min(2.2vh, 1.1vw);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tb-dim);
}

.cfg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1vh 0.8vw;
}

.cfg-panel .tb-tile.cfg-tile {
  flex-direction: row;
  justify-content: flex-start;
  gap: 1.4vw;
  min-height: 10vh;
  padding: 1.4vh 1.4vw 1vh;
  text-align: left;
}

.cfg-tile .tb-icon {
  font-size: min(5.5vh, 3vw);
  color: var(--tb-accent);
}

.cfg-tile .cfg-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: min(3vh, 1.6vw);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.cfg-tile.cfg-danger .tb-icon {
  color: var(--tb-err);
}

.cfg-tile.cfg-danger:active {
  border-color: var(--tb-err);
}

/* Interruptor visual (el clic lo gestiona la tarjeta entera) */
.cfg-switch {
  flex: 0 0 auto;
  margin-right: 1.2vw; /* hueco para el candado de la esquina */
  position: relative;
  width: min(7vh, 4vw);
  height: min(3.8vh, 2.2vw);
  border-radius: 999px;
  background: var(--tb-border);
  transition: background 0.2s ease;
}

.cfg-switch::after {
  content: '';
  position: absolute;
  top: 12%;
  left: 7%;
  width: 38%;
  height: 76%;
  border-radius: 50%;
  background: var(--tb-dim);
  transition: left 0.2s ease, background 0.2s ease;
}

.cfg-switch.on {
  background: rgba(47, 177, 112, 0.35);
}

.cfg-switch.on::after {
  left: 55%;
  background: var(--tb-ok);
}

/* Idioma actual en su tarjeta: desplegable con administración, rótulo sin ella (view.idioma) */
.cfg-idioma {
  flex: 0 0 auto;
  margin-right: 1.2vw; /* hueco para el candado de la esquina */
  padding: 0.4vh 0.8vw;
  border: 1px solid var(--tb-accent);
  border-radius: 999px;
  color: var(--tb-accent);
  font-size: min(2vh, 1.1vw);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Desplegable: mismo aspecto de píldora, más grande para el dedo, con flecha propia */
.cfg-idioma-select {
  min-width: 9vw;
  padding: 0.8vh 2.4vw 0.8vh 1vw;
  font-family: inherit;
  font-size: min(2.6vh, 1.4vw);
  background: var(--tb-tile) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23888' stroke-width='2' d='M3 6l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.7vw center / 1.1vw auto;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.cfg-idioma-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--tb-accent);
}

.cfg-idioma-select option {
  color: var(--tb-text);
  background: var(--tb-tile);
}

.cfg-version {
  position: fixed;
  left: 1.2vw;
  bottom: 1vh;
  z-index: 2000;
  font-family: 'Montserrat', sans-serif;
  font-size: min(2vh, 1vw);
  letter-spacing: 0.06em;
  color: var(--tb-dim);
}

.cfg-version .cfg-debug {
  margin-left: 0.6em;
  color: var(--tb-warn);
  font-weight: 700;
}

/* === TEST CAPTURE (view_imagenes) === */
.cap-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--tb-bg);
  color: var(--tb-text);
  font-family: 'Montserrat', sans-serif;
}

.cap-bar {
  align-items: stretch;
}

.cap-panel .tb-tile.cap-btn {
  flex-direction: row;
  min-width: 7vw;
  padding: 1.2vh 1vw 0.8vh;
}

.cap-panel .tb-tile.cap-btn:disabled {
  opacity: 0.4;
}

.cap-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 0.6vw;
}

.cap-slider {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6vh;
  padding: 0 1vw;
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
}

.cap-count {
  display: flex;
  align-items: baseline;
  gap: 0.4vw;
}

.cap-slider .form-range::-webkit-slider-runnable-track {
  background: var(--tb-border);
}

.cap-slider .form-range::-webkit-slider-thumb {
  background: var(--tb-accent);
}

.cap-chips {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 0.5vh 0.4vw;
  max-width: 34vw;
}

.cap-chip {
  min-width: 4vw;
  padding: 0.8vh 0.8vw;
  color: var(--tb-dim);
  background: var(--tb-tile);
  border: 1px solid var(--tb-border);
  border-radius: 999px;
  font-size: min(2vh, 1.05vw);
  font-weight: 700;
  letter-spacing: 0.06em;
  -webkit-tap-highlight-color: transparent;
}

.cap-chip.on {
  color: #000;
  background: var(--tb-accent);
  border-color: var(--tb-accent);
}

.cap-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1vh;
  font-size: min(3vh, 1.6vw);
  font-weight: 700;
}

.cap-empty .tb-label {
  font-size: min(2.2vh, 1.1vw);
  font-weight: 400;
  color: var(--tb-dim);
}

.cap-empty .bi {
  font-size: min(10vh, 6vw);
  color: var(--tb-border);
}

.cap-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 0.8vw;
  padding: 1vh 0.6vw;
}

/* Datos de la lectura */
.cap-info {
  flex: 0 0 24vw;
  overflow-y: auto;
  padding: 1.4vh 1vw;
  background: var(--tb-tile);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
}

.cap-info .cap-plate {
  display: block;
  text-align: center;
  font-size: min(4.4vh, 2.4vw);
  padding: 0.4vh 0.6vw;
}

.cap-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6vw;
  margin: 1vh 0 0.4vh;
  font-size: min(1.9vh, 1vw);
  color: var(--tb-dim);
  font-variant-numeric: tabular-nums;
}

.cap-group {
  margin: 1.6vh 0 0.6vh;
  padding-bottom: 0.4vh;
  border-bottom: 1px solid var(--tb-border);
  font-size: min(1.9vh, 1vw);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tb-accent);
}

.cap-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5vh 0.8vw;
  align-items: baseline;
}

.cap-panel .field-label {
  margin: 0;
  color: var(--tb-dim);
  font-size: min(1.8vh, 0.95vw);
  white-space: nowrap;
}

.cap-val {
  font-size: min(2.2vh, 1.15vw);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-all;
}

.cap-mono {
  font-family: Consolas, 'Courier New', monospace;
  font-weight: 400;
  font-size: min(1.9vh, 1vw);
}

.cap-info::-webkit-scrollbar,
.cap-photos::-webkit-scrollbar,
.cap-json::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.cap-info::-webkit-scrollbar-thumb,
.cap-photos::-webkit-scrollbar-thumb,
.cap-json::-webkit-scrollbar-thumb {
  background: var(--tb-border);
  border-radius: 5px;
}

.cap-info::-webkit-scrollbar-track,
.cap-photos::-webkit-scrollbar-track,
.cap-json::-webkit-scrollbar-track,
.cap-json::-webkit-scrollbar-corner {
  background: transparent;
}

/* Fotos */
.cap-photos {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22vw, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.8vw;
  overflow-y: auto;
}

.cap-photo {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 1px solid var(--tb-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
}

.cap-photo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cap-photo-label {
  position: absolute;
  top: 0.8vh;
  left: 0.6vw;
  padding: 0.3vh 0.6vw;
  background: rgba(20, 23, 28, 0.85);
  border: 1px solid var(--tb-border);
  border-radius: 999px;
  font-size: min(1.8vh, 0.95vw);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tb-accent);
}

.cap-json {
  min-height: 0;
  margin: 0;
  padding: 1.2vh 1vw;
  overflow: auto;
  background: var(--tb-input);
  color: var(--tb-input-text);
  border: 1px solid var(--tb-border);
  border-radius: 12px;
  font-size: min(1.8vh, 0.95vw);
}

/* Foto ampliada */
.cap-zoom {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.cap-zoom img {
  max-width: 96vw;
  max-height: 94vh;
  object-fit: contain;
}

.cap-zoom-close {
  position: absolute;
  top: 2vh;
  right: 1.5vw;
  font-size: min(5vh, 3vw);
  color: var(--tb-text);
}

/* === TEST DATA (vista info) === */
.inf-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.8vh 0.6vw;
  height: 100%;
  padding: 1vh 0.6vw;
  background: var(--tb-bg);
  color: var(--tb-text);
  font-family: 'Montserrat', sans-serif;
}

.inf-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tb-tile);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
}

.inf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--tb-state, transparent);
  box-shadow: 0 0 10px var(--tb-state, transparent);
}

/* Aquí el estado lo da la franja; sin pulso para poder leer el JSON */
.inf-panel .tb-err {
  animation: none;
}

.inf-card.inf-max {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.inf-head {
  display: flex;
  align-items: center;
  gap: 0.6vw;
  padding: 1.4vh 0.8vw 0.8vh;
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border-bottom: 1px solid var(--tb-border);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.inf-head .inf-icon {
  font-size: min(3vh, 1.6vw);
  color: var(--tb-accent);
}

.inf-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: min(2.2vh, 1.15vw);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inf-toggle {
  font-size: min(2.2vh, 1.15vw);
  color: var(--tb-dim);
}

.inf-json {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 1vh 0.8vw;
  overflow: auto;
  background: var(--tb-input);
  color: var(--tb-input-text);
  font-family: Consolas, 'Courier New', monospace;
  font-size: min(1.8vh, 0.9vw);
  line-height: 1.45;
}

.inf-max .inf-json {
  font-size: min(2.2vh, 1.15vw);
}

.inf-json::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.inf-json::-webkit-scrollbar-thumb {
  background: var(--tb-border);
  border-radius: 5px;
}

.inf-json::-webkit-scrollbar-track,
.inf-json::-webkit-scrollbar-corner {
  background: transparent;
}

/* === Modales con la estética de la barra (.tb-modal en .modal-content) === */
.tb-modal {
  position: relative;
  overflow: hidden;
  color: var(--tb-text);
  background: var(--tb-tile);
  border: 1px solid var(--tb-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px var(--tb-shadow-lg);
  font-family: 'Montserrat', sans-serif;
}

/* Franja de estado arriba (cian por defecto; .tb-err / .tb-ok la cambian) */
.tb-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 1;
  background: var(--tb-state, var(--tb-accent));
  box-shadow: 0 0 12px var(--tb-state, var(--tb-accent));
}

.tb-modal.tb-err {
  animation: none;
}

.tb-modal .modal-header {
  padding: 1.6rem 1.4rem 1rem;
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border-bottom: 1px solid var(--tb-border);
}

.tb-modal .modal-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tb-modal .modal-title .bi {
  font-size: 1.6rem;
  color: var(--tb-state, var(--tb-accent));
}

html:not([data-modo="dia"]) .tb-modal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.tb-modal .btn-close {
  opacity: 0.7;
}

.tb-modal .modal-body {
  padding: 1.4rem;
}

.tb-modal .modal-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--tb-border);
}

.tb-modal .form-control {
  color: var(--tb-text);
  background: var(--tb-input);
  border-color: var(--tb-border);
}

.tb-modal .form-control::placeholder {
  color: var(--tb-dim);
  letter-spacing: 0.06em;
}

.tb-modal .form-control:focus {
  color: var(--tb-text);
  background: var(--tb-input);
  border-color: var(--tb-accent);
  box-shadow: 0 0 0 0.15rem rgba(13, 202, 240, 0.2);
}

.tb-modal .form-control.is-valid {
  border-color: var(--tb-ok);
}

.tb-modal .input-group .btn {
  color: var(--tb-text);
  background: var(--tb-tile-2);
  border-color: var(--tb-border);
}

.tb-modal .alert-danger {
  color: var(--tb-err-text);
  background: rgba(224, 70, 63, 0.1);
  border: 1px solid rgba(224, 70, 63, 0.4);
  border-left: 6px solid var(--tb-err);
}

/* Botones en tarjeta dentro de los modales */
.tb-mbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 9rem;
  min-height: 3.6rem;
  padding: 0.6rem 1.4rem;
  overflow: hidden;
  color: var(--tb-text);
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border: 1px solid var(--tb-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 var(--tb-hl), 0 2px 6px var(--tb-shadow);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}

.tb-mbtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--tb-state, transparent);
}

.tb-mbtn:active {
  transform: scale(0.96);
}

.tb-mbtn .bi {
  font-size: 1.4rem;
}

.tb-mbtn.tb-ok .bi { color: var(--tb-ok); }
.tb-mbtn.tb-err { animation: none; }
.tb-mbtn.tb-err .bi,
.tb-mbtn.tb-c-err .bi { color: var(--tb-err); }
.tb-mbtn.tb-accent .bi { color: var(--tb-accent); }

.tb-mbtn.disabled,
.tb-mbtn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.tb-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* Aviso a pantalla (sin internet) */
.tb-modal-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tb-modal-msg .bi {
  font-size: 4.5rem;
  color: var(--tb-err);
}

/* Lista de ficheros KML */
.kml-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.kml-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  background: var(--tb-input);
  border: 1px solid var(--tb-border);
  border-radius: 12px;
}

.kml-row .bi-file-earmark-text {
  font-size: 1.6rem;
  color: var(--tb-accent);
}

.kml-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kml-empty {
  padding: 1.4rem;
  text-align: center;
  color: var(--tb-dim);
}

/* Aviso 2ª pasada: mismo marco oscuro, la cabecera roja se mantiene como alarma */
#repetidaModal .modal-content {
  background: var(--tb-tile, #232730);
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
}

/* Teclado virtual oscuro (.tb-keyboard en .modal-content) */
.tb-keyboard,
.tb-keyboard .modal-body {
  background: var(--tb-bg) !important;
}

.tb-keyboard .keyboard-top {
  background: var(--tb-tile);
  border-bottom: 1px solid var(--tb-border);
}

.tb-keyboard .text-preview-display {
  color: var(--tb-text);
  background: var(--tb-input) !important;
  border: 1px solid var(--tb-border) !important;
  border-radius: 12px;
}

.tb-keyboard .text-preview-text {
  color: var(--tb-text);
}

.tb-keyboard .text-preview-display .text-muted {
  color: var(--tb-dim) !important;
}

.tb-keyboard .key-touch {
  color: var(--tb-text);
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border: 1px solid var(--tb-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 var(--tb-hl), 0 2px 6px var(--tb-shadow);
  font-family: 'Montserrat', sans-serif;
}

.tb-keyboard .key-touch:hover,
.tb-keyboard .key-touch:focus {
  background: linear-gradient(180deg, var(--tb-active-a) 0%, var(--tb-active-b) 100%);
  border-color: var(--tb-border);
  transform: none;
}

.tb-keyboard .key-touch:active {
  background: var(--tb-panel-2);
  transform: scale(0.96);
}

.tb-keyboard .key-control-touch,
.tb-keyboard .key-control-touch:hover,
.tb-keyboard .key-control-touch:active {
  color: var(--tb-accent) !important;
  background: var(--tb-tile) !important;
  border-color: var(--tb-border) !important;
}

.tb-keyboard .key-space-touch,
.tb-keyboard .key-space-touch:hover,
.tb-keyboard .key-space-touch:active {
  color: var(--tb-text) !important;
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%) !important;
  border: 1px solid var(--tb-border) !important;
}

.tb-keyboard .key-close-touch,
.tb-keyboard .key-close-touch:hover,
.tb-keyboard .key-close-touch:active {
  color: var(--tb-err) !important;
  background: var(--tb-tile) !important;
  border-color: rgba(224, 70, 63, 0.6) !important;
}

.tb-keyboard .key-active,
.tb-keyboard .key-active:hover {
  color: #000 !important;
  background: var(--tb-accent) !important;
  border-color: var(--tb-accent) !important;
}

.tb-keyboard .keyboard-close {
  color: var(--tb-text);
  background: var(--tb-tile-2);
  border: 1px solid var(--tb-border);
  border-radius: 12px;
}

/* === LIVE CAMERAS (view_camaras) === */
.cam-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--tb-bg);
  color: var(--tb-text);
  font-family: 'Montserrat', sans-serif;
}

.cam-bar {
  align-items: stretch;
}

.cam-bar .cap-chips {
  max-width: none;
}

.cam-summary {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 0.4vw;
  padding: 0 1.2vw;
  align-self: center;
}

.cam-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.8vh 0.6vw;
  padding: 1vh 0.6vw;
}

.cam-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tb-tile);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.cam-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  z-index: 1;
  background: var(--tb-state, transparent);
  box-shadow: 0 0 10px var(--tb-state, transparent);
}

/* El estado ya lo da la franja; sin pulso para poder mirar la imagen */
.cam-panel .tb-err {
  animation: none;
}

.cam-card.cam-max {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  cursor: zoom-out;
}

.cam-head {
  display: flex;
  align-items: center;
  gap: 0.6vw;
  padding: 1.2vh 0.8vw 0.6vh;
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border-bottom: 1px solid var(--tb-border);
}

.cam-name {
  font-size: min(2.2vh, 1.15vw);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cam-view {
  padding: 0.2vh 0.6vw;
  border: 1px solid var(--tb-border);
  border-radius: 999px;
  font-size: min(1.6vh, 0.85vw);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tb-accent);
}

.cam-meta {
  margin-left: auto;
  font-size: min(1.8vh, 0.95vw);
  color: var(--tb-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cam-toggle {
  font-size: min(2vh, 1.05vw);
  color: var(--tb-dim);
}

.cam-img {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.cam-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cam-none {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vh;
  color: var(--tb-dim);
  font-size: min(2vh, 1.05vw);
}

.cam-none .bi {
  font-size: min(7vh, 4vw);
  color: var(--tb-border);
}

.cam-error {
  position: absolute;
  left: 0.6vw;
  bottom: 0.8vh;
  display: flex;
  align-items: center;
  gap: 0.4vw;
  padding: 0.3vh 0.6vw;
  background: rgba(20, 23, 28, 0.85);
  border: 1px solid rgba(224, 70, 63, 0.6);
  border-radius: 999px;
  font-size: min(1.7vh, 0.9vw);
  font-weight: 700;
  color: #f29a95;
}

/* === TEST CAMERAS (vista online) === */
.tst-panel {
  display: flex;
  gap: 0.8vw;
  height: 100%;
  padding: 1vh 0.6vw;
  background: var(--tb-bg);
  color: var(--tb-text);
  font-family: 'Montserrat', sans-serif;
}

.tst-list {
  flex: 0 0 24vw;
  display: flex;
  flex-direction: column;
  gap: 0.8vh;
  overflow-y: auto;
}

.tst-cam {
  display: flex;
  flex-direction: column;
  gap: 0.8vh;
  padding: 1.2vh 0.8vw;
  background: var(--tb-tile);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
}

.tst-cam.tst-sel {
  border-color: var(--tb-accent);
  box-shadow: inset 0 0 0 1px var(--tb-accent);
}

.tst-cam-name {
  display: flex;
  align-items: center;
  gap: 0.6vw;
  font-size: min(2.4vh, 1.25vw);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tst-cam-name .bi {
  color: var(--tb-accent);
}

.tst-cam-btns {
  display: flex;
  gap: 0.5vw;
}

.tst-cam-btns .tb-mbtn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 6vh;
  padding: 0.4rem 0.6rem;
  font-size: min(2vh, 1.05vw);
}

.tb-mbtn.tst-on {
  color: #000;
  background: var(--tb-accent);
  border-color: var(--tb-accent);
}

.tst-view {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tb-tile);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
}

.tst-view::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  z-index: 1;
  background: var(--tb-state, transparent);
  box-shadow: 0 0 10px var(--tb-state, transparent);
}

.tst-panel .tb-err {
  animation: none;
}

.tst-view .cam-meta {
  margin-left: auto;
}

.tb-mbtn.tst-again {
  min-width: 0;
  min-height: 0;
  padding: 0.4rem 0.9rem;
  font-size: min(1.8vh, 0.95vw);
}

.tst-view .spinner-border {
  width: min(6vh, 3.5vw);
  height: min(6vh, 3.5vw);
  color: var(--tb-accent);
}

.tst-view .cam-none .tst-err {
  color: var(--tb-err);
}

/* Botón VOLVER sobre el iframe de UTEDevas */
.tb-back {
  position: absolute;
  top: 1vh;
  right: 0.6vw;
  z-index: 10;
  width: 16.66%;
  min-height: 9vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6vw;
  color: var(--tb-text);
  background: linear-gradient(180deg, var(--tb-tile-2) 0%, var(--tb-tile) 100%);
  border: 1px solid var(--tb-border);
  border-radius: 14px;
  box-shadow: 0 2px 6px var(--tb-shadow);
  font-family: 'Montserrat', sans-serif;
  font-size: min(3.2vh, 1.7vw);
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: transform 0.1s ease;
}

.tb-back .bi {
  font-size: min(4.5vh, 2.6vw);
  color: var(--tb-accent);
}

.tb-back:active {
  transform: scale(0.96);
}

.button-reset {
  position: fixed !important;
  right: 0 !important; /* Posición inicial */
  bottom: 400px !important;
  z-index: 1000 !important;
  width: 65px !important;
  height: 65px !important;
  border-radius: 75% !important;
  font-weight: bolder !important;
}

.button-upload {
  position: fixed !important;
  right: 0 !important; /* Posición inicial */
  bottom: 300px !important;
  z-index: 1000 !important;
  width: 65px !important;
  height: 65px !important;
  border-radius: 75% !important;
  font-weight: bolder !important;
}



.button-hide {
  position: fixed;
  right: 0px; /* Posición inicial */
  bottom: 150px;
  transition: right 2s ease; /* Transición en la propiedad 'right' */
}

/* Estilo cuando se aplica la clase .hide */
.button-hide.hide {
  right: -250px;
}

.cursor-pointer {
  cursor: pointer !important;
}

.push:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}
.btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

@font-face {
  font-family: 'Matricula Espanola';
  src: url('MESPREG.woff2') format('truetype');
  /* font-weight: normal;
  font-style: normal; */
}

.matricula-text {
  font-family: 'Matricula Espanola';
}

.caja {
  animation: cambiarColor 2s infinite;
}

@keyframes cambiarColor {
  0% { background-color: transparent; }
  40% { background-color: transparent; }
  50% { background-color: black; }
  60% { background-color: transparent; }
  100% { background-color: transparent; }
}

/* === view_records (variables --rec-* en :root, segun el modo) === */
.records-app {
  background-color: var(--rec-bg);
  color: var(--rec-text);
  font-family: 'Montserrat', sans-serif;
}

.records-app .records-header {
  background-color: var(--rec-bg);
  border-bottom: 2px solid var(--rec-accent);
}

.records-app .bg-light {
  background-color: var(--rec-surface) !important;
  color: var(--rec-text);
}

.records-app .input-group-text {
  background-color: var(--rec-surface-2);
  border-color: var(--rec-border);
  color: var(--rec-text-dim);
}

.records-app .form-control,
.records-app .form-select {
  background-color: var(--rec-surface-2);
  border-color: var(--rec-border);
  color: var(--rec-text);
}

.records-app .form-control::placeholder {
  color: var(--rec-text-dim);
}

.records-app .form-control:focus,
.records-app .form-select:focus {
  background-color: var(--rec-surface-2);
  border-color: var(--rec-accent);
  color: var(--rec-text);
  box-shadow: 0 0 0 0.15rem rgba(13, 202, 240, 0.25);
}

.records-table {
  --bs-table-bg: var(--rec-bg);
  --bs-table-color: var(--rec-text);
  --bs-table-striped-bg: var(--rec-surface);
  --bs-table-striped-color: var(--rec-text);
  --bs-table-hover-bg: rgba(13, 202, 240, 0.08);
  --bs-table-hover-color: var(--rec-text);
  --bs-table-border-color: var(--rec-border);
  margin-bottom: 0;
}

.records-table thead th {
  background-color: var(--rec-surface-2);
  color: var(--rec-text);
  border-bottom: 2px solid var(--rec-accent);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.75rem;
}

.records-table tbody tr {
  border-left: 3px solid transparent;
  transition: border-color 0.1s ease;
}

.records-table tbody tr.table-active {
  --bs-table-active-bg: rgba(13, 202, 240, 0.18);
  --bs-table-active-color: var(--rec-text);
  border-left-color: var(--rec-accent);
}

.records-table tbody td {
  vertical-align: middle;
  border-color: var(--rec-border);
}

.matricula-cell {
  font-family: 'Matricula Espanola', monospace;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.matricula-display {
  font-family: 'Matricula Espanola', monospace;
  font-size: 2.4rem;
  letter-spacing: 0.1em;
  background-color: #fff;
  color: #000;
  border: 3px solid var(--rec-bg);
  border-radius: 6px;
  padding: 0.4rem 1.2rem;
  display: inline-block;
}

.field-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--rec-text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.field-value {
  font-size: 1rem;
  color: var(--rec-text);
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  background-color: var(--rec-surface-2);
  border-radius: 4px;
  border-left: 2px solid var(--rec-border);
  min-height: 2.1rem;
  word-break: break-all;
}

.records-app .pagination .page-link {
  background-color: var(--rec-surface-2);
  border-color: var(--rec-border);
  color: var(--rec-text);
}

.records-app .pagination .page-item.active .page-link {
  background-color: var(--rec-accent);
  border-color: var(--rec-accent);
  color: #000;
}

.records-app .pagination .page-item.disabled .page-link {
  background-color: var(--rec-bg);
  color: var(--rec-text-dim);
}

.records-modal .modal-content {
  background-color: var(--rec-bg, #1a1d24);
  color: var(--rec-text, #e8eaed);
  border: 1px solid var(--rec-border);
}

.records-modal .modal-header {
  border-bottom: 2px solid var(--rec-accent, #0dcaf0);
}

.records-modal .nav-tabs {
  border-bottom-color: var(--rec-border);
}

.records-modal .nav-tabs .nav-link {
  color: var(--rec-text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
}

.records-modal .nav-tabs .nav-link.active {
  color: var(--rec-accent, #0dcaf0);
  background: transparent;
  border-bottom-color: var(--rec-accent, #0dcaf0);
}

.records-modal .modal-footer {
  border-top-color: var(--rec-border);
}

.records-image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background-color: #000;
  border: 1px solid var(--rec-border, #2e333d);
  border-radius: 4px;
}

.records-app .btn-outline-info.active {
  background-color: var(--rec-accent, #0dcaf0);
  color: #000;
  border-color: var(--rec-accent, #0dcaf0);
}

/* Layout panel/tabla con orientación dinámica */
.records-layout {
  display: flex;
  min-height: 0;
  min-width: 0;
}

.records-layout-horizontal {
  flex-direction: row;
}

.records-layout-vertical {
  flex-direction: column;
}

.records-panel {
  flex-shrink: 0;
  min-height: 0;
  min-width: 0;
  background-color: var(--rec-bg, #1a1d24);
  border-right: 1px solid var(--rec-border, #2e333d);
}

.records-layout-horizontal > .records-panel {
  height: 100%;
}

.records-layout-vertical > .records-panel {
  width: 100%;
  border-right: none;
  border-bottom: 1px solid var(--rec-border, #2e333d);
}

.records-splitter {
  flex-shrink: 0;
  background-color: var(--rec-border, #2e333d);
  transition: background-color 0.15s ease;
  z-index: 5;
}

.records-splitter:hover,
.records-splitter:active {
  background-color: var(--rec-accent, #0dcaf0);
}

.splitter-horizontal {
  width: 6px;
  height: 100%;
  cursor: ew-resize;
}

.splitter-vertical {
  width: 100%;
  height: 6px;
  cursor: ns-resize;
}

.records-content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.records-images-panel {
  background-color: var(--rec-bg, #1a1d24);
}

/* Ajustes táctiles para 8" */
@media (max-width: 1024px) {
  .records-app .btn { min-height: 44px; }
  .records-app .btn-sm { min-height: 36px; }
  .records-app .form-control,
  .records-app .form-select,
  .records-app .input-group-text { min-height: 44px; font-size: 1rem; }
  .records-app .pagination .page-link { padding: .55rem .85rem; }
  .records-table tbody td { padding: 0.6rem 0.5rem; }
}

/* Mapa de noche: capas raster (OSM online u offline) oscurecidas. Las de satelite no
   llevan la clase. La capa vectorial cambia de estilo (mapTileLayers.js). */
html[data-modo="noche"] .mapa-noche {
  filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9);
}
