/*------------------------*/
/* VARIABLES */
/*------------------------*/

:root {
  --background: #fff;
  --background-content: #222;
  --color-text: #fff;
  --color-text-light: #eee;

  --primary-color: #fe0000;
  --primary-color-light: #ec4e5e;
  --secundary-color: #fe0000;
  --secundary-color-dark: #313131;

  --light-gray-color: #e15f34c0;

  --red: #b23a48;
  --light-red: #f3b1b9;

  --shadow-medium: 0px 4px 5px rgba(65, 65, 65, 0.05);
  --shadow-large: 0px 20px 25px -5px rgba(49, 49, 49, 0.1);
}

/*------------------------*/
/* RESET */
/*------------------------*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
  font-family: inherit;
}

body {
  font-family: 'Open Sans', sans-serif;
  background-color: var(--background);
  color: var(--color-text);
}

img {
  display: block;
  max-width: 100%;
   border-radius: 10px;
}

a {
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/*-------------------------*/
/* GENERAL Y REUTILIZABLES */
/*-------------------------*/

.h1 {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
}

.h2 {
  margin-bottom: 2rem;
  color: #fe0000;
}

.h3 {
  margin-bottom: 2rem;
}

.container {
  margin-top: 5rem;
  margin-left: 18rem;
  padding: 2rem 1rem;
  /* background-color: cadetblue; */
  transition: margin-left 0.3s;
}

.container.collapse {
  margin-left: 6.5rem;
}

.mb-medium {
  margin-bottom: 3rem;
}

/* Botones */

.btn,
.btn:link,
.btn:visited {
  display: inline-block;
  padding: 0.8rem 1rem;
  font-size: inherit;
  font-weight: 600;
  color: inherit;
  background-color: #484646;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: color, background-color 0.3s;
}

.btn--primary,
.btn--primary:link,
.btn--primary:visited {
  background-color: var(--primary-color);
  color: var(--color-text-light);
}

.btn--primary:hover,
.btn--primary:active {
  background-color: var(--primary-color-light);
}

.btn--secundary:hover,
.btn--secundary:active {
  color: var(--secundary-color);
}

.btn--success,
.btn--success:link,
.btn--success:visited {
  background-color: #00bd00;
  color: var(--color-text-light);
}

.btn--success:hover,
.btn--success:active {
  background-color: #00bd00;
}


.btn--small,
.btn--small:link,
.btn--small:visited {
  padding: 0.4rem 0.5rem;
  font-size: 1.1rem;
  line-height: 0;
}

.btn--medium,
.btn--medium:link,
.btn--medium:visited {
  padding: 0.7rem 1rem;
  font-size: 15px;
}

.btn--ver:link,
.btn--ver:visited {
  color: cyan;
  background-color: transparent;
  border: 1px solid var(--secundary-color);
}

.btn--ver:hover,
.btn--ver:active {
  background-color: var(--secundary-color);
  color: var(--color-text-light);
}

.btn--calculos:link,
.btn--calculos:visited {
  color: rgb(9, 233, 9);
  background-color: transparent;
  border: 1px solid var(--secundary-color);
}

.btn--calculos:hover,
.btn--calculos:active {
  background-color: var(--secundary-color);
  color: var(--color-text-light);
}

.btn--edit:link,
.btn--edit:visited {
  color: yellow;
  background-color: transparent;
  border: 1px solid var(--secundary-color);
}

.btn--edit:hover,
.btn--edit:active {
  background-color: var(--secundary-color);
  color: var(--color-text-light);
}

.btn--delete:link,
.btn--delete:visited {
  color: var(--red);
  background-color: transparent;
  border: 1px solid var(--red);
}

.btn--delete:hover,
.btn--delete:active {
  background-color: var(--red);
  color: var(--color-text-light);
}

.btn--disabled:link,
.btn--disabled:visited {
  pointer-events: none;
  cursor: default;
  opacity: 20%;
}

/* Tarjetas de información */

