body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f2f5;
  margin: 0;
}

h1 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5em;
  color: #333;
}

/* Contenedor de los botones de vista */
.controls-display {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* Nuevas reglas para el menú horizontal */
.sidebar-menu {
  display: flex;
  flex-direction: row; /* Cambio para alinear horizontalmente */
  flex-wrap: wrap; /* Permite que los elementos se envuelvan si es necesario */
  justify-content: center; /* Centra los elementos horizontalmente */
  padding: 10px 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  gap: 10px;
  max-width: 90%;
}

.sidebar-menu a {
  text-decoration: none;
  color: #007bff;
  padding: 10px;
  border-radius: 5px;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background-color: #007bff;
  color: white;
}

/* El main-content-wrapper ya no tiene la barra lateral como hijo directo */
.main-content-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.system-group.matrix-view {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  width: 100%;
}

.system-group.sidebar-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.system-container {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 300px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0 auto;
}

.system-container h2 {
  margin-top: 0;
  color: #007bff;
}

.tank-container {
  position: relative;
  width: 80px;
  height: 200px;
  border: 2px solid #333;
  display: flex;
  flex-direction: column-reverse;
  margin: 20px auto;
}

.tank-level {
  width: 100%;
  background-color: #00b3ff;
  transition: height 0.5s ease-in-out;
}

.level-indicator {
  font-weight: bold;
  position: absolute;
  top: -40px; /* Ajustado para un mejor espaciado */
  left: 50%;
  transform: translateX(-50%);
  color: #333;
  font-weight: bold;
  white-space: nowrap;
  z-index: 10;
}

.level-indicator span {
  color: #333;
  font-size: 1.1em;
}

.pump-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    font-weight: bold;
    font-size: 1.2em;
}

.pump-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: gray;
  margin-right: 10px;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.motor-speed, .number-indicator {
  font-size: 1.2em;
  font-weight: bold;
  margin: 10px 0;
  color: #333;
}

.controls {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 5px 0;
  margin-top: 20px;

}

.btn-start {
  background-color: #28a745;
  color: white;
}
.btn-stop {
  background-color: #dc3545;
  color: white;
}
.btn-reset {
  background-color: #ffc107;
  color: #212529;
}
.btn-view {
  background-color: #6c757d;
  color: white;
}

.btn-view.active {
  background-color: #007bff;
}

.btn-start:hover { background-color: #218838; }
.btn-stop:hover { background-color: #c82333; }
.btn-reset:hover { background-color: #e0a800; }
.btn-view:hover { background-color: #5a6268; }

.config-link {
  text-decoration: none;
  color: #007bff;
  font-weight: bold;
  margin-left: auto;
  align-self: center;
}

.config-link:hover {
  text-decoration: underline;
}

.message-log {
  margin-top: 20px;
  padding: 10px;
  background-color: #e9e9e9;
  border-radius: 5px;
  text-align: left;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.9em;
  border: 1px solid #ccc;
}

/* Nuevos estilos para el login y logout */
.btn-login {
  background-color: #28a745;
  color: white;
}
.btn-logout {
  background-color: #007bff;
  color: white;
}

.footer-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

#user-status-container {
  margin-left: 20px;
  font-weight: bold;
  color: #555;
}

/* Estilos del Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  text-align: center;
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.error-message {
  color: #dc3545;
  font-weight: bold;
  margin-top: 10px;
}

/* Gauge Styles */
.gauge-container {
    position: relative;
    width: 150px;
    height: 100px;
    margin: 20px auto;
}

.gauge-dial {
    width: 150px;
    height: 75px;
    background: #e0e0e0;
    border-radius: 150px 150px 0 0;
    position: relative;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.gauge-fill {
    width: 150px;
    height: 150px;
    border-radius: 0%;
    position: absolute;
    top: 75px;
    left: 0;
    transform-origin: 50% 0%;
    transition: transform 0.5s ease-in-out;
    background-color: var(--gauge-color);
}

.gauge-center {
  display: none;
}

.gauge-label {
    position: absolute;
    bottom: -15px;
    width: 100%;
    text-align: center;
    font-weight: bold;
    color: #555;
}

.gauge-value {
    position: absolute;
    bottom: -35px;
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
    /*margin: -10px auto;*/
}