/* ===== Google Font Import - Poppins ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

:root {
  /* ===== Colors ===== */
  --primary-color: #068ad5;
  --hover-primary-color: #7cacd0;
  --secondary-color: #98cdea;
  --hover-secondary-color: #c9e6f4;

  --panel-color: #FFF;
  --text-color: #000;
  --black-light-color: #707070;
  --border-color: #e6e5e5;
  --toggle-color: #DDD;
  --box1-color: #4DA3FF;
  --box2-color: #FFE6AC;
  --box3-color: #E7D1FC;
  --title-icon-color: #fff;

  /* ====== Transition ====== */
  --tran-05: all 0.5s ease;
  --tran-03: all 0.3s ease;
  --tran-03: all 0.2s ease;
}

body.dark {
  --primary-color: #3A3B3C;
  --hover-primary-color: #47494a;
  --secondary-color: #5b5b5b;
  --hover-secondary-color: #6f6f6f;

  --panel-color: #242526;
  --text-color: #CCC;
  --black-light-color: #CCC;
  --border-color: #4D4C4C;
  --toggle-color: #FFF;
  --box1-color: #3A3B3C;
  --box2-color: #3A3B3C;
  --box3-color: #3A3B3C;
  --title-icon-color: #CCC;
}

body {
  min-height: 100vh;
  background-color: var(--primary-color);
}

/* === Custom Scroll Bar CSS === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
}

body.dark::-webkit-scrollbar-thumb:hover,
body.dark .table-data::-webkit-scrollbar-thumb:hover {
  background: #3A3B3C;
}

.small-text {
  font-size: 12px;
}

.primary-button {
  position: relative;
  background-color: var(--primary-color);
  border-radius: 6px;
  color: var(--title-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.primary-button:hover {
  background-color: var(--hover-primary-color);
}

.secondary-button {
  position: relative;
  background-color: var(--secondary-color);
  border-radius: 6px;
  color: var(--title-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.secondary-button:hover {
  background-color: var(--hover-secondary-color);
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;

  margin-top: 10px;
}

.row-2 {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.column-no-gap {
  display: flex;
  flex-direction: column;
}

.align-center {
  display: flex;
  align-items: center;
}

.space-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.obligatory {
  color: red;
}

.clock {
  text-align: center;
}

.clock .display {
  font-size: 18px;
  color: var(--text-color);
  letter-spacing: 2px;
}

p,
span {
  color: var(--text-color);
}

.icon {
  font-size: 26px;
  color: var(--text-color);
  cursor: pointer;
}

button {
  background: none;
  font: inherit;
  border: none;
  cursor: pointer;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  /* Habilita el scroll horizontal */
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  font-weight: bold;
}

.pagination {
  display: flex;
  align-items: center;
}

.pagination ul {
  display: flex;
  flex-direction: row;
  gap: 5px;
}

.pagination ul li {
  list-style: none;
}

.pagination a {
  display: inline-block;
  padding: 5px 10px;
  text-decoration: none;
  color: var(--text-color);
  border-radius: 3px;
}

.pagination a.active {
  background-color: var(--black-light-color);
  color: #fff;
}

.pagination a.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;

  margin-top: 20px;
}

.options {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 20px;
}

.options a {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--text-color);
  font-size: 20px;
}

.options span {
  font-size: 20px;
}

/* SIDEBAR STYLES */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 250px;
  height: 100vh;
  background: var(--panel-color);
  border-right: 1px solid var(--border-color);
  transition: all 0.4s ease;
}

/* Encabezado */
.sidebar .sidebar-header {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header .header-logo img {
  width: 60px;
  object-fit: contain;
  border-radius: 50%;
}

.sidebar .sidebar-header .close-sidebar {
  color: var(--white-color);
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
}

/* Lista principal */
.sidebar-nav .nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 15px;
  transform: translateY(15px);
  transition: 0.4s ease;
}

/* Scroll principal */
.sidebar .sidebar-nav .primary-nav {
  overflow-y: auto;
  scrollbar-width: thin;
  padding-bottom: 20px;
  height: calc(100vh - 180px);
  scrollbar-color: transparent transparent;
}

