@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
}

a {
  text-decoration: none;
  /* font-size: .9rem !important; */
}

.formulario {
  padding: 1rem 2rem 2rem 2rem;
  border-radius: 11px;
  box-shadow: 0 2px 8px rgb(11 63 96 / 0.15);
}

.login {
  width: 35vw;
  min-width: 500px;
  animation-name: login;
  animation-duration: 500ms;
  backdrop-filter: blur(5px);
}

@keyframes login {
  from {
    opacity: 0;
    transform: translateY(200px);
  }

  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

.login > .form-row > input {
  height: 3rem;
}

.login > .form-row > label {
  font-weight: 300;
}

.login > button {
  height: 3rem;
  width: 45%;
  margin-top: 2rem;
}

#contenedor {
  background-color: #e7ebf0;
  min-height: 100vh;
  display: flex;
}

#menu {
  width: 350px;
  min-width: 350px;
  min-height: 100%;
  background-color: #0b3f60;
  display: flex;
  justify-content: center;
  flex-direction: column;
  position: sticky;
  left: 0;
  top: 0;
  max-height: 100vh;
  box-shadow: 0 2px 8px rgb(11 63 96 / 0.15);
  z-index: 100;
  /* transition: .2s ease all; */
  /* row-gap: 2rem; */
}

#logo > img {
  width: 300px;
  position: absolute;
  top: 5rem;
  left: 20px;
}

#avatar {
  width: 50%;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.5rem;
  background: #072f49;
  box-shadow: 0 2px 8px rgb(11 63 96 / 0.15);
}

#usuarios {
  flex-direction: column;
}

#usuario {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 500;
}

#perfil {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 300;
}

#cargo {
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
}

.boton-menu {
  color: #ffffff;
  column-gap: 1rem;
  height: 4rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  padding: 0px 2rem;
  text-decoration: none;
      justify-content: flex-start !important;
}

.boton-menu:hover {
  background-color: #ffffff;
  cursor: pointer;
  color: #0b3f60;
}

.activo {
  background-color: #165075;
  cursor: pointer;
  color: #ffffff;
}

#content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(100vw - 350px);
  padding: 3rem;
}

.titulo {
  margin-bottom: 3rem;
  color: #0b3f60;
  font-size: 2.5rem;
  font-weight: 300;
}

.subtitulo {
  color: #0b3f60;
  font-weight: 500;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

#materialChart {
  max-width: 100%;
  height: auto;
}

#materiales,
#calibraciones,
#usuarios,
#crianza,
#componentes {
  display: flex;
  column-gap: 2rem;
  row-gap: 4rem;
}

.add-grafico {
  row-gap: 2rem;
  display: flex;
  flex-direction: column;
}

/* PAGINACION */
form .form-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex: 1;
}

form .form-row label {
  /* ancho fijo para alinear */
  font-weight: 400;
  color: #0b3f60;
  flex: 1;
}

form .form-row input,
form .form-row select {
  flex: 2;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

input:focus-visible,
select:focus-visible {
  outline-color: #0b3f60;
}

button > i,
.link-boton > i {
  margin-right: 0.5rem;
}

button,
.link-boton {
  background-color: #0b3f60;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
  font-size: 0.8rem;
  width: max-content;
  font-weight: 300;
}

form button:hover {
  background-color: #074054;
}

.button-table {
  width: max-content;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #0b3f60;
  background-color: #f9f9f9;
  box-shadow: 0 2px 8px rgb(11 63 96 / 0.15);
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background-color: #0b3f60;
  color: #ffffff;
}

thead th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.03em;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #ddd;
}

tbody tr:nth-child(even) {
  background-color: #e6f0f8;
}

