@media (max-height: 500px) {
  .modal-contenido {
    max-height: 90vh;
    overflow-y: auto;
  }
}

@font-face {
  font-family: 'Audiowide';
  src: url('/assets/fonts/Audiowide-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

  @media (max-width: 576px) {
    img[alt="buzzo.es"] {
      max-height: 20px !important;
    }
    #redfria-text {
      font-size: 1.2rem !important;
    }
  }

.contenidos{
  max-width:50em;
  margin:auto;
}

.contenidos .tituloempresa{
  display:block;
  margin:0.25em 0 0.5em 0;
  font-size:1em;
  font-family: 'PT Sans Narrow', sans-serif;
  font-weight: 400;
  background:rgba(255,255,255,0.75);
  padding:0.35em;
}

.contenidos .cabecera{
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.25em 0;
  background: rgba(255,255,255,0.75);
  padding: 0.35em;
}

.contenidos .cabecera img{
  width:6em;
  border:0px;
  display: flex;
  justify-content: center;
}

.contenidos .cabecera span{
  margin-top:0.75em;
  font-size:0.85em;
  font-family: 'PT Sans Narrow', sans-serif;
  font-weight: 400;
  color:#444444;
}
html, body {
  touch-action: manipulation;
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  overflow-x: hidden;
}
body {
  font-family: 'Segoe UI', sans-serif;
  background: #f8f9fa;
  padding: 30px;
  padding-bottom: 70px;
  background-image: url('../assets/fondo.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

h1 {
  color: #343a40;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  margin-top: 20px;
}

th, td {
  padding: 12px 16px;
  border: 1px solid #dee2e6;
}

th {
  background-color: #e9ecef;
  text-align: left;
}

a.boton {
  background: #007bff;
  color: white;
  padding: 6px 12px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
}

a.boton:hover {
  background: #0056b3;
}

.boton-icono {
  background: none;
  text-decoration: none; 
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 18px;
  color: #014c9b;
  transition: color 0.2s;
}

.boton-icono:hover {
  color: #0056b3;
}

.boton-icono.boton {
  color: #dc3545;
}

.boton-icono.boton:hover {
  color: #a71d2a;
}

.boton-icono i {
  pointer-events: none;
}

.boton-rojo {
  background: #dc3545;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.boton-rojo:hover {
  background: #a12633;
}

.boton-verde {
  background: #28a745;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.boton-verde:hover {
  background: #1b7330;
}

.boton-gris {
  background: #8d8d8d;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.boton-gris:hover {
  background: #595959;
}

.boton-orange {
  background-color: #ff8800;
  color: white;
}
.boton-orange:hover {
  background-color: #e66f00;
  color: yellow;
}

.controlador-activo {
  border: 3px solid red !important;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.icono-accion {
  font-size: 28px;
}

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  transform: scale(0.95);
  opacity: 0;
}
.modal.fade.show .modal-dialog {
  transform: scale(1);
  opacity: 1;
}

.fila-inactiva {
  color: gray;
  font-style: italic;
  opacity: 0.7;
}

.footer-fija {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: #f1f1f1;
  border-top: 1px solid #ccc;
  padding: 10px 20px;
  text-align: right;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-fija > div {
  flex: 1;
}

#boton-izquierda {
  display: flex;
  justify-content: flex-start;
}

#boton-derecha {
  display: flex;
  justify-content: flex-end;
}

#formulario {
  margin-top: 40px;
  padding: 20px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 500px;
  box-shadow: 0 0 6px rgba(0,0,0,0.05);
}

#formulario button.boton-verde {
  background-color: #28a745;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#formulario button.boton-verde:hover {
  background-color: #218838;
}

#formulario input[type="text"],
#formulario input[type="number"] {
  width: 90%;
  padding: 10px;
  font-size: 14px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  margin-bottom: 10px;
  background-color: white;
}

select.form-select {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}


#formFiltros {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

#formFiltros label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
  font-size: 14px;
}

#formFiltros input[type="datetime-local"],
#formFiltros input[type="checkbox"],
#formFiltros button {
  margin-top: 5px;
}

#soloAlertas {
  margin-left: 0;
}