.sidebar .sidebar-nav .primary-nav:hover {
  scrollbar-color: #EEF2FF transparent;
}

/* Ítems */
.sidebar-nav .nav-item {
  position: relative;
}

.sidebar-nav .nav-item .nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 15px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--white-color);
  border: 1px solid var(--blue-principal);
  transition: 0.4s ease;
}

.sidebar-nav .nav-item:is(:hover, .open)>.nav-link {
  background: var(--border-color);
  color: var(--text-color);
}

/* ========== DROPDOWNS ========== */
.dropdown-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.dropdown-container.open>.nav-link .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  padding-left: 15px;
  transition: max-height 0.4s ease;
}

.dropdown-container.open>.dropdown-menu {
  max-height: 500px;
}

.dropdown-menu .nav-item .nav-link {
  padding: 9px 15px;
  color: var(--text-color);
}

/* ========== SECUNDARIOS ========== */
.sidebar-nav .secondary-nav {
  position: absolute;
  bottom: 35px;
  width: 100%;
  background: var(--blue-principal);
}

/* DASHBOARD */
.dashboard {
  position: relative;
  left: 250px;
  background-color: var(--panel-color);
  min-height: 100vh;
  width: calc(100% - 250px);
  padding: 10px;
  transition: var(--tran-05);
}

.dashboard .navbar {
  position: fixed;
  top: 0;
  left: 250px;
  display: flex;
  width: calc(100% - 250px);
  border-bottom: 1px solid var(--border-color);
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: var(--panel-color);
  transition: var(--tran-05);
  z-index: 10;
}

.dashboard .navbar .open-sidebar {
  display: none;
  color: var(--text-color);
}

.dashboard .navbar .navbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dash-content .title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 60px 0 30px 0;
}

.dash-content .title span {
  position: relative;
  height: 35px;
  width: 35px;
  background-color: var(--primary-color);
  border-radius: 6px;
  color: var(--title-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.dash-content .title .text {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-color);
}

.dash-content .boxes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.dash-content .boxes .box {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 12px;
  width: calc(100% / 3 - 15px);
  padding: 15px 20px;
  background-color: var(--box1-color);
  transition: var(--tran-05);
}

.boxes .box span {
  font-size: 35px;
  color: var(--text-color);
}

.boxes .box .text {
  white-space: nowrap;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-color);
}

.boxes .box .number {
  font-size: 40px;
  font-weight: 500;
  color: var(--text-color);
}

.boxes .box.box2 {
  background-color: var(--box2-color);
}

.boxes .box.box3 {
  background-color: var(--box3-color);
}

/* forms */
.FormularioAjax .input-box {
  width: 100%;
  margin-top: 10px;
}

.input-box label {
  color: var(--text-color);
  display: flex;
  align-items: center;
}

.input-box label span {
  font-size: 13px;
}

input,
.select-box {
  position: relative;
  height: 50px;
  width: 100%;
  outline: none;
  font-size: 1rem;
  color: var(--black-light-color);
  background-color: var(--panel-color);
  /* margin-top: 8px; */
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0 15px;
}

