:root {
  --body-bg-color: #fff;
  --body-text-color: #333;
  --loader-dg: rgba(230, 230, 230, 0.80);
  --loader-color: #333;
  --loader-border: #333;
  --alert-bg-color: #fff;
  --alert-line-color: #f31a02;
  --alert-text-color: #333;
  --a-color: #0B57D0;
  --a-hover-color: #0032B8;

  --table-gb-color: #eee;
  --table-line-color: #e2e8f0;
  --table-inter-color: #f9f9f970;
  --table-box-mobile-color: #f9f9f970;
  --table-hover-color: #eaf2f8;
  --table-button-text-color: #fff;
  --table-button-bg-color: #cfcfcf;

  --default-color: #ffffff;
  --delete-color: #ff4c4c;
  --warning-color: #fa811f;
  --info-color: #af81fa;

  --input-border-color: #e2e5f0;
  --input-bg-color: #f8fafc;

  --settings-card-color: #0f172a;
  --settings-card-description-color: #64748b;
  --settings-card-bg-color: #ffffff;
  --settings-card-border-color: #e2e8f0;

  --btn-outline-text-color: #0f172a;
  --btn-outline-bg-color: #ffffff;
  --btn-outline-border-color: #cbd5e1;
  --btn-outline-hover-color: #f8fafc;

  --modal-confirm-bg-color: #fff;
}

:root[data-theme="dark"] {
  --body-bg-color: #222;
  --body-text-color: #d1d1d1;
  --loader-dg: rgba(35, 35, 35, 0.80);
  --loader-color: #eee;
  --loader-border: #eee;
  --alert-bg-color: #333;
  --alert-line-color: #f31a02;
  --alert-text-color: #fff;
  --a-color: #A8C7FA;
  --a-hover-color: #D3E3FD;

  --table-gb-color: #333;
  --table-line-color: #555;
  --table-inter-color: #3a3939;
  --table-box-mobile-color: #333;
  --table-hover-color: #444;
  --table-button-text-color: #fff;
  --table-button-bg-color: #555;

  --default-color: #ffffff;
  --delete-color: #ff4c4c;
  --warning-color: #fa811f;
  --info-color: #af81fa;

  --input-border-color: #565959;
  --input-bg-color: #2e2d2d;

  --settings-card-color: #f8fafc;
  --settings-card-description-color: #f8fafc;
  --settings-card-bg-color: #252525;
  --settings-card-border-color: #5a5959;

  --btn-outline-text-color: #f8fafc;
  --btn-outline-bg-color: #222;
  --btn-outline-border-color: #5a5959;
  --btn-outline-hover-color: #1e293b;

  --modal-confirm-bg-color: #555;
}

/* disable Blue Highlight when Touch/Press object with Cursor:Pointer */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
}