#filtrosLectura {
  background: #ffffff;
  padding: 16px 20px;
  border: 1px solid #ddd;
  margin-bottom: 30px;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0,0,0,0.05);
}

#filtrosLectura label {
  margin-right: 20px;
  font-weight: 500;
}

#filtrosLectura input[type="datetime-local"] {
  padding: 6px 8px;
  margin-left: 5px;
  font-size: 14px;
}

#fichaTemperatura {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mensaje {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  font-weight: bold;
}

.mensaje.exito {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.mensaje.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

td.estado-ok {
  color: green;
  font-weight: bold;
}

td.estado-alerta {
  color: red;
  font-weight: bold;
}

#formFiltros label input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 6px;
}

#tituloEmpresa, #tituloSensor {
  font-weight: normal;
}

.nombre-empresa, .nombre-sensor {
  font-weight: bold;
  color: #003366;
}

.notificacion {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 14px 24px;
  border-radius: 6px;
  font-weight: bold;
  color: white;
  background-color: #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  opacity: 0.95;
  transition: all 0.5s ease;
}

.notificacion.exito {
  background-color: #28a745;
}

.notificacion.error {
  background-color: #dc3545;
}

.cabecera-principal {
  background: rgba(255, 255, 255, 0.9);
}

.cabecera-principal img {
  max-height: 60px;
}

.cabecera-principal .rounded-circle {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}


@keyframes fadeInOut {
  0% { opacity: 0; top: 0; }
  10% { opacity: 1; top: 20px; }
  90% { opacity: 1; top: 20px; }
  100% { opacity: 0; top: 0; }
}

/* Anula interferencias del modal anterior */
.modal.show {
  display: block !important;
}

.panel {
  background-color: white;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  box-shadow: none;
  margin-bottom: 6px;
  border-left: 4px solid transparent;
}

.sensor-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.sensor-info-card__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sensor-info-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(41, 110, 234, 0.12);
  color: #2a6eea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sensor-info-card__icon--sensor {
  background: rgba(255, 136, 0, 0.15);
  color: #ff8800;
}

.sensor-info-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sensor-info-card__name {
  font-weight: 700;
  font-size: 1rem;
  color: #0f1f3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sensor-info-card__location {
  font-size: 0.85rem;
  color: #5b6b82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sensor-info-card__controlador {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 26, 44, 0.08);
  color: #1b2a44;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.sensor-info-card__controlador i {
  color: #2a6eea;
}

.sensor-info-card__controlador.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

@media (max-width: 768px) {
  .sensor-info-card {
    flex-direction: column;
    align-items: stretch;
  }

  .sensor-info-card__left {
    width: 100%;
  }

  .sensor-info-card__name,
  .sensor-info-card__location {
    max-width: 100%;
  }

  .sensor-info-card__controlador {
    width: 100%;
    justify-content: center;
  }
}


#barraInferior {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  border-top: 1px solid #ccc;
  border-radius: 1rem 1rem 0 0;
}

.page-ocean {
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(120% 90% at 50% 120%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #7fd7f1 0%, #4fc1e3 38%, #2a9fcf 62%, #1b6fa3 100%);
  background-attachment: fixed;
}

.page-with-actions {
  padding-bottom: 110px;
  padding-top: 110px;
}

.page-with-actions .container {
  padding-bottom: 10px;
}

.page-compact .page-title,
.page-compact .page-subtitle {
  display: none;
}

.page-compact .page-title-block {
  margin-bottom: 0 !important;
}

.cabecera-modern {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 1030;
  background: #010000;
  padding: 8px 0 6px;
  border-radius: 12px;
  margin: 0;
  box-shadow: 0 12px 26px rgba(10, 24, 48, 0.28);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.cabecera-modern.is-scrolled {
  box-shadow: 0 16px 34px rgba(6, 15, 32, 0.38);
}

.cabecera-modern__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  margin-bottom: 1px;
}

.cabecera-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cabecera-home {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #eaf1ff;
  font-family: 'Audiowide', sans-serif;
  font-size: 1.1rem;
}

.cabecera-home__logo {
  width: 200px;
  height: auto;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  object-fit: contain;
}

@media (max-width: 768px) {
  .cabecera-home__logo {
    width: 130px;
  }
}

.cabecera-section {
  flex: 1;
  text-align: left;
  font-family: 'Audiowide', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin-left: 20px;
  margin-top: 5px;

  /* Degradado vertical */
  background: linear-gradient(
    to bottom,
    #bbeffc 0%,
    #3391e8 50%,
    #030000 100%
  );

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.cabecera-empresa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 10px;
  border-radius: 12px;
  color: #f0f4ff;
  font-size: 0.9rem;
  max-width: 220px;
}

.cabecera-empresa.is-hidden {
  display: none;
}

.cabecera-empresa__logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  padding: 2px;
}

