/* ============ AZAR INV — Estilos específicos móvil-first ============ */

/* ── Touch targets mínimos 44px ─────────────────────────────────────── */
button, .btn, input[type="button"], input[type="submit"] {
  min-height: 44px;
}

/* ── Input grande para cantidad ─────────────────────────────────────── */
.qty-input-big {
  width: 100%;
  font-size: 44px !important;
  font-weight: 800;
  text-align: center;
  padding: 12px 8px !important;
  border: 2.5px solid var(--blue-main);
  border-radius: 12px;
  font-family: 'Rajdhani', sans-serif;
  color: var(--blue-dark);
  background: white;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty-input-big::-webkit-inner-spin-button,
.qty-input-big::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input-big:focus { border-color: var(--green-main); box-shadow: 0 0 0 4px rgba(34,197,94,0.15); }

/* ── Botones +/− grandes ─────────────────────────────────────────────── */
.qty-big-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 30px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.qty-big-btn.minus { background: #fee2e2; color: var(--red); }
.qty-big-btn.minus:active { background: var(--red); color: white; }
.qty-big-btn.plus  { background: #dcfce7; color: var(--green-dark); }
.qty-big-btn.plus:active  { background: var(--green-main); color: white; }

/* ── Fila del control de cantidad ─────────────────────────────────────── */
.qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.qty-row .qty-input-big { flex: 1; }

/* ── Botón guardar — debe dominar la pantalla ─────────────────────────── */
.save-btn-big {
  width: 100%;
  min-height: 58px;
  font-size: 17px !important;
  font-weight: 700;
  border-radius: 14px;
  justify-content: center;
  letter-spacing: 0.5px;
}

/* ── Layout FLEX COLUMN para conteo (botón siempre visible) ─────────── */
/*
 * position:fixed con top/bottom conocidos — no depende de height:%,
 * de 100vh vs 100dvh, ni de cadenas de flex parent. Funciona en
 * cualquier navegador, con o sin teclado virtual, en cualquier tamaño.
 */
.conteo-layout {
  position: fixed;
  top: var(--header-h);         /* justo debajo del header */
  bottom: var(--footer-h);      /* justo encima del footer */
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  background: linear-gradient(135deg, #c8dcf5 0%, #dde8f8 40%, #cdd9ef 100%);
}
.conteo-header-strip {
  flex-shrink: 0;
  padding: 10px 12px 6px;
}
.conteo-scroll-zone {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 12px 8px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.conteo-bottom-bar {
  flex-shrink: 0;
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
  padding: 10px 12px 12px;
  box-shadow: 0 -6px 20px rgba(13,27,62,0.12);
}

/* ── Card de producto en conteo ────────────────────────────────────────── */
.product-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(30,93,181,0.12);
  border: 1px solid rgba(255,255,255,0.8);
  margin-bottom: 8px;
  overflow: hidden;
}
.product-card-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.product-card-body { padding: 14px; }
.product-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue-dark);
  line-height: 1.25;
  margin-bottom: 6px;
}

/* ── Chips de info del producto ─────────────────────────────────────────── */
.info-chip {
  display: inline-flex;
  align-items: center;
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  margin: 2px;
}

/* ── Caja de stock sistema ─────────────────────────────────────────────── */
.stock-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  flex: 1;
}
.stock-box-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #3b82f6; }
.stock-box-num   { font-size: 28px; font-weight: 800; color: var(--blue-dark); font-family: 'Rajdhani', sans-serif; line-height: 1.1; }
.stock-box.contado { background: #f0fdf4; border-color: #bbf7d0; }
.stock-box.contado .stock-box-label { color: var(--green-dark); }
.stock-box.contado .stock-box-num   { color: var(--green-dark); }

/* ── Nav de conteo ─────────────────────────────────────────────────────── */
.conteo-nav {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 6px;
  margin-bottom: 0;
}
.conteo-nav button {
  min-height: 44px;
  font-size: 12px;
  justify-content: center;
  border-radius: 10px;
  padding: 8px 6px;
}
.conteo-nav .nav-lateral {
  padding: 8px 4px;
  font-size: 11px;
}

/* ── Admin cards de diferencias ────────────────────────────────────────── */
.diff-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  margin-bottom: 8px;
  overflow: hidden;
}
.diff-card-body { padding: 12px 14px; }
.diff-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--gray-100);
}
.diff-card-btn {
  padding: 14px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.diff-card-btn.aprobar {
  background: #f0fdf4;
  color: var(--green-dark);
  border-right: 1px solid var(--gray-100);
}
.diff-card-btn.aprobar.active { background: var(--green-main); color: white; }
.diff-card-btn.rechazar { background: #fef2f2; color: #b91c1c; }
.diff-card-btn.rechazar.active { background: var(--red); color: white; }

/* ── Barra de progreso compacta ─────────────────────────────────────────── */
.prog-bar { background: rgba(255,255,255,0.25); border-radius: 99px; height: 6px; overflow: hidden; }
.prog-bar-fill { height: 6px; border-radius: 99px; background: linear-gradient(90deg, rgba(255,255,255,0.6), white); transition: width 0.4s; }

/* ── Sucursal buttons en login ──────────────────────────────────────────── */
.suc-btn {
  padding: 14px 12px;
  border-radius: 12px;
  border: 2px solid var(--gray-200);
  background: white;
  cursor: pointer;
  font-family: 'Exo 2', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.suc-btn:active { transform: scale(0.97); }

/* ── User list item ─────────────────────────────────────────────────────── */
.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--gray-200);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 60px;
  -webkit-tap-highlight-color: transparent;
}
.user-item:active { transform: scale(0.98); }
.user-item.selected { border-color: var(--blue-main); background: #eff6ff; }

.user-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

/* ── Modo escáner ─────────────────────────────────────────────────────── */
.scanner-input {
  font-size: 18px !important;
  padding: 14px 16px !important;
  text-align: center;
  border: 2.5px solid var(--blue-glow);
  border-radius: 12px;
  letter-spacing: 2px;
}
.scanner-input:focus { border-color: var(--green-main); box-shadow: 0 0 0 4px rgba(34,197,94,0.15); }

/* ── Badge de estado ─────────────────────────────────────────────────── */
.estado-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Password confirm modal ─────────────────────────────────────────── */
.confirm-pin-input {
  font-size: 24px !important;
  letter-spacing: 8px;
  text-align: center;
  padding: 12px !important;
  min-height: 56px;
}

/* ── Responsive específico ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .screen-content { padding: 10px !important; }
  .product-name { font-size: 16px; }
  .stock-box-num { font-size: 24px; }
  .qty-input-big { font-size: 38px !important; padding: 10px 6px !important; }
  .qty-big-btn { width: 52px; height: 52px; font-size: 26px; }
  .save-btn-big { min-height: 52px; font-size: 16px !important; }
  .conteo-nav { grid-template-columns: 48px 1fr 48px; gap: 5px; }
  .conteo-bottom-bar { padding: 8px 10px 10px; }
  .product-card-body { padding: 12px; }
}

@media (max-width: 390px) {
  .qty-input-big { font-size: 32px !important; }
  .qty-big-btn { width: 46px; height: 46px; font-size: 22px; }
  .conteo-nav { grid-template-columns: 42px 1fr 42px; }
  .conteo-nav button { font-size: 11px; padding: 6px 4px; }
  .product-name { font-size: 15px; }
  .save-btn-big { min-height: 50px; font-size: 15px !important; }
}

@media (max-width: 340px) {
  .qty-input-big { font-size: 28px !important; }
  .qty-big-btn { width: 40px; height: 40px; font-size: 20px; }
}