.card {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background-color: var(--background-content);
  border: 1px solid var(--light-gray-color);
  border-radius: 4px;
  box-shadow: var(--shadow-medium);
}

.card__icon-box {
  display: flex;
  padding: 1rem;
  background-color: var(--primary-color);
  font-size: 2rem;
  border-radius: 4px;
}

.card__icon {
  line-height: 0;
  color: var(--color-text-light);
}

.card__content {
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: space-between;
}

.card__title {
  line-height: 1.1;
}

.card__number {
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--secundary-color);
}

/* Mensajes */

.message {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  font-size: 15px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid;
}

.message.close {
  display: none;
}

.message__close {
  font-size: 1.3rem;
  line-height: 0;
  cursor: pointer;
}

.message--error {
  color: var(--red);
  background-color: var(--light-red);
  border-color: var(--red);
}

/* Botones de acciones */

.actions {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* Tablas */

.table-container {
  overflow-x: auto;
  border-radius: 11px;
  box-shadow: var(--shadow-medium);
}

.table {
  width: 100%;
  min-width: 1028px;
}

.table--small {
  width: 100%;
  min-width: auto;
}

.table__head {
  font-size: 15px;
}

.table__head-item {
  padding: 12px 10px;
  background-color: var(--background-content);
}

.table__head-item {
  font-weight: 600;
}

.table__row:nth-child(even) {
  background-color: var(--background-content);
}

.table__row:nth-child(odd) {
  background-color: #5a5959;
}

.table__item {
  padding: 0px 0px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.table__head-item:nth-child(0),
.table__item:nth-child(0) {
  position: sticky;
  left: 0;
  z-index: 10;
}

.table__item:nth-child(2) {
  background-color: inherit;
}

.td-max-w-s {
  max-width: 15ch;
}

.td-max-w-m {
  max-width: 26ch;
}

.table__item span {
  color: #fe0000;
  font-style: italic;
}

/* Formularios */

.form {
  padding: 2rem;
  background-color: var(--background-content);
  border-radius: 4px;
  box-shadow: var(--shadow-medium);
}

.form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  column-gap: 2rem;
}

.field__label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.field__label span,
.form__legend span {
  color: var(--red);
  font-weight: 600;
}

.field__input {
  display: block;
  width: 100%;
  margin-bottom: 2rem;
  padding: 0.6rem 1rem;
  font-size: inherit;
  border: 1px solid var(--light-gray-color);
  border-radius: 4px;
  outline-color: rgba(11, 84, 99, 0.5);
  transition: outline-offset 0.3s;
}

.field__input--textarea {
  min-height: 43.19px;
  height: 43.19px;
  resize: vertical;
}

.form__legend {
  margin-bottom: 2rem;
  font-size: 14px;
}

.form__submit {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Ventanas modales */

.modal.close {
  display: none;
}

.modal__background {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 25;

  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal__content {
  position: absolute;
  top: 2rem;
  left: 50%;
  z-index: 30;
  max-width: 555px;
  transform: translateX(-50%);

  padding: 2rem 3rem;
  background-color: var(--background-content);
  border-radius: 4px;
  box-shadow: var(--shadow-large);
}

.modal__close-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;

  background-color: transparent;
  border: none;
  cursor: pointer;
}

.modal__close-icon {
  font-size: 1.8rem;
}

.modal__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal__icon {
  font-size: 1.9rem;
}

.modal__icon--success {
  color: var(--secundary-color);
}

.modal__icon--warning {
  color: #cfa52f;
}

.modal__icon--error {
  color: var(--red);
}

.modal__text {
  margin-bottom: 1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}

.modal__buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Pills */

.pill {
  max-width: 7rem;
  margin: 0 auto;
  background: var(--background);
  border-radius: 1rem;
  padding: 3px 0.5rem;
  font-weight: 600;
}

.pill.pendiente {
  background-color: #e9d292;
  color: #544008;
}

.pill.cancelada,
.pill.cancelado,
.pill.inactivo {
  background-color: var(--light-red);
  color: var(--red);
}

.pill.enviado,
.pill.enviada,
.pill.pagada,
.pill.completada,
.pill.activo,
.pill.instalada {
  /* background-color: #a6f3c3; */
  background-color: rgb(0, 235, 118);
  color: var(--green);
}

.pill.pagado,
.pill.proceso {
  background-color: #b1c9ee;
  color: #124796;
}

/*------------------------*/
/* HEADER */
/*------------------------*/

.header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem;
  background-color: var(--background-content);
}

.header__title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  color: var(--color-text);
}