/* disable select */
*X {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*DEV {
  border: 0.01px dashed #ff0000 !important;
}

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

* {
  font-family: Arial, sans-serif;
}

html {
  box-sizing: border-box;
}

body {
  width: 100%;
  cursor: default;
  font-size: 13px;
  /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;*/
  color: var(--body-text-color);
  background-color: var(--body-bg-color);
  /* evita saltos feos en Android/iOS. */
  /* overscroll-behavior-y: contain; */
}

.font {
  font-family: 'tahoma_regular';
}

:focus,
:active {
  outline: 0;
}

a {
  cursor: pointer;
  padding: 2px;
  font-size: 0.8rem;
  color: var(--a-color);
  transition: color 0.2s ease;
  transition: transform 0.1s ease;
}

a:hover {
  text-decoration: underline;
  color: var(--a-hover-color);
}

a:visited {
  color: var(--a-color);
}

a:active {
  transform: scale(0.94);
}

button {
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Estado desactivado / cargando */
button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

form {
  margin: auto;
}

textarea {
  resize: none;
}

/* cargando */
.loader {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;

  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--loader-dg);
}

.loader .texto {
  width: 100%;
  font-weight: bold;
  text-align: center;
  font-size: 15px;
  text-transform: uppercase;
  margin-top: 10px;
  color: var(--loader-color);
}

.hourglass {
  width: 110px;
  height: 110px;
}

.hourglass:after {
  content: " ";
  display: block;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  margin: 6px;
  box-sizing: border-box;

  animation: cron-hourglass 1.2s infinite;
  border: 5px solid var(--loader-border);
  border-color: var(--loader-border) transparent var(--loader-border) transparent;
}

@keyframes cron-hourglass {
  0% {
    transform: rotate(0);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  50% {
    transform: rotate(900deg);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  100% {
    transform: rotate(1800deg);
  }
}

.hidden {
  display: none !important;
}

/* mensaje form */
[data-alert] span {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 10px 14px;
  margin: 10px 0;
  background-color: var(--alert-bg-color);
  border: 1px solid var(--alert-line-color);
  border-left: 10px solid var(--alert-line-color);
  color: var(--alert-text-color);
  font-weight: bold;
  /*border-radius: 6px;*/
  border-radius: 0 5px 5px 0;
}

[data-alert] span::before {
  content: "";
  margin-right: 6px;
}

[data-alert] span:empty {
  display: none;
  /* si no hay mensaje, ocultamos la caja */
}





/* formulario defecto */
/* basic */
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="file"] {
  width: 100%;
  padding: 0.9rem;
  margin-bottom: 0rem;
  border-radius: 4px;
  font-size: 1rem;
  color: var(--text-color);
  border: 1px solid var(--input-border-color) !important;
  background-color: var(--input-bg-color) !important;
}

/* Icono en blanco (ideal para inputs con fondo oscuro) */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* Icono en un tono azulado/gris */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(30%) sepia(20%) saturate(400%) hue-rotate(190deg);
  cursor: pointer;
}

@media (max-width: 600px) {

  select,
  input[type="text"],
  input[type="email"],
  input[type="password"] {
    padding: 1.3rem;
  }
}

select option {
  background: var(--input-bg-color);
}

button:hover {
  opacity: 80%;
}

button {
  transition: transform 0.1s ease;
}

button:active {
  transform: scale(0.94);
}

/* caja de form. confirm */
.box-panel {
  max-width: 100%;
  /*
  display: flex;
  justify-content: center;
  align-items: center;
  */
}

@media (max-width: 800px) {
  .box-panel {
    min-height: 0vh;
  }
}

.centered-card {
  width: 500px !important;
  padding: 0rem 2rem 0.9rem 2rem;
  text-align: center;
}

.box-panel input {
  display: block;
  width: 100%;
}

.box-panel select {
  display: block;
  width: 100%;
}

.box-panel textarea {
  display: block;
  width: 100%;
}

.box-panel label {
  display: block;
  /* lo forzamos a alinearse a la izquierda */
  text-align: left;
  /* se alinea a la izquierda dentro del flex */
  align-self: flex-start;
  margin: 8px;
  font-weight: bold;
}

/* form mutiples*/
.multiple {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.4rem 0;
}

.multiple>div>*:first-child {
  margin-top: 0;
}

.multiple>*:first-child {
  margin-top: 0;
}

.multiple>*>*:first-child {
  margin-top: 0;
}

.multiple>div {
  flex: 1;
}

/* contenedor box en zonas */
.multi-zone {
  display: flex;
  gap: 1rem;
  /* los hijos (box) arriba */
  align-items: flex-start;
}

.multi-zone>.box {
  flex: 1 1 1;
  padding: 0.6rem 1.5rem;
  /* por si algo externo los centra: */
  align-self: flex-start;
  /* fuerza cada box arriba */
  margin-top: 0;
  /* evita centrado con auto-margins */
  margin-bottom: 0;
}

@media (max-width: 800px) {
  .multi-zone {
    flex-direction: column;
    /* ahora se apilan */
    display: block;
  }
}

/* tablas */
.table-container {
  width: 100%;
  overflow-x: auto;
  /* scroll lateral en pantallas pequeñas */
}

.styled-table {
  width: 100%;
  /* ocupa todo el ancho */
  border-collapse: collapse;
  /* bordes elegantes */
  font-size: 0.95rem;
  /*min-width: 600px;*/
  color: var(--text-color) !important;
}

.styled-table thead tr {
  background: var(--table-gb-color);
  /* color cabecera */
  /*color: #000;*/
  text-align: left;
}

.styled-table th,
.styled-table td {
  padding: 12px 15px;
  border: 1px solid var(--table-line-color);
  /* líneas suaves */
}

.styled-table tbody tr:nth-child(even) {
  background: var(--table-inter-color);
  /* filas intercaladas */
}

.styled-table tbody tr:hover {
  background: var(--table-hover-color);
  /* hover para mejor lectura */
}

.styled-table svg {
  width: 18px;
  height: 18px;
  color: var(--table-button-text-color) !important;
  margin: 0 5px;
}

.styled-table button {
  gap: 8px;
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
}

/* Estilos base del botón */
.styled-table button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 5px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background-color: #fa811f;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.styled-table #delete svg {
  color: var(--delete-color) !important;
}

