/* Vistelo - estilos generales */
:root {
  --marca: #2563EB;
  --fondo: #f4f6f9;
  --borde: #e5e7eb;
  --texto: #1f2937;
  --suave: #6b7280;
  --ancho-lateral: 240px;
}

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .925rem;
}

/* Boton con el color del negocio */
.btn-marca {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--marca);
  --bs-btn-border-color: var(--marca);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: color-mix(in srgb, var(--marca) 88%, #000);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--marca) 88%, #000);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: color-mix(in srgb, var(--marca) 80%, #000);
  --bs-btn-active-border-color: color-mix(in srgb, var(--marca) 80%, #000);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--marca);
  --bs-btn-disabled-border-color: var(--marca);
}
.form-control:focus, .form-select:focus {
  border-color: var(--marca);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--marca) 18%, transparent);
}

/* Login */
.pagina-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-caja {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 32px 28px;
}

/* Menu lateral */
.lateral {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--ancho-lateral);
  background: #fff;
  border-right: 1px solid var(--borde);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .2s;
}
.lateral-marca {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--borde);
}
.lateral-letra {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--marca);
  color: #fff;
  display: grid;
  place-items: center;
}
.lateral-logo {
  height: 34px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  flex: 0 0 auto;
}
.lateral-menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 20px;
}
.menu-grupo {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--suave);
  padding: 14px 10px 6px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--texto);
  text-decoration: none;
  margin-bottom: 2px;
}
.menu-item i {
  font-size: 1.05rem;
  color: var(--suave);
}
.menu-item:hover {
  background: var(--fondo);
  color: var(--texto);
}
.menu-item.activo {
  background: color-mix(in srgb, var(--marca) 10%, #fff);
  color: var(--marca);
  font-weight: 600;
}
.menu-item.activo i {
  color: var(--marca);
}
.menu-item.pronto {
  opacity: .45;
  cursor: default;
}
.menu-item.pronto:hover {
  background: none;
}

/* Parte derecha */
.contenido {
  margin-left: var(--ancho-lateral);
  min-height: 100vh;
}
.barra {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--borde);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}
.barra-titulo {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--marca);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 600;
}
.pagina {
  padding: 20px;
}