tbody tr:hover {
  background-color: #c8dcea;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.pagination {
  margin-top: 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.pagination a {
  padding: 6px 12px;
  text-decoration: none;
  color: #0b3f60;
  border: 1px solid #0b3f60;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a:hover {
  background-color: #0b3f60;
  color: white;
}

.pagination strong {
  padding: 6px 12px;
  border-radius: 4px;
  background-color: #0b3f60;
  color: white;
  border: 1px solid #0b3f60;
}

/* //////////////////////////////// */

@keyframes girar {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.engranaje {
  display: inline-block;
  margin-left: 0.5rem;
  animation: girar 3s linear infinite;
  vertical-align: middle;
  width: 18px;
  height: 18px;
}

.subt-cards {
  width: 100%;
  margin-bottom: 2rem;
  font-weight: 400;
  color: #0b3f60;
  border-bottom: 2px #0b3f60 solid;
  padding-bottom: 1.5rem;
}

.fade-in {
  animation: fadeIn 0.8s ease-in;
}

.modal-titulo {
  width: 100%;
  margin-bottom: 1rem;
  font-weight: 400;
  color: #0b3f60;
  border-bottom: 2px #0b3f60 solid;
  padding-bottom: 0.5rem;
}

.form-row-group {
  display: flex;
  gap: 2rem;
  /* margin-bottom: 1rem; */
}

.form-row-group > .form-row > input,
.form-row-group > .form-row > select,
.form-row-group > .form-row > label {
  width: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background-color: #0b3f60;
  color: #fff;
  padding: 12px 18px;
  margin-bottom: 10px;
  border-radius: 5px;
  opacity: 0.95;
  animation: fadein 0.5s, fadeout 0.5s 3.5s;
  transition: opacity 0.3s ease-in-out;
  min-width: 200px;
}

/* Puedes personalizar colores según el tipo de mensaje */
.toast-success {
  background-color: #28a745;
}

.toast-error {
  background-color: #dc3545;
}

.toast-warning {
  background-color: #ffc107;
  color: #000;
}

.toast-info {
  background-color: #17a2b8;
}

.filtros-materiales {
  flex: 1;
  display: flex;
  align-items: center;
  column-gap: 0.5rem;
}

.boton-menu.menu-min {
  white-space: nowrap;
  overflow: hidden;
}

.boton-menu.menu-min i {
  margin-right: 0;
}

.boton-menu.menu-min::after {
  content: none;
}

#toggle-menu {
  position: absolute;
  bottom: 2rem;
  font-size: 1.2rem;
  left: 1rem;
}

#toggle-menu i {
  margin-right: 0;
}

.boton-menu-min span {
  opacity: 0;
  visibility: hidden;
}

.boton-menu-min i {
  font-size: 1.5rem;
}

.menu-min {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
}
.avatar-min {
  width: 164% !important;
  min-width: 164% !important;
  max-width: 164% !important;
  outline: 14px #0b3f60 solid;
  margin-left: -13px;
  transition: transform 0.2s ease;
}

.avatar-min:hover {
  transform: scale(1.2);
  transition: transform 0.2s ease;
}

.logo-min {
  width: 3rem !important;
}

.content-min {
  width: calc(100vw - 90px) !important;
}

.pendiente {
  position: absolute;
  right: -0.5rem;
  top: -0.5rem;
  padding: 0.26rem;
  outline: 1px #ff0000 solid;
  border-radius: 50%;
  height: 2.5rem;
  width: 2.5rem;
  text-align: center;
}

.pendiente i {
  font-size: 2rem;
  color: red;
}

.crianza {
  position: absolute;
  right: 0.5rem;
  top: -0.5rem;
  font-size: 5.5rem;
  font-weight: 500;
  opacity: 0.3;
}

/* Animaciones */
@keyframes fadein {
  from {
    opacity: 0;
    right: 0px;
  }

  to {
    opacity: 0.95;
    right: 20px;
  }
}

@keyframes fadeout {
  from {
    opacity: 0.95;
    right: 20px;
  }

  to {
    opacity: 0;
    right: 0px;
  }
}

.boton-menu.boton-menu-min {
  position: relative;
  justify-content: center !important;
}

/* Tooltip oculto por defecto */
.boton-menu.boton-menu-min span {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(-10px);
  background-color: #0b3f60;
  color: #fff;
  white-space: nowrap;
  padding: 5px 15px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  height: 4rem;
  width: fit-content;
  justify-content: center;
}

/* Mostrar tooltip al hacer hover */
.boton-menu.boton-menu-min:hover span {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
  z-index: 10;
}

.switch input[type="checkbox"] {
    display: none;
}