.cabecera-empresa__logo.is-hidden {
  display: none;
}

.cabecera-empresa__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cabecera-fecha {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 4px 0 6px;
}

.cabecera-fecha.is-hidden {
  display: none;
}

.cabecera-fecha__display {
  min-width: 110px;
  text-align: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: #d7e6ff;
  color: #1c2b4a;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Audiowide', sans-serif;
  box-shadow: inset 0 0 0 1px rgba(17, 33, 67, 0.1);
  cursor: pointer;
}

.cabecera-fecha__side {
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cabecera-fecha .acciones-btn--nav {
  padding: 4px;
  border-radius: 999px;
}

.cabecera-version {
  position: absolute;
  right: 12px;
  bottom: 6px;
  font-size: 0.68rem;
  line-height: 1;
  color: rgba(234, 241, 255, 0.55);
  font-family: 'Audiowide', sans-serif;
  letter-spacing: 0.03em;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 768px) {
  .cabecera-section {
    display: none;
  }

  .cabecera-modern__inner {
    justify-content: space-between;
  }

  .cabecera-meta {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .cabecera-empresa {
    margin-top: 2px;
  }

  .cabecera-modern {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .page-with-actions {
    padding-top: 90px;
  }

  .cabecera-fecha__display {
    min-width: 90px;
    font-size: 0.78rem;
    padding: 4px 10px;
  }

  .cabecera-version {
    right: 10px;
    bottom: 5px;
    font-size: 0.58rem;
  }

.acciones-btn--nav span {
  display: none;
}

.acciones-btn--toggle .alertas-icon {
  color: #ffffff;
}

.acciones-btn--toggle.is-active .alertas-icon {
  color: #ff5b5b !important;
}
}

.page-lecturas.page-with-actions {
  padding-top: 150px;
}

.page-lecturas .cabecera-modern {
  padding-bottom: 4px;
}

.page-lecturas .cabecera-fecha {
  padding: 2px 0 4px;
}

.lecturas-layout {
  max-width: 100%;
}

@media (max-width: 768px) {
  .page-lecturas.page-with-actions {
    padding-top: 128px;
  }

  .page-lecturas .lecturas-layout {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .page-lecturas #contenidoLecturas {
    --bs-gutter-x: 0.75rem;
  }

  .page-lecturas #graficaLecturasContainer,
  .page-lecturas #fichaSensorContainer,
  .page-lecturas #graficaHumedadContainer,
  .page-lecturas #graficaBateriaContainer,
  .page-lecturas #detallesLecturasContainer {
    margin-bottom: 0.75rem !important;
  }

  .page-lecturas #graficoTemperaturas.panel,
  .page-lecturas #graficoHumedad.panel,
  .page-lecturas #graficoBateria.panel,
  .page-lecturas #fichaTemperatura {
    padding: 12px;
  }

  .cabecera-modern {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 18px 18px;
  }

  .acciones-bar {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
  }
}

@media (max-width: 768px) {
  .acciones-bar .acciones-btn[data-href="controladores.php"] {
    display: none;
  }

  .acciones-bar #toggleApagados {
    display: none;
  }
}

.modal {
  z-index: 5000;
}

.modal-backdrop {
  z-index: 4990;
}

.acciones-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1050;
  background: #1c2333;
  border-radius: 18px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.acciones-bar__left,
.acciones-bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acciones-bar__left {
  justify-content: flex-start;
}