input:focus {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.select-box select {
  height: 100%;
  width: 100%;
  outline: none;
  border: none;
  color: var(--black-light-color);
  background-color: var(--panel-color);
  font-size: 1rem;
}

/* products in inventory styles */
.product {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px;

  border-bottom: 1px solid var(--border-color);
  margin-top: 10px;
}

.product-image {
  width: 100px;
  height: 100px;
}

.product-data {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.product-data .product-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

/* POS STYLES */
.sale-details span {
  text-align: right;
  color: #016dcb;
}

.sale-details p {
  font-weight: bold;
}

.pos-app {
  margin-top: 60px;
  width: 100%;
}

.form-agregar {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.pos-button {
  position: relative;
  height: 35px;
  width: 35px;
  background-color: var(--border-color);
  border-radius: 6px;
  color: var(--title-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.pos-category-container {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px;
  white-space: nowrap;
}

.card-product-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;

  max-height: 500px;
  /* Altura máxima con scroll */
  overflow-y: auto;
  overflow-x: auto;
}

.card-product {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Centra horizontalmente */
  justify-content: center;
  /* Centra verticalmente */
  text-align: center;
  cursor: pointer;
  background: var(--border-color);
  color: var(--text-color);
  border-radius: 8px;
  padding: 1rem;
  min-height: 100px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.card-product:hover {
  transform: scale(1.03);
}

.card-product img {
  max-width: 100px;
  margin-bottom: 0.5rem;
}

.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 5px;
}

/* Ocultar el radio original */
.radio-group input[type="radio"] {
  display: none;
}

/* Estilo para la etiqueta de radio */
.radio-group label {
  display: inline-block;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  color: var(--text-color);
}

/* Círculo visible */
.radio-group label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  background-color: #fff;
  transition: 0.3s;
}

/* Punto activo dentro del círculo */
.radio-group input[type="radio"]:checked+label::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-color);
  transition: 0.3s;
}

.table-container.resume {
  width: 100%;
  max-height: 350px;
  /* Altura máxima con scroll */
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  /* Necesario para que sticky funcione */
}

.table-container.resume thead th {
  position: sticky;
  top: 0;
  background-color: var(--border-color);
  /* Asegura visibilidad del encabezado */
  z-index: 2;
  border-bottom: 2px solid var(--border-color);
}

/* Fila de total al final (estilo fila sticky en tbody) */
.table-container.resume tbody tr:last-child td {
  position: sticky;
  bottom: 0;
  background-color: var(--border-color);
  z-index: 1;
  font-weight: bold;
  border-top: 2px solid var(--border-color);
}


/* MODAL STYLES */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  /* evita que se pegue a los bordes en pantallas pequeñas */
}

.modal-content {
  background-color: var(--panel-color);
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-in-out;
  height: auto;
  /* se adapta al contenido */
  max-height: 90vh;
  /* previene desbordes en pantallas pequeñas */
  overflow-y: auto;
  /* solo si el contenido lo necesita */
}


.modal-header {
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}

.modal-body {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #333;
}

/* login */
.container_login {
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 30px;
}

.form_login {
  position: absolute;
  max-width: 430px;
  width: 100%;
  padding: 30px;
  border-radius: 6px;
  background: var(--border-color);
}

.header_login {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-color);
  text-align: center;
}

.form_login {
  margin-top: 30px;
}

.form_login .field {
  position: relative;
  height: 50px;
  width: 100%;
  margin-top: 20px;
  border-radius: 6px;
}

.field input,
.field button {
  height: 100%;
  width: 100%;
  border: none;
  font-size: 16px;
  font-weight: 400;
  border-radius: 6px;
}

.field input {
  outline: none;
  padding: 0 15px;
  border: 1px solid var(--border-color);
}

.field input:focus {
  border-bottom-width: 2px;
}

.eye-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 18px;
  color: #8b8b8b;
  cursor: pointer;
  padding: 5px;
}

.field button {
  color: #fff;
  background-color: #0171d3;
  transition: all 0.3s ease;
  cursor: pointer;
}

.field button:hover {
  background-color: #016dcb;
}

@media (max-width: 1000px) {
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: hsla(0, 0%, 0%, 0.5);
    display: none;
    z-index: 15;
    transition: 0.5s ease;
  }

  .overlay.active {
    display: block;
  }

  .dashboard .navbar .open-sidebar {
    display: block;
  }

  .sidebar .sidebar-header .close-sidebar {
    display: block;
  }

  .sidebar~.dashboard {
    left: 0px;
    width: 100%;
  }

  .sidebar~.dashboard .navbar {
    left: 0px;
    width: 100%;
  }

  .sidebar {
    left: -100%;
    visibility: hidden;
    z-index: 20;
  }

  .sidebar.active {
    left: 0;
    visibility: visible;
  }

  .dash-content .boxes .box {
    width: calc(100% / 2 - 15px);
    margin-top: 15px;
  }

  .row {
    display: flex;
    flex-direction: column;
  }

  .dash-content .boxes .box {
    min-width: 100%;
  }

  .options {
    flex-direction: column;
  }

  .product-data .product-actions {
    flex-direction: column;
  }
}