/* Tarjetas */
.tarjeta {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 16px;
}
.dato-titulo {
  font-size: .8rem;
  color: var(--suave);
}
.dato-valor {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.dato-icono {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: color-mix(in srgb, var(--marca) 10%, #fff);
  color: var(--marca);
}

/* Celular */
.velo {
  display: none;
}
@media (max-width: 991.98px) {
  .lateral {
    transform: translateX(-100%);
  }
  .lateral.abierto {
    transform: none;
  }
  .contenido {
    margin-left: 0;
  }
  .velo.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 1035;
  }
  .dato-valor {
    font-size: 1.2rem;
  }
  .barra, .pagina {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Tablas */
.tabla {
  margin: 0;
  font-size: .875rem;
}
.tabla th {
  font-size: .75rem;
  font-weight: 600;
  color: var(--suave);
  text-transform: uppercase;
  letter-spacing: .03em;
  background: #fafbfc;
  white-space: nowrap;
}
.tabla td, .tabla th {
  vertical-align: middle;
  padding: .6rem .75rem;
}
.tabla-caja {
  border: 1px solid var(--borde);
  border-radius: 8px;
  overflow: hidden;
}
.estado {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
}
.estado-verde { background: #dcfce7; color: #166534; }
.estado-azul { background: #dbeafe; color: #1e40af; }
.estado-ambar { background: #fef3c7; color: #92400e; }
.estado-rojo { background: #fee2e2; color: #991b1b; }
.estado-gris { background: #f1f5f9; color: #475569; }
.btn-icono {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.encabezado {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.encabezado p {
  margin: 0;
  color: var(--suave);
  font-size: .85rem;
}
.form-label {
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .3rem;
}

/* Mi plan */
.opcion-plan {
  display: block;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  height: 100%;
}
.opcion-plan input {
  display: none;
}
.opcion-plan:has(input:checked) {
  border-color: var(--marca);
  background: color-mix(in srgb, var(--marca) 6%, #fff);
  box-shadow: 0 0 0 1px var(--marca);
}
.resumen-pago {
  background: var(--fondo);
  border-radius: 8px;
  padding: 10px 12px;
}
.resumen-pago:empty {
  display: none;
}
.aviso-plan {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: .85rem;
  padding: 8px 20px;
}

/* Configuracion */
.logo-caja {
  width: 72px;
  height: 72px;
  border: 1px dashed var(--borde);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: #fafbfc;
  flex: 0 0 72px;
}
.logo-caja img {
  max-width: 64px;
  max-height: 64px;
  object-fit: contain;
}
.muestra-color {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--borde);
  padding: 0;
}
.muestra-color.elegido {
  box-shadow: 0 0 0 2px var(--texto);
}
.barra-guardar {
  position: sticky;
  bottom: 0;
  background: var(--fondo);
  padding: 12px 0;
  margin-top: 12px;
}
.nav-underline .nav-link.active {
  color: var(--marca);
  border-bottom-color: var(--marca);
}
.nav-underline .nav-link {
  color: var(--suave);
}

/* Vista previa del ticket */
.ticket-fondo {
  background: #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  justify-content: center;
  max-height: 560px;
  overflow: auto;
}
.ticket {
  background: #fff;
  color: #111;
  font-family: "Courier New", monospace;
  text-align: center;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  line-height: 1.35;
}
.ticket-58 { width: 200px; font-size: 10px; }
.ticket-80 { width: 270px; font-size: 11px; }
.ticket-A5 { width: 330px; font-size: 11px; padding: 20px; }
.ticket-A4 { width: 400px; font-size: 11px; padding: 24px; }
.ticket table {
  width: 100%;
  text-align: left;
}
.ticket td:last-child {
  text-align: right;
  white-space: nowrap;
  padding-left: 6px;
}
.ticket-logo {
  max-width: 60%;
  max-height: 60px;
  object-fit: contain;
  margin-bottom: 6px;
}
.ticket-linea {
  border-top: 1px dashed #555;
  margin: 6px 0;
}
.ticket-nota {
  font-size: .85em;
  margin-top: 6px;
}

.dropdown-item.active, .dropdown-item:active {
  background: var(--marca);
}
.btn-check:checked + .btn-outline-secondary {
  background: var(--marca);
  border-color: var(--marca);
  color: #fff;
}

.punto-color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .2);
  vertical-align: -2px;
}

/* Productos */
.miniatura {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--borde);
  display: inline-grid;
  place-items: center;
}
.sin-foto {
  background: #f8fafc;
  color: #cbd5e1;
}
.chip {
  border: 1px solid var(--borde);
  background: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .82rem;
  line-height: 1.4;
}
.chip:hover {
  border-color: var(--marca);
}
.chip.activo {
  background: var(--marca);
  border-color: var(--marca);
  color: #fff;
}
.chip.activo .punto-color {
  border-color: #fff;
}
.tabla-variantes td, .tabla-variantes th {
  padding: .4rem .35rem;
}
.tabla-variantes input[type="number"] {
  min-width: 68px;
}
.fila-todas td {
  background: #f8fafc;
}
.ayuda-th {
  font-size: .65rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.fotos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fotos-grid:empty {
  display: none;
}
.foto-item {
  position: relative;
}
.foto-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--borde);
}
.foto-principal {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--marca);
  color: #fff;
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 10px;
}
.foto-acciones {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
}
.foto-acciones button {
  border: 0;
  background: rgba(255, 255, 255, .9);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  font-size: .75rem;
  padding: 0;
}
.tabla-variantes [data-campo="codigo_barras"] {
  min-width: 130px;
}

/* Escaner */
.escaner-video {
  width: 100%;
  min-height: 220px;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
}
.escaner-video video {
  width: 100% !important;
  display: block;
}
.lista-resultados {
  max-height: 60vh;
  overflow-y: auto;
}