.header__logo {
  height: 3rem;
}

.h1-text-green {
  color: var(--secundary-color);
}

.header__btn-menu {
  display: flex;
  align-items: center;
  margin-right: 1rem;
  background-color: var(--light-gray-color);
  border-radius: 4px;
  cursor: pointer;
}

.header__btn-menu-icon {
  font-size: 1.8rem;
  line-height: 0;
  transition: color 0.3s;
}

.header__btn-menu:hover .header__btn-menu-icon {
  color: var(--secundary-color-dark);
}

.header__navbar {
  margin-left: auto;
}

.menu {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 0.6rem;
}

.menu__item {
  position: relative;
}

.menu__link:link,
.menu__link:visited {
  padding: 0.8rem 1rem;
  font-weight: 600;
  color: inherit;
  transition: color, background-color 0.3s;
}

.menu__link:hover,
.menu__link:active {
  color: var(--primary-color);
  background-color: var(--background);
  border-radius: 4px;
}

.header__toggle {
  font-size: 2.2rem;
  line-height: 0;
  color: var(--primary-color);
  display: none;
  cursor: pointer;
}

/* Icono de perfil */

.header__profile {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.header__profile:hover {
  background-color: var(--light-gray-color);
  color: var(--primary-color);
}

.header__user-icon {
  font-size: 1.8rem;
  margin-right: 4px;
  color: var(--secundary-color);
}

.header__user {
  margin-right: 2px;
}

.header__arrow-down {
  font-size: 12px;
  line-height: 0;
}

/* Submenu */

.header__submenu {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: max-content;
  background-color: var(--background-content);
  border-radius: 4px;
  border: 1px solid var(--light-gray-color);
  box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.14);
  transform: translateY(50%);
}

.header__submenu.active {
  display: block;
}

.menu__sublink:link,
.menu__sublink:visited {
  display: flex;
  align-items: center;
  padding: 1.4rem 1.3rem;
  gap: 0.5rem;
  width: 100%;
  font-weight: 500;
  line-height: 0;
  color: var(--primary-color);
  transition: color 0.3s;
}

.menu__sublink:hover,
.menu__sublink:active {
  color: var(--secundary-color);
}

.menu__subitem:first-child .menu__sublink,
.menu__subitem:first-child .menu__sublink {
  padding-bottom: 0;
}

/*------------------------*/
/* ASIDE */
/*------------------------*/

.aside {
  position: fixed;
  top: 5rem;
  width: 18rem;
  z-index: 20;
  height: calc(100vh - 5rem);
  padding: 1rem;
  transition: width 0.3s;
  overflow: hidden;
}

.aside-navbar {
  height: 100%;
  padding: 1.5rem 0;
  background-color: var(--primary-color);
  border-radius: 5px;
  overflow: auto;
}

.aside-navbar__link:link,
.aside-navbar__link:visited {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 14px 1.5rem;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-light);
  /* background-color: var(--secundary-color); */
  transition: background-color 0.3s;
}

.aside-navbar__link:hover,
.aside-navbar__link:active {
  background-color: var(--secundary-color-dark);
}

.aside-navbar__icon {
  font-size: 1.2rem;
}

/* Funcionalidad para colapsar el menú lateral */

.aside.collapse {
  width: 6.5rem;
}

.aside.collapse .aside-navbar__link-text {
  display: none;
}

.aside.collapse .aside-navbar__icon {
  font-size: 1.5rem;
}

.aside.collapse .aside-navbar__link:link,
.aside.collapse .aside-navbar__link:visited {
  justify-content: center;
}