/* Estilo del contenedor */
.switch-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding-left: 50px; /* espacio para el slider */
    font-size: 14px;
    user-select: none;
}

/* Slider del switch */
.switch-label .slider {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: background-color 0.3s;
}

/* Círculo dentro del slider */
.switch-label .slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

/* Estado activo */
.switch input[type="checkbox"]:checked + .switch-label .slider {
    background-color: #072f49; /* verde */
}

.switch input[type="checkbox"]:checked + .switch-label .slider::before {
    transform: translateX(20px);
}

.motivo-trabajo{
      font-size: 1rem;
    left: 1rem;
    bottom: .5rem;
    top: auto;
    opacity: 0.7;
}

.trabajo{
  background-color: #ff7300 !important;
}

@media (max-width: 1500px) {
  .filtros-materiales {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .filtros-materiales > select {
    width: 100% !important;
  }

  th,
  td {
    font-size: 0.9rem;
    padding: 7px 5px !important;
  }

  #content {
    width: calc(100vw - 200px);
    padding: 2rem;
  }

  #menu {
    width: 250px;
    min-width: 250px;
  }

  #logo > img {
    width: 150px;
  }
}

@media (max-width: 1200px) {
  #materiales,
  #calibraciones,
  #usuarios,
  #crianza,
  #componentes {
    flex-direction: column;
  }

  .filter-materiales {
    width: 100%;
    flex-direction: column;
    align-items: normal !important;
  }

  .button-table {
    width: -webkit-fill-available;
  }

  .button-table > i {
    margin-right: 0px;
  }

  .btn-table-text {
    display: none;
  }

  /* #tabla-usuarios > thead> tr>th:nth-child(1), 
    #tabla-usuarios > tbody> tr>td:nth-child(1),  */
  #tabla-usuarios > thead> tr>th:nth-child(3), 
    #tabla-usuarios > tbody> tr>td:nth-child(3), 
    /* #tabla-usuarios > thead> tr>th:nth-child(4), 
    #tabla-usuarios > tbody> tr>td:nth-child(4), 
    #tabla-usuarios > thead> tr>th:nth-child(7), 
    #tabla-usuarios > tbody> tr>td:nth-child(7),  */
    #tabla-usuarios > thead> tr>th:nth-child(8), 
    #tabla-usuarios > tbody> tr>td:nth-child(8) {
    display: none;
  }
}

@media (max-width: 768px) {
  th,
  td {
    font-size: 0.7rem;
    padding: 5px !important;
  }

  #contenedor {
    flex-direction: column;

  }

  #menu {
    width: 3rem !important;
    height: 23.5rem !important;
    max-height: 4rem !important;
    min-height: 23.5rem;
    position: fixed;
    z-index: 100;
    min-width: 3rem !important;
    top: calc(100vh - 28rem);
    align-items: center;
    opacity: 0.5;
    right: 0;
    left: inherit;
    border-top-left-radius: 1.5rem;
    border-bottom-left-radius: 1.5rem;
    justify-content: flex-start;
    padding-top: 1.4rem;
  }

  .boton-menu span {
    display: none;
  }

  #user-info {
    display: none;
  }

  #toggle-menu {
    /* bottom: 6rem; */
    display: none;
  }

  .boton-menu {
    width: 2.5rem;
    padding: 0;
    justify-content: center !important;
    height: 3rem;
  }


  .boton-menu.boton-menu-min:hover span {
    display: none;
  }
  #content {
    width: 100% !important;
    padding: 1rem;
        margin-bottom: 6rem;
  }

  #logo {
    text-align: center;
  }

  #logo > img {
        display: none;
    
  }

  #avatar {
    width: 60px;
  }

  #user-info {
    padding-bottom: 0px;
  }



  .titulo {
    margin: 1rem 0px;
    font-size: 2rem;
    width: 100%;
    text-align: center;
  }

  .add-grafico {
    order: 1;
  }

  .add-grafico > .formulario {
    order: 1;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row > label {
    font-size: 0.8rem;
    width: 100%;
  }

  form .form-row input,
  form .form-row select {
    width: 100%;
  }

  .login {
    min-width: 360px;
  }
}