.styled-table .warning {
  color: var(--warning-color) !important;
}

.styled-table .info {
  color: var(--info-color) !important;
}

/* tabla modo movil */
@media (max-width: 800px) {

  /* oculta encabezados */
  table.styled-table thead {
    display: none;
  }

  /* cada fila será una card */
  table.styled-table tr {
    display: block;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid var(--table-line-color);
    border-radius: 10px;
    background: var(--table-box-mobile-color);
    /*box-shadow: 0px 2px 5px rgb(0 0 0 / 0.1);*/
  }

  /* cada celda ahora es un bloque */
  table.styled-table td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid var(--table-line-color);
    flex-wrap: wrap;
    text-align: right;
  }

  /* quitar última línea */
  table.styled-table td:last-child {
    border-bottom: none;
  }

  /* insertar el texto del th automáticamente */
  table.styled-table td::before {
    content: attr(data-label);
    font-weight: bold;
  }
}

/* celdas perzonalizadas */
.col-id {
  width: 50px;
}

.col-nombre {
  width: 200px;
}

.col-acciones {
  width: 120px;
}

@media (max-width: 800px) {
  .col-id {
    width: auto;
  }

  .col-nombre {
    width: auto;
  }

  .col-acciones {
    width: auto;
  }
}

.table-cart {
  /*height: calc(100% - 600px);*/
  height: 320px;
  overflow-y: scroll;
  /*border: 1px solid var(--table-line-color);*/
  padding: 0.0rem;
}

.table-cart th {
  position: sticky;
  top: 0;
  background: var(--table-gb-color);
  /* para que quede por encima del contenido */
  z-index: 10;
}

@media (max-width: 800px) {
  .table-cart {
    padding: 0.5rem;
    height: unset;
    overflow-y: unset;
    padding-bottom: 70px;
  }
}

/* comentario pie de input en formulario */
.info-input {
  font-size: 0.7rem;
  font-weight: normal;
  text-align: left;
}

/* caja configuracion */
.settings-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.settings-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.settings-card {
  width: 100%;
  background-color: var(--settings-card-bg-color);
  border: 1px solid var(--settings-card-border-color);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  /* Comportamiento por defecto para móvil */
  align-items: flex-start;
  gap: 16px;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.card-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* Alinea los elementos al inicio en móvil */
}

