/* Elijo Smart · Inventario — paleta oficial: violeta #6d3ff2 + lila #a78bfa + carbón #131022 */
* { box-sizing: border-box; }
:root {
  --violeta: #6d3ff2;
  --violeta-osc: #5a2fd8;
  --lila: #a78bfa;
  --lila-bg: #f3effe;
  --carbon: #131022;
  --carbon-2: #241f3d;
  --carbon-osc: #0c0a18;
  --fondo: #f5f4fa;
  --borde: #e5e2ef;
  --texto: #24222f;
  --gris: #6f6b80;
  --verde: #1a7f37;
  --verde-bg: #e6f4ea;
  --rojo: #c0392b;
  --rojo-bg: #fdecea;
  --ambar: #9a6700;
  --ambar-bg: #fff8e5;
  --azul: #1f6feb;
  --azul-bg: #ddeafe;
  --lateral-ancho: 250px;
}
html, body { margin: 0; padding: 0; background: var(--fondo); color: var(--texto);
  font-family: "Poppins", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; }
a { color: var(--violeta); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Logo Elijo Smart (recreado del logo oficial) ===== */
.logo-es { display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; background: var(--violeta);
  color: #fff; font-weight: 700; font-size: 22px; letter-spacing: -.5px;
  font-family: "Poppins", sans-serif; flex: none; line-height: 1; }
.logo-es-mini { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; }
.logo-es-grande { width: 64px; height: 64px; border-radius: 18px; font-size: 34px; }
.marca-texto { font-weight: 700; letter-spacing: -.3px; }
.marca-texto small { display: block; font-weight: 400; font-size: 11px; color: var(--lila); letter-spacing: 0; }

/* ===== Menú lateral ===== */
.lateral { position: fixed; top: 0; left: 0; bottom: 0; width: var(--lateral-ancho);
  background: var(--carbon); color: #cbc7dd; display: flex; flex-direction: column;
  z-index: 40; transition: transform .2s ease; }
.lateral-marca { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700;
  font-size: 17px; padding: 16px; border-bottom: 1px solid var(--carbon-2); }
.lateral-marca:hover { text-decoration: none; }

.lateral-usuario { display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--carbon-2); }
.lateral-usuario .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--violeta);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.lateral-usuario .nombre { color: #fff; font-size: 14px; font-weight: 600; line-height: 1.2; }
.lateral-usuario .rol { font-size: 12px; color: var(--lila); }

.lateral-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.lateral-nav .grupo { padding: 14px 16px 6px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: #7a7590; }
.lateral-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  color: #cbc7dd; font-size: 14px; border-left: 3px solid transparent; }
.lateral-nav a:hover { background: var(--carbon-2); color: #fff; text-decoration: none; }
.lateral-nav a.activo { background: var(--carbon-osc); color: #fff; border-left-color: var(--violeta); }
.lateral-nav .ico { width: 22px; text-align: center; flex: none; }

.lateral-pie { border-top: 1px solid var(--carbon-2); padding: 8px 0; }
.lateral-pie a { display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  color: #cbc7dd; font-size: 14px; }
.lateral-pie a:hover { background: var(--carbon-2); text-decoration: none; }
.lateral-pie .salir { color: #ffb4a9; }
.lateral-pie .ico { width: 22px; text-align: center; }

/* Barra superior solo móvil */
.barra-movil { display: none; }
.velo { display: none; }

/* Contenido */
body.con-menu .contenido { margin-left: var(--lateral-ancho); }
.contenido { padding: 22px 26px 60px; max-width: 1200px; }
body.sin-menu .contenido { margin: auto; max-width: 1100px; padding: 18px 16px 60px; }

@media (max-width: 860px) {
  .lateral { transform: translateX(-100%); box-shadow: 4px 0 18px rgba(0,0,0,.25); }
  .lateral.abierto { transform: translateX(0); }
  .velo.visible { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .barra-movil { display: flex; align-items: center; gap: 10px; background: var(--carbon);
    color: #fff; padding: 10px 12px; position: sticky; top: 0; z-index: 20; }
  .hamburguesa { background: none; border: 0; color: #fff; font-size: 22px; padding: 4px 8px; cursor: pointer; }
  .barra-movil-titulo { font-weight: 700; }
  body.con-menu .contenido { margin-left: 0; padding: 16px 14px 60px; }
}

h1 { font-size: 22px; margin: 4px 0 18px; }
h2 { font-size: 17px; margin: 22px 0 10px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.flash-ok    { background: var(--verde-bg); color: var(--verde); }
.flash-error { background: var(--rojo-bg); color: var(--rojo); }
.flash-aviso { background: var(--ambar-bg); color: var(--ambar); }

.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 12px;
  padding: 16px; margin-bottom: 16px; }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; }
.tabla th { background: #faf9fd; text-align: left; padding: 10px 12px; font-size: 13px;
  color: var(--gris); border-bottom: 1px solid var(--borde); }
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla-scroll { overflow-x: auto; }

/* Botones */
.boton, button.boton { display: inline-block; background: var(--violeta); color: #fff;
  border: 0; border-radius: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer;
  font-family: inherit; }
.boton:hover { background: var(--violeta-osc); text-decoration: none; color: #fff; }
.boton-verde { background: var(--verde); }
.boton-verde:hover { background: #14632b; }
.boton-rojo { background: var(--rojo); }
.boton-rojo:hover { background: #992d22; }
.boton-carbon { background: var(--carbon); }
.boton-carbon:hover { background: var(--carbon-2); }
.boton-linea { background: #fff; color: var(--violeta); border: 1px solid var(--borde); }
.boton-linea:hover { background: var(--lila-bg); color: var(--violeta-osc); }
.boton-grande { width: 100%; padding: 14px; font-size: 16px; text-align: center; }

/* Formularios */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 13px; color: var(--gris); margin-bottom: 5px; }
.campo input[type=text], .campo input[type=password], .campo input[type=email],
.campo input[type=date], .campo input[type=number], .campo input[type=tel],
.campo select, .campo textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--texto); font-family: inherit; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: 2px solid var(--lila); border-color: var(--violeta); }
.campo textarea { min-height: 70px; resize: vertical; }
.campo .ayuda { font-size: 12px; color: var(--gris); margin-top: 4px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-2col, .form-3col { grid-template-columns: 1fr; } }

/* Chips de estado del flujo */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-porvalidar  { background: var(--ambar-bg); color: var(--ambar); }
.chip-laboratorio { background: var(--azul-bg); color: var(--azul); }
.chip-disponible  { background: var(--verde-bg); color: var(--verde); }
.chip-vendido     { background: var(--lila-bg); color: var(--violeta); }
.chip-despachado  { background: #eceaf2; color: var(--gris); }
.chip-ok          { background: var(--verde-bg); color: var(--verde); }
.chip-error       { background: var(--rojo-bg); color: var(--rojo); }
.chip-aviso       { background: var(--ambar-bg); color: var(--ambar); }

/* Panel */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 14px; }
.kpi .num { font-size: 26px; font-weight: 700; }
.kpi .txt { font-size: 13px; color: var(--gris); }
.kpi.kpi-violeta { border-top: 3px solid var(--violeta); }
.kpi.kpi-ambar   { border-top: 3px solid var(--ambar); }
.kpi.kpi-azul    { border-top: 3px solid var(--azul); }
.kpi.kpi-verde   { border-top: 3px solid var(--verde); }
.kpi.kpi-gris    { border-top: 3px solid var(--gris); }

/* Login */
.login-caja { max-width: 400px; margin: 8vh auto; }
.login-caja .tarjeta { padding: 28px; }
.login-titulo { text-align: center; margin-bottom: 18px; }
.login-titulo h1 { margin: 12px 0 2px; letter-spacing: -.3px; }
.login-titulo .mini { color: var(--gris); }

.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.derecha { text-align: right; }
.mini { font-size: 12px; color: var(--gris); }

/* Encabezado de página con acciones a la derecha */
.pagina-cabeza { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pagina-cabeza h1 { margin: 0; }

/* Filtros */
.filtros-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.filtros-grid .campo { margin-bottom: 8px; }

/* Fila de ítem seleccionable (actas y ventas) */
.fila-check { display: flex; align-items: center; gap: 10px; }
.fila-check input[type=number] { width: 90px; padding: 6px 8px; border: 1px solid var(--borde); border-radius: 8px; }

/* ===== Actas imprimibles ===== */
.acta { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 28px; max-width: 860px; }
.acta-cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  border-bottom: 3px solid var(--violeta); padding-bottom: 14px; margin-bottom: 18px; }
.acta-marca { display: flex; align-items: center; gap: 12px; }
.acta-marca .marca-texto { color: var(--violeta); font-size: 20px; }
.acta-marca .marca-texto small { color: var(--gris); }
.acta-folio { text-align: right; }
.acta-folio .folio { font-size: 20px; font-weight: 700; color: var(--violeta); }
.acta-titulo { font-size: 18px; font-weight: 700; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .04em; }
.acta-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; margin-bottom: 16px; font-size: 14px; }
.acta-datos .dato b { color: var(--gris); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; display: block; }
.acta-qr { text-align: center; }
.acta-qr img { border: 1px solid var(--borde); border-radius: 8px; }
.acta-firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; }
.acta-firmas .firma { text-align: center; border-top: 1px solid var(--texto); padding-top: 6px; font-size: 13px; }
.acta-sello { margin-top: 18px; padding: 12px; border-radius: 10px; font-weight: 600; text-align: center; }
.acta-sello.ok { background: var(--verde-bg); color: var(--verde); }
.acta-sello.pend { background: var(--ambar-bg); color: var(--ambar); }
.acta-sello.rech { background: var(--rojo-bg); color: var(--rojo); }

@media print {
  .lateral, .barra-movil, .velo, .no-print, .flash { display: none !important; }
  body, html { background: #fff; }
  body.con-menu .contenido { margin: 0; padding: 0; max-width: none; }
  .acta { border: 0; padding: 0; max-width: none; }
  a { color: inherit; }
}

/* Escáner QR de seguridad */
.scanner-caja { position: relative; max-width: 480px; }
.scanner-caja video { width: 100%; border-radius: 12px; background: #000; }
.scanner-marco { position: absolute; inset: 12%; border: 3px solid var(--violeta); border-radius: 16px; pointer-events: none; }