.acciones-bar__right {
  justify-content: flex-end;
  margin-left: auto;
}

.acciones-btn {
  background: transparent;
  border: 0;
  color: #e9eef7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 12px;
  min-width: 72px;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

.acciones-btn i {
  font-size: 1.2rem;
}

.acciones-btn--sync {
  color: #4cc274;
}

.acciones-btn--add {
  color: #4ea1ff;
}

.acciones-btn--toggle {
  color: #cbd5f5;
}

.acciones-btn--alert {
  color: #ff4d4d;
}

.acciones-btn--alert.active {
  color: #fff;
  background-color: #ff4d4d;
  border-radius: 8px;
}

.acciones-btn--toggle.is-active {
  color: #ff5b5b !important;
}

.acciones-btn--alertas.is-alertas-active {
  color: #ff5b5b !important;
}

.acciones-btn--back {
  color: #aab4c6;
}

.acciones-btn--pdf {
  color: #4cc274;
}

.acciones-btn--nav {
  color: #cbd5f5;
}

.acciones-fecha__display {
  min-width: 110px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f6ff;
  color: #1c2b4a;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(17, 33, 67, 0.1);
  cursor: pointer;
}

@media (max-width: 768px) {
  .acciones-fecha__display {
    min-width: 90px;
    font-size: 0.78rem;
    padding: 6px 8px;
  }
}

 

.acciones-btn--add i,
.acciones-btn--sync i {
  color: inherit;
}

.acciones-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.acciones-btn:disabled {
  opacity: 0.6;
}

@media (min-width: 768px) {
  .page-with-actions {
    padding-bottom: 120px;
  }

  .acciones-bar {
    left: 24px;
    right: 24px;
    bottom: 20px;
    padding: 16px 20px;
    background: #151b2b;
    border-radius: 20px;
    justify-content: space-between;
  }

  .acciones-btn {
    flex-direction: column;
    background: transparent;
    color: #e9eef7;
    padding: 8px 10px;
    font-size: 0.9rem;
    gap: 6px;
    min-width: 72px;
    justify-content: center;
  }

  .acciones-btn i {
    font-size: 1.2rem;
  }

  .acciones-btn--add {
    color: #4ea1ff;
  }

  .acciones-btn--sync {
    color: #4cc274;
  }

  .acciones-btn--toggle {
    color: #cbd5f5;
  }

  .acciones-btn--back {
    color: #aab4c6;
  }

  .acciones-btn span {
    display: inline;
  }
}

.dashboard-card {
  border-radius: 18px;
  border: 0;
  box-shadow: 0 10px 20px rgba(10, 30, 60, 0.12);
}

.dashboard-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.dashboard-card-link:hover .dashboard-card {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(10, 30, 60, 0.16);
}

.dashboard-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.empresa-logo-chip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: auto;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.empresa-logo-chip--lg {
  width: 60px;
  height: 60px;
  border-width: 3px;
}

.empresa-logo-chip--sm {
  width: 26px;
  height: 26px;
  border-width: 2px;
}

.empresa-logo-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.dashboard-label {
  letter-spacing: 0.12em;
  color: #6b7aa8;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-count {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0;
  color: #13264f;
}

.dashboard-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  text-decoration: none;
}

.dashboard-icon--empresas {
  background: #4ea1ff;
}

.dashboard-icon--sensores {
  background: #f59f35;
}

.dashboard-icon--controladores {
  background: #6c7cff;
}

.dashboard-icon--informes {
  background: #4cc274;
}

.dashboard-icon--lecturas {
  background: #38bdf8;
}

.dashboard-icon--usuarios {
  background: #7c5cff;
}

.dashboard-cards > [class*="col"] {
  flex: 0 0 33.333%;
  max-width: 33.333%;
}

.usuarios-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(17, 33, 67, 0.12);
  margin-bottom: 18px;
}

.usuarios-search i {
  color: #6b7aa8;
}

.usuarios-search input {
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  font-size: 1rem;
}

.usuarios-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.usuario-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(16, 26, 44, 0.9);
  color: #eaf1ff;
  box-shadow: 0 10px 24px rgba(8, 16, 30, 0.2);
  gap: 12px;
}