/*------------------------*/
/* LOGIN */
/*------------------------*/

.login-container {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.login {
  max-width: 25rem;
  width: 100%;
  margin-top: 5rem;
  padding: 2.5rem;
  background-color: var(--background-content);
  border: 1px solid var(--light-gray-color);
  border-radius: 4px;
  box-shadow: var(--shadow-large);
}

.login__title {
  margin-bottom: 2.5rem;
  text-align: center;
}

.login__submit {
  display: block;
  margin: 0 auto;
}

.login__link:link,
.login__link:visited {
  display: block;
  width: max-content;
  margin: 1rem auto 0 auto;
  font-weight: 500;
  color: var(--secundary-color);
  transition: color 0.3s;
}

.login__link:hover,
.login__link:active {
  color: var(--secundary-color-dark);
}

/*------------------------*/
/* DASHBOARD */
/*------------------------*/

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.dashboard__cols {
  display: grid;
  column-gap: 1rem;
  row-gap: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.dashboard__col .table-container {
  margin-bottom: 2rem;
}

.dashboard__btn {
  display: flex;
  justify-content: center;
}

/*------------------------*/
/* ESCRITORIO GRANDE */
/*------------------------*/

@media only screen and (min-width: 1600px) {
  /* General */

  .container {
    padding: 2rem;
  }

  /* Header */

  .header {
    padding: 1rem 2rem;
  }

  /* Aside */

  .aside {
    padding: 1rem 1rem 1rem 2rem;
  }

  .aside.collapse {
    width: 7.5rem;
  }
}

/*------------------------*/
/* ESCRITORIO PEQUEÑO */
/*------------------------*/

@media only screen and (max-width: 1160px) {
  /* Tablas responsive */
}

@media only screen and (max-height: 627px) {
  .aside-navbar__link:link,
  .aside-navbar__link:visited {
    padding: 14px 1rem;
  }
}

/*------------------------*/
/* TABLETS */
/*------------------------*/

@media only screen and (max-width: 770px) {
  .h1 {
    display: none;
  }

  .container,
  .container.collapse {
    margin-left: 0;
  }

  /* General y componenetes */

  .header {
    justify-content: space-between;
  }

  .modal__content {
    padding: 2rem 1.5rem;
    width: 90%;
  }

  /* Aside */

  .aside {
    width: 0;
    opacity: 0;
    visibility: hidden;
  }

  .aside.collapse {
    width: 18rem;
    opacity: 1;
    visibility: visible;
  }

  .aside.collapse .aside-navbar__link-text {
    display: block;
  }

  .aside.collapse .aside-navbar__icon {
    font-size: initial;
  }

  .aside.collapse .aside-navbar__link:link,
  .aside.collapse .aside-navbar__link:visited {
    justify-content: flex-start;
  }
}

/*------------------------*/
/* CELULARES GRANDES */
/*------------------------*/

@media only screen and (max-width: 430px) {
  .message__close {
    font-size: 1.9rem;
  }

  .form {
    padding: 1.5rem;
  }

  .header__user {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard__cols {
    grid-template-columns: 100%;
  }
}

/*------------------------*/
/* CELULARES MEDIANOS */
/*------------------------*/

@media only screen and (max-width: 375px) {
  /* Header*/

  .header {
    flex-wrap: wrap;
  }

  .header__navbar.responsive {
    flex-basis: 100%;
    order: 1;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .header__navbar.active {
    max-height: 6rem;
  }

  .header__navbar.responsive .menu {
    justify-content: center;
    padding: 1rem 0;
  }

  .header__toggle {
    display: block;
  }

  /* Login */

  .login {
    padding: 2rem 1.5rem;
  }
}

/*------------------------*/
/* CELULARES PEQUEÑOS */
/*------------------------*/

@media only screen and (max-width: 320px) {
  /* General y componenetes*/
  .message__close {
    font-size: 2.7rem;
  }

  .header__user {
    width: 98px;
  }
}