/* Modo escritorio / PC */
@media (min-width: 640px) {
  .settings-card {
    flex-direction: row;
    /* Vuelve disposición horizontal */
    justify-content: space-between;
    align-items: center;
  }

  .card-content {
    flex: 1;
    width: auto;
  }

  .card-action {
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
  }
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--settings-card-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-description {
  font-size: 14px;
  color: var(--settings-card-description-color);
  line-height: 1.5;
}

.info-icon {
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
}

/* Botón */
.btn-outline {
  background-color: var(--btn-outline-bg-color);
  border: 1px solid var(--btn-outline-border-color);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--btn-outline-text-color);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.btn-outline:hover {
  background-color: var(--btn-outline-hover-color);
}

.btn-outline-danger {
  color: #dc3545;
  border: 1px solid #dc3545;
}

.btn-outline-success {
  color: #35dc67;
  border: 1px solid #35dc67;
}

/* Posicionamiento relativo para ubicar la burbuja */
.tooltip {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

/* Escondemos el tooltip por defecto */
.tooltip::after {
  content: attr(data-tooltip);
  /* Toma el texto del HTML */
  position: absolute;
  bottom: 125%;
  /* Lo ubica arriba del elemento */
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  /* Evita parpadeos al pasar el mouse */
  z-index: 10;
}

/* Mostrar al pasar el cursor (Hover) */
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Estilos base del botón */
.btn-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  margin: 2px 0px;
  min-height: 40px;         /* Garantiza misma altura en todos */
  vertical-align: middle;    /* Evita desfasaje con otros elementos */
  line-height: 1.2;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: #2563eb;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.btn-color-red { background-color: #eb2563 !important; }

/* Normalización de iconos (Lucide / SVG) */
.btn-submit svg,
.btn-submit i {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.btn-submit:hover:not(:disabled) {
  background-color: #1d4ed8;
}

/* Estado desactivado / cargando */
.btn-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

/* Spinner animado hecho en CSS puro */
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

/* Clase que activa el estado de carga */
.btn-submit.cargando .spinner {
  display: block;
}

/* Contenedor principal del Switch */
.switch-container {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

/* Ocultamos el checkbox nativo */
.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* El fondo del interruptor */
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  /* Gris desactivado */
  transition: background-color 0.3s ease;
  border-radius: 24px;
}

/* La bolita deslizante */
.switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform 0.3s ease;
  border-radius: 50%;
}

/* Estado Activo (Checked) */
.switch-container input:checked+.switch-slider {
  background-color: #2563eb;
  /* Azul primario */
}

.switch-container input:checked+.switch-slider::before {
  transform: translateX(20px);
}

/* Estado Deshabilitado / Cargando */
.switch-container input:disabled+.switch-slider {
  opacity: 0.6;
  cursor: wait;
}

/* Micro-spinner oculto por defecto */
.switch-spinner {
  display: none;
  position: absolute;
  width: 12px;
  height: 12px;
  top: 6px;
  left: 6px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: girar-switch 0.8s linear infinite;
}

.switch-container input:checked+.switch-slider .switch-spinner {
  left: 26px;
  /* Posición cuando está activo */
  border-top-color: #ffffff;
}

@keyframes girar-switch {
  to {
    transform: rotate(360deg);
  }
}

/* Mostrar spinner cuando se agrega la clase .cargando */
.switch-container.cargando .switch-spinner {
  display: block;
}

.switch-container.cargando .switch-slider::before {
  opacity: 0;
  /* Oculta temporalmente la bolita blanca para mostrar el spinner */
}

/* flotante confirmacion */
.modal-confirm {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-confirm .modal-content {
  color: var(--text-color);
  background: var(--modal-confirm-bg-color);
  padding: 1.5rem;
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
}

.modal-confirm .modal-content p {
  margin: 10px;
}

/* Botón */
.modal-confirm button {
  background-color: var(--btn-outline-bg-color);
  border: 1px solid var(--btn-outline-border-color);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--btn-outline-text-color);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.modal-confirm button:hover {
  background-color: var(--btn-outline-hover-color);
}

/* botones generales */
.btn-main {
  display: inline-block;
  padding: 8px 16px;
  text-decoration: none;
  /* Evita que el texto se rompa feo */
  white-space: nowrap;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none !important;
  color: #ffffff !important;
  background-color: #2563eb;
}

.btn-main:hover {
  opacity: 80%;
}

.otp-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 0;
}

.otp-input {
  width: 55px !important;
  height: 55px !important;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.otp-input:focus {
  border-color: #0066ff !important;
  box-shadow: 0 0 5px rgba(0, 102, 255, 0.4) !important;
}

/* password input */
.form-containerX {
    width: 320px;
    font-family: system-ui, -apple-system, sans-serif;
  }

  .input-group {
    position: relative;
    margin-bottom: 8px;
  }

  .input-group inputX {
    width: 100%;
    padding: 10px 40px 10px 12px;
    box-sizing: border-box;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
  }

  .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
  }

  .toggle-password svg {
    width: 20px;
    height: 20px;
    fill: #666;
  }

  /* Barra de fuerza */
  .strength-meter {
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
  }

  .strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
  }

  .strength-text {
    font-size: 13px;
    color: #555;
  }

  /* Estilos dinámicos de fuerza */
  .weak {
    width: 33.3%;
    background-color: #e74c3c;
  }

  .medium {
    width: 66.6%;
    background-color: #f1c40f;
  }

  .strong {
    width: 100%;
    background-color: #2ecc71;
  }


/* Avatar account */

.avatar-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .avatar-option input[type="radio"] {
    display: none;
    /* Oculta el radio button */
  }

  .avatar-option img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
  }

  .avatar-option input[type="radio"]:checked+img {
    border-color: #007bff;
    /* Color de selección */
    transform: scale(1.1);
  }





  .space {
  padding: 0.3rem 0;
}

.space_top_1 {
  margin-top: 0.6rem !important;
}

.space_bottom_1 {
  margin-bottom: 0.6rem !important;
}

.w100 {
  width: 100px !important;
}

.w200 {
  width: 200px !important;
}

.w300 {
  width: 300px !important;
}

.w400 {
  width: 400px !important;
}

.w500 {
  width: 500px !important;
}