.usuario-pill__info {
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.usuario-pill__nombre {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usuario-pill__email {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.usuario-pill__empresas {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  justify-content: flex-start;
  margin-right: auto;
  align-self: flex-start;
  width: 100%;
}

.usuario-pill__empresas .empresa-logo-chip {
  margin-left: 0;
}

.empresa-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #eaf1ff;
  font-size: 0.7rem;
  font-weight: 600;
}

.empresa-pill--all {
  background: rgba(124, 92, 255, 0.2);
  color: #c7bfff;
  padding: 0 10px;
}
.usuario-pill__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.usuario-pill__acciones {
  display: flex;
  gap: 6px;
}

.usuario-pill__acciones .btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .usuario-pill {
    flex-direction: column;
    align-items: stretch;
  }

  .usuario-pill__meta {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    order: 0;
    width: 100%;
  }

  .usuario-pill__acciones {
    order: 1;
    margin-left: 0;
  }

  .usuario-pill__info {
    order: 1;
    width: 100%;
    flex: 0 0 auto;
    overflow: visible;
  }

  .usuario-pill__acciones .btn {
    flex: 0 0 34px;
  }

  .usuario-pill__nombre,
  .usuario-pill__email {
    max-width: 100%;
  }

  .usuario-pill__email {
    max-width: 22ch;
  }
}

.usuario-badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.usuario-badge--admin {
  background: rgba(255, 90, 90, 0.18);
  color: #ff6b6b;
  border: 1px solid rgba(255, 90, 90, 0.4);
}

.usuario-badge--operador {
  background: rgba(76, 204, 116, 0.18);
  color: #4cc274;
  border: 1px solid rgba(76, 204, 116, 0.4);
}

.usuarios-permisos {
  background: #f7f9ff;
  border-radius: 16px;
  padding: 12px 14px;
}

.usuarios-empresas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.usuarios-empresas.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.empresa-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 4px 10px rgba(17, 33, 67, 0.08);
  font-size: 0.9rem;
}

.empresa-toggle input {
  transform: scale(1.1);
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #1c2b4a;
}

.toggle-pill input {
  display: none;
}

.toggle-pill__slider {
  width: 44px;
  height: 24px;
  background: #cbd5f5;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-pill__slider::after {
  content: '';
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.toggle-pill input:checked + .toggle-pill__slider {
  background: #4ea1ff;
}

.toggle-pill input:checked + .toggle-pill__slider::after {
  transform: translateX(20px);
}

.toggle-pill__label {
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .dashboard-cards > [class*="col"] {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }

  .dashboard-label {
    max-width: 12ch;
    letter-spacing: 0.08em;
  }

  .dashboard-desc {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .dashboard-cards > [class*="col"] {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

.dashboard-chart {
  position: relative;
  padding: 12px 8px 0;
}

.dashboard-chart__apex {
  min-height: 220px;
}

.dashboard-chart__svg {
  width: 100%;
  height: 140px;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke-width: 2.4;
  opacity: 0.9;
}

.chart-line--empresas {
  stroke: #4ea1ff;
}

.chart-line--sensores {
  stroke: #f59f35;
}

.chart-line--controladores {
  stroke: #6c7cff;
}

.chart-line--informes {
  stroke: #4cc274;
}

.dashboard-chart__labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #6b7aa8;
  text-align: center;
}

.dashboard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.75rem;
  color: #6b7aa8;
}

.legend-item {
  position: relative;
  padding-left: 14px;
}

.legend-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.legend-empresas::before {
  background: #4ea1ff;
}

.legend-sensores::before {
  background: #f59f35;
}

.legend-controladores::before {
  background: #6c7cff;
}

.legend-informes::before {
  background: #4cc274;
}


#contenidoLecturas > .col-12 {
  display: flex;
  flex-direction: column;
}

.panel {
  flex: 1 1 auto;
  width: 100%;
}

.fecha-actual {
  font-family: 'Audiowide', cursive;
  color: white; 
  background-color: #0d6dfc;
  box-shadow: 0 4px 8px rgba(0, 51, 102, 0.3); /* sombra personalizada */
  padding: 0.6rem;
  border-radius: 18px;
}

#fechaActual {
  cursor: pointer;
  transition: background 0.2s ease;
}

#fechaActual:hover {
  background-color: #0950ba;
}



.lectura-card {
  font-size: 0.95rem;
}

.lectura-card .temperatura {
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
}

.lectura-card .bateria {
  font-size: 0.9rem;
  color: #666;
}

.lectura-card .estado i {
  font-size: 1.2rem;
}

.ficha-temperatura {
  border-left: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card {
  border-radius: 1rem !important;
}

.card-body{
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border-radius: 1rem !important;
}
/* Colores por estado */
.texto-frio {
  border-color: purple;
  color: purple;
}
.texto-calor {
  border-color: #e74c3c;
  color: #e74c3c;
}
.texto-correcto {
  border-color: #1a8754;
  color: #1a8754;
}

/* Colores por estado */
.texto-frio-visor {
  border-color: rgb(252, 118, 252);
  color: rgb(252, 118, 252);
}
.texto-calor-visor {
  border-color: #ff7777;
  color:  #ff7777;
}
.texto-correcto-visor {
  border-color: #79ffc0;
  color: #79ffc0;
}
.texto-azul-suave-visor {
  color: #66ccff !important; 
}

#modalConfirmacion {
  z-index: 5000 !important;
}

.lectura-card.swipeable {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lectura-card .delete-overlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background-color: #dc3545;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  z-index: 1;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lectura-card.swiping:not(.editando) .delete-overlay {
  visibility: visible;
  opacity: 1;
}

.lectura-card .delete-overlay i {
  pointer-events: none;
}

.lectura-card .edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 100%;
  background-color: #0d6efd; /* azul Bootstrap */
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  z-index: 1;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lectura-card.swiping.editando .edit-overlay {
  visibility: visible;
  opacity: 1;
}

.lectura-card .edit-overlay i {
  pointer-events: none;
}

.lectura-card .content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: background 0.3s ease;
  padding: 0.75rem 1rem;
}

.parte-estatica {
  flex-shrink: 0;
  min-width: 120px;
}

.lectura-card .parte-desplazable {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none; /* <- Importante: no intercepta clics normalmente */
  transition: transform 0.2s ease;
}

.lectura-card.swiping .parte-desplazable {
  pointer-events: auto; /* <- Solo durante el swipe, acepta eventos */
}
.lectura-card .estado-fijo {
  z-index: 3;
  position: relative;
}

.parte-desplazable {
  will-change: transform;
  transition: transform 0.2s ease;
}
  
.oculto-important {
  display: none !important;
}

button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.rssi-excelente { color: #28a745; }   /* Verde */
.rssi-buena     { color: #ffc107; }   /* Amarillo */
.rssi-regular   { color: #fd7e14; }   /* Naranja */
.rssi-mala      { color: #dc4b35; }   /* Rojo claro */
.rssi-muy-mala  { color: #ff0019; }   /* Rojo oscuro */

.rssi-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: monospace;
  line-height: 1;
}

.rssi-bars span {
  font-size: 1.2rem;
  display: inline-block;
  line-height: 1;
  margin: 0 1px;
}

.rssi-dbm {
  font-size: 0.75rem;
  margin-top: 2px;
}

.rssi-bars span.text-muted {
  color: #666 !important; /* o el gris que prefieras */
}

.battery-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: monospace;
  line-height: 1;
}

.battery-icon i {
  font-size: 1.2rem;
}

.battery-value {
  font-size: 0.75rem;
  margin-top: 2px;
}

.ficha-sensor-row {
  width: 100%;
  background-color: #2c2c2c;
  margin-bottom: 1rem;
  border-radius: 0.5rem; 
  padding: 0.5rem;
}

.ficha-sensor-datos {
  flex: 1 1 60%;
  min-width: 0;
}

.ficha-sensor-estado {
  flex: 0 0 auto;
  min-width: 90px;
}

.ficha-separador {
  margin-top: -1rem;
}

#contenidoLog {
  user-select: text !important;
}
